Oracle Database rman remote recovery

Source: Internet
Author: User

Today, I will share with you the solution for oracle Database rman remote recovery. If you do not want to go to the reference page, the specific method is as follows.


I want to implement data guard between two sets of rac. Because datafile, controlfile, and even archivelog are all stored on asm, it is unrealistic to directly copy data. The asm disk is always used, so I want to perform full rman backup from database a, and then copy the backup file to database B for rman recovery. The original intention is that it is so simple, but the results have encountered n-plus problems and cannot be achieved, the following method is obtained after numerous tests.

Oracle version: 11.2.0.0

First group rac a ps: hostname, followed by instancename
Rac1: orcl1
Rac2: orcl2
Rac3: orl3

Group 2 RAC B
Rac8: orcl1
Rac9: orcl2

I have already created two groups of rac and created the orcl database respectively. I have done some operations in the database of group A rac, I hope that the newly created table data will also appear in rac B. What I want to do now is to use rman on rac1 for full database backup and copy the backup file to rac8, then perform rman recovery so that rac8 is a copy of the oracle database on rac1.

1. Perform rman full backup in rac1

Log on to rac1 and use rman to back up the database as follows:
[Oracle @ rac1 ~] $ Rman target/
RMAN> backup database format '/u01/app/oracle/backup/orcl01.dbf ';
If the backup is successful, I will be told:
The data file backup file is/u01/app/oracle/backup/orcl01.dbf'
Controlfile, spfile backup file for/u01/app/oracle/backup/c-1351646173-20130822-00
Note: I have added the format parameter to back up the file to the path and name I specified. The reason is that during Remote recovery, the directory in which rman reads the backup file is the same as that in the backup. If format is not used here, it is backed up to the default asm disk, it is difficult to copy the backup file to the asm disk in another region. For example, the problem I encountered is that the file name parameter backed up to the asm by default is too long to be copied to the asm disk in another region.

2. Copy the backup file from rac1 to rac8

The files to be copied are as follows:
The data file backup file is/u01/app/oracle/backup/orcl01.dbf'
Controlfile, spfile backup file for/u01/app/oracle/backup/c-1351646173-20130822-00
After copying to rac8, it is still placed in the same path and configured with the same permissions. Generally, it is the oracle: oinstall permission.

3. rman recovery on rac8

We only need to restore controlfile and datafile.

The same spfile should be used for backup and recovery, but we can see that group A has three rac nodes and group B has two rac nodes, the configuration of these two groups of rac servers is different. spfile defines node information and initialization information, the information of group a rac is not applicable to Group B, so I will only recover controlfile and datafile here.

We can see on the Internet that the remote rman recovery requires the remote dbid to be set as the local value. After a long time, we find that this is not required. The dbid has been defined in controlfile, as long as the controlfile is restored, dbid is the same.

To recover controlfile, the database must be in the nomount state.
[Oracle @ rac8 ~] $ Uniread sqlplus '/as sysdba'
SQL> shutdown immediate;
SQL> shutdown nomount;
[Oracle @ rac8 ~] $ Uniread rman target/
RMAN> restore controlfile from '/u01/app/oracle/backup/c-1351646173-20130822-00 ′;
The recovery is successful.

Restoring data files requires the database to be in the mount state.
[Oracle @ rac8 ~] $ Uniread sqlplus '/as sysdba'
SQL> shutdown immediate;
SQL> shutdown mount;
Note: you may need to add the resetlogs parameter to the mount status.
[Oracle @ rac8 ~] $ Uniread rman target/
RMAN> list backup of database;
The backup file information is displayed.
RMAN> restore database;
RMAN> recover database;
The recovery is over.

4. Start oracle to open on rac8

This alone makes sense, after recovery, because the data dictionary and other information on rac8 has changed, all of them will report an error ORA-39700: database must be opened with UPGRADE option
Then we need to start to the upgrade mode.
SQL> startup UPGRADE;
Error: ORA-39701: database must be mounted EXCLUSIVE for UPGRADE or DOWNGRADE
The solution to this error is to disable cluster parameters.
SQL> STARTUP NOMOUNT;
SQL> ALTER SYSTEM SET CLUSTER_DATABASE = FALSE scope = spfile;
SQL> SHUTDOWN IMMEDIATE;
SQL> startup UPGRADE;
In this way, the cluster is successfully started. Remember to enable the cluster parameters.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.