Thursday 28 June 2012

RMAN Errors during DUPLICATE/Clone database.


RMAN Duplicate command errors and possible solutions.


Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 06/27/2012 16:49:13
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06101: no channel to restore a backup or copy of the control file


sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 06/27/2012 22:35:01
RMAN-05501: aborting duplication of target database
RMAN-05556: not all datafiles have backups that can be recovered to SCN 10162977180003
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06100: no channel to restore a backup or copy of datafile 407
RMAN-06100: no channel to restore a backup or copy of datafile 406
RMAN-06100: no channel to restore a backup or copy of datafile 405
RMAN-06100: no channel to restore a backup or copy of datafile 404
RMAN-06100: no channel to restore a backup or copy of datafile 403

These errors are quite misleading and attempts to resolve go in vain, unless the proper backups and SCNs are provided for recover.

our recovery script looked like this...
##begin script##
connect target sys/<pw>@SID
connect auxiliary /

run {
SET UNTIL SEQUENCE ## THREAD #;
DUPLICATE TARGET DATABASE
TO "APPSTRDE" device type disk;
}
##end script##
here the sequence has to be picked very carefully, in the below backup logfile review the highlighted sequences and time stamps.

Thrd Seq     Low SCN    Low Time             Next SCN   Next Time
  ---- ------- ---------- -------------------- ---------- ---------
  1    1362    10162976618798 27-JUN-2012 19:11:00 10162976838904 27-JUN-2012 20:03:08
  1    1363    10162976838904 27-JUN-2012 20:03:08 10162976839270 27-JUN-2012 20:03:17
  1    1364    10162976839270 27-JUN-2012 20:03:17 10162977148308 27-JUN-2012 21:04:04
  1    1365    10162977148308 27-JUN-2012 21:04:04 10162977149494 27-JUN-2012 21:04:31
  1    1366    10162977149494 27-JUN-2012 21:04:31 10162977180003 27-JUN-2012 21:13:13
  1    1367    10162977180003 27-JUN-2012 21:13:13 10162977280169 27-JUN-2012 21:40:29
  1    1368    10162977280169 27-JUN-2012 21:40:29 10162977280458 27-JUN-2012 21:40:36
  2    1102    10162976618794 27-JUN-2012 19:11:00 10162976838969 27-JUN-2012 20:03:10
  2    1103    10162976838969 27-JUN-2012 20:03:10 10162976839265 27-JUN-2012 20:03:16
  2    1104    10162976839265 27-JUN-2012 20:03:16 10162977148305 27-JUN-2012 21:04:04
  2    1105    10162977148305 27-JUN-2012 21:04:04 10162977149491 27-JUN-2012 21:04:31
  2    1106    10162977149491 27-JUN-2012 21:04:31 10162977179948 27-JUN-2012 21:13:13
  2    1107    10162977179948 27-JUN-2012 21:13:13 10162977280166 27-JUN-2012 21:40:29
  2    1108    10162977280166 27-JUN-2012 21:40:29 10162977280455 27-JUN-2012 21:40:35
  3    1105    10162976618786 27-JUN-2012 19:10:58 10162976838963 27-JUN-2012 20:03:09
  3    1106    10162976838963 27-JUN-2012 20:03:09 10162976839318 27-JUN-2012 20:03:18
  3    1107    10162976839318 27-JUN-2012 20:03:18 10162977148313 27-JUN-2012 21:04:05
  3    1108    10162977148313 27-JUN-2012 21:04:05 10162977149542 27-JUN-2012 21:04:32
  3    1109    10162977149542 27-JUN-2012 21:04:32 10162977180036 27-JUN-2012 21:13:15
  3    1110    10162977180036 27-JUN-2012 21:13:15 10162977280201 27-JUN-2012 21:40:30
  3    1111    10162977280201 27-JUN-2012 21:40:30 10162977280594 27-JUN-2012 21:40:37

I've decided to go for the last sequence based on the time stamp, as this backup was completed arount 21:45, chosing the time stamp to be 21:40..so there are 4 time stamps with same time but having difference in seconds. 
So the time latest time stamp around the highlighted time is 21:40:37,  my script should have a sequence number 1111 with THREAD 3.

run {
SET UNTIL SEQUENCE 1111 THREAD 3;
DUPLICATE TARGET DATABASE
TO "APPSTRDE" device type disk;
}

though even now I'm not allocating any channels in the run block RMAN did not complain of not having channels etc as specified initially(RMAN-06100: no channel to restore a backup or copy of datafile ) .

for some reason, if sequence based recovery doesn't go through then we can try for backup location based recovery, you can use the below commands to accomplish the task...

Note ** No need to connect to your source (RMAN target) instance, connecting to your auxiliary is sufficient.
##begin script##
connect auxiliary /
run {
debug all;
allocate auxiliary channel c1 device type disk;
allocate auxiliary channel c2 device type disk;
duplicate database to TARGET backup location '/stage/stagedb/SOURCE/'
 NOFILENAMECHECK;
}
##end script##
*enable debug if required, but this will have lot of messages in the logs which would be a little difficult to skim through*.


Following this has resolved my issue, hope it helps!!



No comments:

Post a Comment