The RMAN “DUPLICATE TARGET DATABASE TO <auxdbname> FROM ACTIVE DATABASE” command fails from time to time… The research revealed a strange buggy behavior explained in the MOS Doc ID 2054766.1
The error we are getting is:
Oracle instance shut down RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of Duplicate Db command at 03/26/2018 18:29:08 RMAN-05501: aborting duplication of target database RMAN-03015: error occurred in stored script Memory Script RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 21308 and starting SCN of 35688306256
… and the cause is explained as: “Duplicate process takes the SCN (for until scn) from most recent backup control file checkpoint_change# and if the SCN of the control file in the backup was higher than the SCN of the most recent archived log in backup, then RMAN recovery will be looking for archives to recover the database as per UNTIL SCN condition and it fails.”
So, shortly, while you are in the middle of a cloning process, if the target database plays around with the controlfile via auto controlfile backup, your duplicate task will get the error.
To prevent this, you can apply one of the following solutions:
- Disable controlfile autobackup or disable any scheduled backups that will trigger a autobackup of the controlfile during the duplicate process.
- Apply patch 21868720.
- Connect to catalog while doing duplicate.
- While performing duplicate, use a SET UNTIL clause. I.e., “SET UNTIL SCN” or “SET UNTIL SEQUENCE” explicitly.
run { set until SCN 23678912; ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK; ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK; ALLOCATE AUXILIARY CHANNEL aux3 DEVICE TYPE DISK; ALLOCATE AUXILIARY CHANNEL aux4 DEVICE TYPE DISK; DUPLICATE TARGET DATABASE TO DEV1 FROM ACTIVE DATABASE ... ... }