MAN: Point-in-Time Recovery of a Backup From Before Last Resetlogs
This Note is valid for 8i, 9i, 10g, 11g Releases
Problem Description:
====================
You would like to restore a database to a point-in-time, but the backup
being used is from before the last resetlogs.
The problem is that when a database is opened with resetlogs, the incarnation
of the database is also reset and RMAN keeps a record of the incarnation of the
database in the Recovery Catalog.
Problem Explanation:
====================
When we do a point-in-time recovery and open the database with resetlogs, we
also need to tell RMAN that we are reseting the database incarnation. Therefore
we use the RESET DATABASE command to direct RMAN to create a new database
incarnation record in the recovery catalog. This new incarnation record
indicates the current incarnation. RMAN will associate all subsequent backups
and log archiving done by the target database with the new database incarnation.
If we want to restore the database to a point-in-time before the last
resetlogs, we need to tell RMAN that our current incarnation needs to be reset
to the old one.
Problem References:
===================
ORACLE8i BACKUP AND RECOVERY GUIDE
Search Words:
=============
RESET INCARNATION RECOVER RESETLOGS
Solution Description:
=====================
Before we can restore a backup from before the last resetlogs, we need to reset
the database to the old incarnation number.
Here are the steps to reseting the correct incarnation and restoring the
database to a point in time before the last resetlogs.
Note: Target database should be nomounted.
1. Start RMAN and connect only to the catalog database.
% rman catalog rman/rman@rcat
2. Execute the command that lists all the incarnation values for the
databases in the recovery catalog.
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 2 R815 579966833 NO 1 03-MAY-99
224 225 R815 579966833 YES 92402 05-MAY-99
We can see that one of the databases had been open with resetlogs and a new
incarnation was started (DB_ID 579966833). We should look at the column
DATABASE INC KEY. We can see the original incarnation for this database was 2
and was reset to what is still the current incarnation of 225. 2 is the
database incarnation that has to be set in order to restore a backup from
before the last resetlogs.
3. We first need to let RMAN know what database ID we will be dealing
with, so we execute the following command:
RMAN> Set dbid 579966833;
4. Now we need to connect to the target instance so we can verify the
database ID.
RMAN> connect target
RMAN-06005: connected to target database: R815 (DBID=579966833)
5. Since we are connected to both the recovery catalog and target
database, we need to tell RMAN to reset the database incarnation to 2.
We do this with the following command:
RMAN> reset database to incarnation 2;
We can now see that the current incarnation has been set back to 2.
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 2 R815 579966833 YES 1 03-MAY-99
224 225 R815 579966833 NO 92402 05-MAY-99
6. After resetting the database, issue restore and recover commands to restore
and recover the database files from the prior incarnation, then open the database
with the RESETLOGS option. You need start from restoring a previous incarnation
control file when the database is in nomount state. When the database is reset to
the previous incarnation, the catalog will automatically picks up a right control
file. After restoring the control file, the database must be mounted for datafiles
restore.
run {
set until time 'Jul 8 1999 07:55:00'; # set time to just before data was lost
allocate channel dev1 type disk;
shutdown abort;
startup nomount;
restore controlfile;
alter database mount; # mount database after restoring control file
restore database;
recover database;
alter database open resetlogs; # this command automatically resets the database
# so that this incarnation is the new incarnation
}
Solution Explanation:
=====================
Once we set the database to the prior incarnation, RMAN will allow a restore
and recover of the database using a backup from before the last resetlogs.
Solution References:
====================
Oracle8i Recovery Manager User’s Guide, Release 1 (8.1.6) - Part No. A76990-01
Oracle9i Recovery Manager User’s Guide, Release 1 (9.0.1) - Part No. A9013
For 10g, 11g related issues with Incarnation and FRA ( Fast/Flash Recovery Area )
Please see
(Doc ID 965122.1) RMAN RESTORE FAILS WITH RMAN-06023 BUT THERE ARE BACKUPS AVAILABLE
=====================================================================
Comments
Post a Comment
Oracle DBA Information