Tuesday, May 18, 2010

How to resolve ORA-01547 errors during RMAN restore

How to resolve ORA-01547 errors during RMAN restore

You just ran a RMAN duplicate script to clone a production database. After restoring datafiles for almost 6 hours, your duplicate script failed with the following errors towards the end.

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/oradata/REP/system01.dbf'

released channel: ch1
released channel: ch2

RMAN-00571: ========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ==============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/17/2010 14:14:10
RMAN-03015: error occurred in stored script Memory Script
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 11366 lowscn 74424083 found to restore
RMAN-06025: no backup of log thread 1 seq 11365 lowscn 74420409 found to restore

RMAN>


As per Oracle Support document number 274118.1, you copied the archivelog files for seq nos 11366 and 11365 to the auxiliary database server, and issued recover command.

Now oracle says it needs a log seq# 10955 to be restored and recovered. Well seq# 10278 is
from last week's LEVEL 0 backup. At this point, the only solution is to

login to target using rman and backup archivelog files to the same backup destination where
you restored the rest of the rman backups, that is accessible to the auxilairy database.

I issued the following command on the target database instance.

rman > backup archivelog all not backedup to disk;

This way only archivelog files that are not backed up are backed up, to reduce time.

Now go back to the duplicate script via RMAN and rerun it.

Now RMAN in oracle 10g would let you restart a failed RMAN duplicate script and will start recovering files from it left.

You will notice RMAN starts recovering from earlier sequence numbers 10955


starting media recovery

channel ch2: starting archive log restore to default destination
channel ch1: starting archive log restore to default destination
channel ch2: restoring archive log
archive log thread=1 sequence=10955
channel ch2: reading from backup piece /backups/ROD/ROD_20100514_s2494_p1_arc
channel ch1: restoring archive log
archive log thread=1 sequence=10953
channel ch1: restoring archive log
archive log thread=1 sequence=10954
channel ch1: reading from backup piece /backups/ROD/ROD_20100514_s2492_p1_arc
channel ch2: restored backup piece 1


After that you can open the database in "resetlogs" mode without any problem.

RMAN duplicate works to find the latest log file from controlfile if nocatalog is used. If it can't find it on the backup directory, it spits out a message immediately.

At that point, you can backup all the archivelog files and rerun the duplicate.

To avoid this issue, run duplicate command with "set until time" if possible.

No comments:

Post a Comment