1) Create an initialization parameter for auxiliary instance by copying the target database initialization parameter file. Change the parameters as follows:
Set DB_NAME to the new database name duplicate-database
Set CONTROL_FILES to store two copies of the control file in +DISK2
Set DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT to convert the datafile and online log file names from +DISK1 to +DISK2
Set any other initialization parameters that end in _DEST, such as DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_DEST_n, to reference +DISK2
Comment all the RAC related parameters in the duplicate-database parameter file. We will re-enable them once the duplicate is completed.
2) For an active production RAC environment, you must use a SET UNTIL clause, otherwise the archivelogs would not have been backed up and the duplicate would fail with RMAN-06025.
To get the sequence number, you need to look at the following:
RMAN> list backup of archivelog all;
We need to determine the most recent archivelog backed up from each thread, and then take the least recent of these.
Example
Parameter file (init.ora) would include:
DB_NAME=duplicate-database
CONTROL_FILES=+DISK2,+DISK2
DB_FILE_NAME_CONVERT=+DISK1,+DISK2
LOG_FILE_NAME_CONVERT=+DISK1,+DISK2
Create an SPFILE from the parameter file, and start the auxiliary instance:
SQL> CONNECT SYS/oracle@duplicate-database;
SQL> CREATE SPFILE FROM PFILE='location of auxiliary instance pfile';
SQL> STARTUP NOMOUNT;
Then run the following RMAN commands to duplicate the database:
RMAN> CONNECT TARGET /;
RMAN> CONNECT CATALOG rman/cat@catalog-database;
RMAN> CONNECT AUXILIARY SYS/oracle@duplicate-database;
RMAN> run {
set until sequence x thread y;
DUPLICATE TARGET DATABASE TO duplicate-database;
}
==> replace the sequence and thread number as appropriate
When the DUPLICATE command completes, the duplicate database is created, with datafiles, online logs and control files in ASM disk group +DISK2.
Shutdown the database and add all the RAC related parameters and then start the database.
No comments:
Post a Comment