# RMAN Duplicate fails with error
RMAN-06617
RUN {
set until time "to_date('Mar 25 2014 19:33:00','Mon DD YYYY HH24:MI:SS')";
DUPLICATE DATABASE TO <db name> BACKUP LOCATION '<directory>/<db name>/backupsets' NOFILENAMECHECK;
}
RMAN-06199: database mounted
RMAN-08031: released channel: ORA_AUX_DISK_1
RMAN-08030: allocated channel: ORA_AUX_DISK_1
RMAN-08500: channel ORA_AUX_DISK_1: SID=301 device type=DISK
RMAN-08030: allocated channel: ORA_AUX_DISK_2
RMAN-08500: channel ORA_AUX_DISK_2: SID=5 device type=DISK
RMAN-08030: allocated channel: ORA_AUX_DISK_3
RMAN-08500: channel ORA_AUX_DISK_3: SID=105 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 03/27/2014 04:27:33
RMAN-05501: aborting duplication of target database
RMAN-06617: UNTIL TIME (25-MAR-14) is ahead of last NEXT TIME in archived logs (25-MAR-14)
CAUSE
The DUPLICATE procedure between 10g and 11g has significantly changed related to the controlfile.
In 10g: The controlfile get created after the restore.
In 11g: At first the controlfile is restored, before the datafiles are restored.
o UNTIL SCN/TIME specified should be equal or less than "Next SCN" value of the most recently backed up archivelog
in backupset as per 'list backup of archivelog all' command.
Example:
RMAN> LIST BACKUP OF ARCHIVELOG ALL;
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ --------------------
8461 40.00K DISK 00:00:03 25-MAR-2014 19:32:59
BP Key: 8463 Status: AVAILABLE Compressed: NO Tag: TAG20140325T193256
Piece Name: <directory>/<backup piece>
List of Archived Logs in backup set 8461
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- -------------------- ---------- ---------
1 1343 2778477340 25-MAR-2014 19:32:31 2778477590 25-MAR-2014 19:32:44
1 1344 2778477590 25-MAR-2014 19:32:44 2778477634 25-MAR-2014 19:32:55 <<--**
The restore of the controlfile is checking the UNTIL TIME, and is correctly reporting the RMAN-6617,
as RMAN will NOT be able to recover up till this time (Mar 25 2014 19:33:00).
SOLUTION
Set correct values for UNTIL TIME CLAUSE
a) Use "Next SCN" or "Next Time" of last available backedup archivelog sequence in backupset.
or
b) If NO UNTIL-clause is used, then RMAN will duplicate until the last available archivelog.
1) Find the UNTIL Clause value to be used, for example use rman command like
RMAN> LIST BACKUP OF ARCHIVELOG ALL;
As per above example output:
25-MAR-2014 19:32:55 is the 'Next Time' of the last backed up sequence# 1344
in above archivelog backupset and hence
.
-> set 'UNTIL TIME' value to 'Mar 25 2014 19:32:55' <<--**
Solution/Example:
RUN {
set until time "to_date('Mar 25 2014 19:32:55','Mon DD YYYY HH24:MI:SS')";
DUPLICATE DATABASE TO <db name> BACKUP LOCATION '<directory>/<db name>/backupsets' NOFILENAMECHECK;
}