RMAN duplicate recovery from different machines

Source: Internet
Author: User

Not long ago, because the developer truncate an important table, he found us and made an exception recovery to restore the table.
The following is an experiment I did on the vm afterwards. It is completely replicated. Of course, you can also set the time, scn, and restore it to a previous time point.

1. prepare statements
Select 'set newname for datafile' | file_id | 'to "/home/Oracle/oradata/s1/' | substr (file_name, 25) | '"; 'From dba_data_files;
Select 'set newname for tempfile' | file_id | 'to "/home/oracle/oradata/s1/' | substr (file_name, 25) | '"; 'From dba_temp_files;
Select 'group' |. group # | '(''/home/oracle/oradata/s1/' | substr (member, 25) | ''') size '| bytes | 'reuse ,'
From v $ logfile a, v $ log B
Where a. GROUP # = B. GROUP #;

2. Copy the relevant files to s2 (Backup Directory, log directory, flash_recovery_area can mount the s1 directory to s2 using nfs, pay attention to directory permission issues)

Copy and add inits1.ora (the path can be omitted if the path is the same)
Db_file_name_convert = ('/home/oracle/oradata/s1','/home/oracle/oradata/s1 ')
Log_file_name_convert = ('/home/oracle/oradata/s1','/home/oracle/oradata/s1 ')
Db_unique_name = s2
And related modifications

Copy tnsnames. ora, backup file, archive file, flash_recovery_area, admin directory related to dump

Create oradata/s1 directory

3. Start s2 to nomount

Startup nomount

If nfs mounting is used, run the command on s2 first.

SQL> Alter system set events '10298 trace name context forever, level 32'

Otherwise, an error is reported.

ORA-27054: NFS file system where the file is created or resides is not mounted with correct options

4. Execute
Rman target 'sys/fishcat @ s1 'auxiliary/
----- The path of set newname can be omitted.
Run {
Set newname for datafile 7 to "/home/oracle/oradata/s1/test01.dbf ";
Set newname for datafile 6 to "/home/oracle/oradata/s1/vip01.dbf ";
Set newname for datafile 5 to "/home/oracle/oradata/s1/example01.dbf ";
Set newname for datafile 4 to "/home/oracle/oradata/s1/users01.dbf ";
Set newname for datafile 3 to "/home/oracle/oradata/s1/sysaux01.dbf ";
Set newname for datafile 2 to "/home/oracle/oradata/s1/undotbs01.dbf ";
Set newname for datafile 1 to "/home/oracle/oradata/s1/system01.dbf ";
Set newname for tempfile 1 to "/home/oracle/oradata/s1/temp01.dbf ";
Duplicate target database to s2 nofilenamecheck logfile
Group 3 ('/home/oracle/oradata/s1/redo03.log') size 52428800 reuse,
Group 2 ('/home/oracle/oradata/s1/redo02.log') size 52428800 reuse,
Group 1 ('/home/oracle/oradata/s1/redo01.log') size 52428800 reuse;
}

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.