Monday, May 4, 2026

Resuming RMAN Duplicate Command

 If you are in a process of cloning a database using RMAN duplicate command, there is a possibility that duplicate command fails in the middle due to some unforeseen problem. If database is relatively small, you may try to re-execute duplicate command from scratch. However, if the database is quite huge in size and most of the work during duplicate has already completed, it is better to continue the duplication process from the point where it failed/aborted. In this article I will discuss a scenario that I faced when duplicate command failed and I continued the process manually from the point where it failed.

In most of the cases, simply re-executing the DUPLICATE command after fixing the problem that caused failure of initial execution is sufficient for command to complete successfully while bypassing previously executed tasks during first execution i.e. restoration of datafiles.

In some cases, manual steps might be required. I was doing a duplicate of database using backup form a production database using following command  

RMAN> duplicate database to MYDB backup location '/backup/tempbackupprod/' nofilenamecheck; 

Following is some part of output including the end part where duplicate command failed. 

sql statement: create spfile from memory 

 

contents of Memory Script: 

{ 

   shutdown clone immediate; 

   startup clone nomount; 

} 

executing Memory Script 

 

Oracle instance shut down 

 

connected to auxiliary database (not started) 

Oracle instance started 

 

Total System Global Area   25654751232 bytes 

 

Fixed Size                     2265224 bytes 

Variable Size               7784632184 bytes 

Database Buffers           17649631232 bytes 

Redo Buffers                 218222592 bytes 

 

contents of Memory Script: 

{ 

   sql clone "alter system set  db_name = 

 ''MYDB'' comment= 

 ''Modified by RMAN duplicate'' scope=spfile"; 

   sql clone "alter system set  db_unique_name = 

 ''MYDBQ'' comment= 

 ''Modified by RMAN duplicate'' scope=spfile"; 

   shutdown clone immediate; 

   startup clone force nomount 

   restore clone primary controlfile from  '/backup/tempbackupprod/control.bak'; 

   alter clone database mount; 

} 

executing Memory Script 

 

sql statement: alter system set  db_name =  ''MYDB'' comment= ''Modified by RMAN duplicate'' scope=spfile 

 

 

 

channel ORA_AUX_DISK_1: starting datafile backup set restore 

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set 

channel ORA_AUX_DISK_1: restoring datafile 00001 to +DATA/mydb/system01.dbf 

channel ORA_AUX_DISK_1: restoring datafile 00003 to +DATA/mydb/undotbs01.dbf 

channel ORA_AUX_DISK_1: restoring datafile 00005 to +DATA/mydb/data01.dbf 

channel ORA_AUX_DISK_1: restoring datafile 00009 to +DATA/mydb/indx01.dbf 

channel ORA_AUX_DISK_1: restoring datafile 00013 to +DATA/mydb/data02.dbf 

channel ORA_AUX_DISK_1: restoring datafile 00017 to +DATA/mydb/indx02.dbf 

channel ORA_AUX_DISK_1: restoring datafile 00022 to +DATA/mydb/undotbs01.dbf 

channel ORA_AUX_DISK_1: restoring datafile 00024 to +DATA/mydb/users01.dbf 

channel ORA_AUX_DISK_1: reading from backup piece /backup/tempbackupprod/db_qot8fih3_1_1.bak 

channel ORA_AUX_DISK_2: starting datafile backup set restore 

channel ORA_AUX_DISK_2: specifying datafile(s) to restore from backup set 

channel ORA_AUX_DISK_2: restoring datafile 00002 to +DATA/mydb/sysaux01.dbf 

channel ORA_AUX_DISK_2: restoring datafile 00007 to +DATA/mydb/indx03.dbf 

channel ORA_AUX_DISK_2: restoring datafile 00011 to +DATA/mydb/data03.dbf 

 

 

 

channel clone_defaultdeleting archived log(s) 

archived log file name=+FRA/mydb/archivelog/2018_07_20/thread_3_seq_108811.107340.981994139 RECID=36 STAMP=981994160 

archived log file name=+FRA/mydb/archivelog/2018_07_20/thread_3_seq_108812.108579.981994137 thread=3 sequence=108812 

channel clone_defaultdeleting archived log(s) 

archived log file name=+FRA/mydb/archivelog/2018_07_20/thread_1_seq_81057.106833.981994129 RECID=24 STAMP=981994135 

channel clone_defaultdeleting archived log(s) 

archived log file name=+FRA/mydb/archivelog/2018_07_20/thread_2_seq_109991.109070.981994131 RECID=31 STAMP=981994150 

channel clone_defaultdeleting archived log(s) 

archived log file name=+FRA/mydb/archivelog/2018_07_20/thread_3_seq_108812.108579.981994137 RECID=33 STAMP=981994159 

channel clone_defaultdeleting archived log(s) 

archived log file name=+FRA/mydb/archivelog/2018_07_20/thread_4_seq_101513.112272.981994137 RECID=26 STAMP=981994149 

media recovery complete, elapsed time: 00:00:05 

Finished recover at 20-JUL-18 

 

 

 

