Wednesday, May 1, 2013

RMAN-06025: no backup of archived log for thread X with sequence Y and starting SCN of Z found to restore

"Restore validate" command could be used to determine if the backups are intact and could be used for a restore operation without any issue. The command could be used to validate database restore as well as archive log restore.
During archivelog restore it is possible to encounter errors such as below
RMAN> restore archivelog all validate;

Starting restore at 25-APR-13
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/25/2013 16:18:21
RMAN-06026: some targets not found - aborting restore
RMAN-06025: no backup of archived log for thread 1 with sequence 1714 and starting SCN of 43439995 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 1713 and starting SCN of 43408508 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 1712 and starting SCN of 43389822 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 1711 and starting SCN of 43364551 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 1710 and starting SCN of 43333559 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 1709 and starting SCN of 43240943 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 1708 and starting SCN of 43203417 found to restore
The reason for this error is that "archive all" try to validate restore of all archivelogs and doesn't consider the retention policy.



Solution for this is to restore archivelog within the retention period. In this case retention period was
RMAN> show all;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
Use the retention period in the validate command as
RMAN>  restore archivelog from time='sysdate - 2' validate;

Starting restore at 25-APR-13
using channel ORA_DISK_1

channel ORA_DISK_1: scanning archived log /data/flash_recovery/ENT11G2/archivelog/2013_04_24/o1_mf_1_1_8qjkzmll_.arc
channel ORA_DISK_1: scanning archived log /data/flash_recovery/ENT11G2/archivelog/2013_04_25/o1_mf_1_2_8qkj6mv6_.arc
channel ORA_DISK_1: starting validation of archived log backup set
channel ORA_DISK_1: reading from backup piece /data/flash_recovery/ENT11G2/backupset/2013_04_24/o1_mf_annnn_TAG20130424T161933_8qhy05yr_.bkp
channel ORA_DISK_1: piece handle=/data/flash_recovery/ENT11G2/backupset/2013_04_24/o1_mf_annnn_TAG20130424T161933_8qhy05yr_.bkp tag=TAG20130424T161933
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting validation of archived log backup set
channel ORA_DISK_1: reading from backup piece /data/flash_recovery/ENT11G2/backupset/2013_04_24/o1_mf_annnn_TAG20130424T162300_8qhy6njm_.bkp
channel ORA_DISK_1: piece handle=/data/flash_recovery/ENT11G2/backupset/2013_04_24/o1_mf_annnn_TAG20130424T162300_8qhy6njm_.bkp tag=TAG20130424T162300
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
Finished restore at 25-APR-13

RMAN> restore archivelog from time='sysdate - 4' validate;

Starting restore at 25-APR-13
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/25/2013 16:23:51
RMAN-06026: some targets not found - aborting restore
RMAN-06025: no backup of archived log for thread 1 with sequence 1714 and starting SCN of 43439995 found to restore

Useful metalink notes
OERR: RMAN-6025 { Message text depends on version } [ID 48184.1]
No Backup Of Log Thread 1 Seq 4079 Scn 6508223992 Found To Restore Rman-6025 [ID 308289.1]
RMAN RESTORE ARCHIVELOG ALL VALIDATE fails with RMAN-06025: no backup of log [ID 1391263.1]