Wednesday, July 17, 2013

RMAN-06054 during rman restore and recovery

Introduction

You may encounter the "RMAN-06054: media recovery requesting unknown archived log ..." error when performing an incomplete database restore and recovery from an RMAN backup.  This error is not a cause of concern under normal circumstances when you use the simple rman restore and recovery commands without a point-in-time recovery such as an UNTIL_TIME recovery.

This blog post assumes that you have already restored/recreated the spfile/pfile and control file respectively and now ready to execute the restore and recovery commmands.

Errors

connect target /

RMAN> connect target /

connected to target database: HRDB (DBID=673562734533, not open)

RMAN> run
2> {
3> restore database;
4> recover database;
5> }

channel ORA_DISK_1: piece handle=/orabackup/databases/fast_recovery_area/HRDB/backupset/2013_05_09/o1_mf_nnndf_TAG20130509T181942_8ueyeiss_.bkp tag=TAG20130509T181942
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 10:14:12
Finished restore at 09-MAY-13

Starting recover at 09-MAY-13
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 1 is already on disk as file /orabackup/databases/fast_recovery_area/HRDB/archivelog/2013_05_09/o1_mf_1_1_8kr5hjek_.arc
archived log for thread 1 with sequence 2 is already on disk as file /orabackup/databases/fast_recovery_area/HRDB/archivelog/2013_05_09/o1_mf_1_2_8pejwkdi4_.arc
archived log file name=/orabackup/databases/fast_recovery_area/HRDB/archivelog/2013_05_09/o1_mf_1_1_8kr5hjek_.arc thread=1 sequence=1
archived log file name=/orabackup/databases/fast_recovery_area/HRDB/archivelog/2013_05_09/o1_mf_1_2_8pejwkdi4_.arc thread=1 sequence=2
unable to find archived log
archived log thread=1 sequence=3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/09/2013 23:14:12
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 3 and starting SCN of 6945324467766 know.  

Solution

Oracle does not stop the recovery at the last available archive log in the database backupsets as per the restored control file.  Instead it keeps on requesting for the "next available archive log sequence" number.  But in reality, as per the above example, there is no log sequence 3.  So the database is already consistent after applying log sequence 2 (final archive log sequence as per the restored control file) and hence the recovery is in fact successful. Just try to open the database with the resetlogs option.  It should work.

rman>exit
sqlplus '/ as sysdba'
sql>alter database open resetlogs
You should get the "Database altered" message which indicates that the database was opened successfully.

Conclusion

If you know about a command or option that lets rman automatically stop the recovery at the last archive log sequence in the backupset, then please comment on our post below.  Such an option will help avoid getting the error in the first place.


No comments:

Related Posts Plugin for WordPress, Blogger...