OK...here's the requirement...I've a full 'online' backup of a RAC database and need to recover from it multiple times and open the database with 'alter database open resetlogs;' statement.
backup as compressed backupset incremental level 0 database TAG FULL_BACKUP_05JAN2015
I get these tags above populated from variables but hard-coding
them to keep it simple...
Perform 1st restore and recovery as below...
startup nomount;
set DBID xxxxxxx;
restore controlfile from 'c-xx-xxxx'; (this is from the last
autobackup)
alter database mount;
list incarnation of database;
restore and recover database as below…
using tape channels as the backup has already been removed
from the disks and only available on SBT_TAPE channel.
run {
allocate channel t1 type 'SBT_TAPE';
send 'NSR_ENV=(NSR_SERVER=xxxx,NSR_GROUP=xxxx,NSR_DATA_VOLUME_POOL=xxxxx,NSR_CLIENT=xxxxxx,NSR_SAVESET_BROWSE="xxxxx",NSR_SAVESET_RETENTION="xxxxx")';
SET UNTIL TIME "TO_DATE('06-JAN-2015
11:15:00','DD-MON-YYYY HH24:MI:SS')"; (I've all the archive logs upto and
after this point on disk and tape)
restore database;
recover database;
release channel t1;
}
You can allocate multiple channels depending on your media/tape system configuration.
This worked perfectly fine…and I've opened the database as
below…
rman> alter database open resetlogs;
Come next day …I've the requirement to restore from the
same backup so I run the same process again…and this time it fails...
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-03002: failure of restore command at 01/09/2015
14:26:50
RMAN-20207: UNTIL
TIME or RECOVERY WINDOW is before RESETLOGS time
Now it failed with
the above errors...
The cause of the
issue is the implicit crosscheck and cataloging being done by rman during restore
and recover phase…
….
….
….
executing command:
SET until clause
Starting restore at
09-JAN-2015 14:26:45
Starting implicit
crosscheck backup at 09-JAN-2015 14:26:45
Crosschecked 16
objects
Finished implicit
crosscheck backup at 09-JAN-2015 14:26:47
Starting implicit
crosscheck copy at 09-JAN-2015 14:26:47
Finished implicit
crosscheck copy at 09-JAN-2015 14:26:47
searching for all
files in the recovery area
cataloging files...
cataloging done
List of Cataloged
Files
=======================
File Name: +XXX/XXXXXX/AUTOBACKUP/2015_01_08/s_868464001.6080.868464003
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_09/thread_1_seq_8.1623.868492825
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_09/thread_2_seq_5.1489.868492827
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_09/thread_1_seq_9.5858.868528837
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_09/thread_1_seq_10.5893.868532601
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_09/thread_2_seq_6.5852.868536051
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_09/thread_1_seq_11.5800.868536649
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_2_seq_1.6077.868463987
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_1_seq_6110.536.868462613
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_1_seq_1.6085.868465953
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_1_seq_2.6141.868465963
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_1_seq_6111.6443.868462613
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_1_seq_3.6625.868465973
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_2_seq_2.529.868465975
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_1_seq_4.528.868465985
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_1_seq_5.527.868465995
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_1_seq_6.1982.868466007
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_2_seq_3.5702.868466011
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_1_seq_7.531.868466023
File Name: +XXX/XXXXXX/ARCHIVELOG/2015_01_08/thread_2_seq_4.1877.868485729
released channel: t1
released channel: t2
released channel: t3
released channel: t4
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-03002: failure of restore command at 01/09/2015
14:26:50
RMAN-20207: UNTIL TIME or
RECOVERY WINDOW is before RESETLOGS time
RMAN> **end-of-file**
As you can see above, RMAN is cataloging the archive logs
generated post-resetlogs and getting the
new incarnation information…
The way I’ve resolved the issue is as follows…
First delete the archive logs which are generated after the last
resetlogs operation…this timestamp is after our recovery point...
So that’s basically the highlighted files above…
Try running the same process again…this time, rman couldn't catalog
these new archive logs…and it worked perfectly fine.
This is especially useful if you need to restore and recover
from a gold backup multiple times and don’t want to worry about multiple
incarnations of the database…and try resetting them etc.