sql statement: CREATE CONTROLFILE REUSE SET DATABASE "MYDBQ" RESETLOGS ARCHIVELOG 

  MAXLOGFILES    192 

  MAXLOGMEMBERS      3 

  MAXDATAFILES     1024 

  MAXINSTANCES    32 

  MAXLOGHISTORY     9344 

 LOGFILE 

  GROUP   1 ( '+RACDG/mydb/redo1_01.rdo', '+RACDG/mydb/redo1_02.rdo' ) SIZE 200 M  REUSE, 

  GROUP   2 ( '+RACDG/mydb/redo2_01.rdo', '+RACDG/mydb/redo2_02.rdo' ) SIZE 200 M  REUSE, 

  GROUP   3 ( '+RACDG/mydb/redo3_02.rdo', '+RACDG/mydb/redo3_01.rdo' ) SIZE 200 M  REUSE, 

  GROUP   4 ( '+RACDG/mydb/redo4_01.rdo', '+RACDG/mydb/redo4_02.rdo' ) SIZE 200 M  REUSE, 

  GROUP   5 ( '+RACDG/mydb/redo5_01.rdo', '+RACDG/mydb/redo5_02.rdo' ) SIZE 200 M  REUSE, 

  GROUP   6 ( '+RACDG/mydb/redo6_02.rdo', '+RACDG/mydb/redo6_01.rdo' ) SIZE 200 M  REUSE, 

  GROUP   7 ( '+RACDG/mydb/redo7_02.rdo', '+RACDG/mydb/redo7_01.rdo' ) SIZE 200 M  REUSE, 

  GROUP   8 ( '+RACDG/mydb/redo8_01.rdo', '+RACDG/mydb/redo8_02.rdo' ) SIZE 200 M  REUSE, 

  GROUP   9 ( '+RACDG/mydb/redo9_01.rdo', '+RACDG/mydb/redo9_02.rdo' ) SIZE 200 M  REUSE, 

  GROUP  10 ( '+RACDG/mydb/redo10_01.rdo', '+RACDG/mydb/redo10_02.rdo' ) SIZE 200 M  REUSE 

 DATAFILE 

  '+DATA/mydb/system01.dbf' 

 CHARACTER SET UTF8 

 

RMAN-00571: =========================================================== 

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== 

RMAN-00571: =========================================================== 

RMAN-03002: failure of Duplicate Db command at 07/20/2018 16:10:02 

RMAN-05501: aborting duplication of target database 

RMAN-06136: ORACLE error from auxiliary database: ORA-01503: CREATE CONTROLFILE failed 

ORA-00349: failure obtaining block size for '+RACDG/mydb/redo1_01.rdo' 

ORA-15001diskgroup "RACDG" does not exist or is not mounted 

ORA-15001diskgroup "RACDG" does not exist or is not mounted 

 

Recovery Manager complete. 

As you see above, my duplicate command had almost completed. It failed while recreating the control file; and the reason of failure was that I wrongly specified the ASM diskgroup name (+RACDG) in log_cile_name_convert parameter. The correct name of the ASM diskgorup was “+FRA”. 

To solve this problem, I just needed to create controlefile (that failed above) with the correct redo log files path (by providing correct diskgroup name  as well as correct value for the parameter log_file_name_convert in the init file). 

I took backup of controlfile to trace, modified the script with correct redo logfile path (by updating it with the correct diskgorup name), and executed the script to create the controlfile 

SQL > shutdown immediate 

ORA-01109: database not open 

 

 

Database dismounted. 

ORACLE instance shut down.  

Startup in mount mode again, and take controlfile backup to trace

SQL > startup mount 

ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance 

ORACLE instance started. 

 

Total System Global Area 2.5655E+10 bytes 

Fixed Size                  2265224 bytes 

Variable Size            7583305592 bytes 

Database Buffers         1.7851E+10 bytes 

Redo Buffers              218222592 bytes 

Database mounted. 

SQL> alter database backup controlfile to trace as '/u01/app/oracle/control.txt'; 

 

Database altered.  

Modified controlfile creation script and updated the diskgroup name for redo log files. 

CREATE CONTROLFILE REUSE SET DATABASE "MYDBQ" RESETLOGS ARCHIVELOG 

MAXLOGFILES 192 

MAXLOGMEMBERS 3 

MAXDATAFILES 1024 

MAXINSTANCES 32 

MAXLOGHISTORY 9344 

LOGFILE 

GROUP 1 ( 

'+FRA/mydb/redo1_01.rdo', 

'+FRA/mydb/redo1_02.rdo' 

) SIZE 200M BLOCKSIZE 512, 

GROUP 2 ( 

'+FRA/mydb/redo2_01.rdo', 

'+FRA/mydb/redo2_02.rdo' 

) SIZE 200M BLOCKSIZE 512, 

GROUP 3 ( 

'+FRA/mydb/redo3_01.rdo', 

'+FRA/mydb/redo3_02.rdo' 

) SIZE 200M BLOCKSIZE 512, 

 

 

 

'+DATA/mydb/data01.dbf', 

'+DATA/mydb/data02.dbf' 

CHARACTER SET UTF8 

;  

Execute the script, and opened the database using resetlogs. 

SQL> @/u01/app/oracle/control.txt 

 

Control file created. 

 

SQL> alter database open resetlogs; 

 

Database altered. 

If you face failure of duplicate command, look at the output of the duplicate command and decide accordingly to continue restoration of the database from the point it failed. 


No comments:

Post a Comment

Popular Posts - All Times