How to Restore Oracle RMAN Backup from Previous or Old Incarnation

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Some fact about this Restoration:

  • It will be a point-in-time recovery
  • You must set the incarnation to the previous or required one accorind to your restoration time using RESET DATABASE command

Step 1: List out the Incarnation details by connecting RMAN.

rman catalog rman/rman@rmancat target /
RMAN> list incarnation of database TESTDB7;

DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
90239   90254   TESTDB7  1286920698       PARENT  1          05-SEP-10
90239   90240   TESTDB7  1286920698       CURRENT 972274     28-JUN-11
2142642 2142663 TESTDB7  1300724073       PARENT  155955552  30-NOV-11
2142642 2142643 TESTDB7  1300724073       CURRENT 177309246  02-DEC-11

Step 2: Reset the incarnation

rman catalog rman/rman@rmancat target /

RMAN> shutdown immediate;

database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started

Total System Global Area    2672361472 bytes

Fixed Size                     2229480 bytes
Variable Size               1962937112 bytes
Database Buffers             553648128 bytes
Redo Buffers                 153546752 bytes
Database mounted.
RMAN> reset database to incarnation 2142663;

database reset to incarnation 2142663

Step 3: Verify the Incarnation
RMAN> list incarnation of database TESTDB7;

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
90239   90254   TESTDB7  1286920698       PARENT  1          05-SEP-10
90239   90240   TESTDB7  1286920698       CURRENT 972274     28-JUN-11
2142642 2142663 TESTDB7  1300724073       CURRENT 155955552  30-NOV-11
2142642 2142643 TESTDB7  1300724073       ORPHAN  177309246  02-DEC-11

Step 4: Start recovery

RMAN> RUN
{ SHUTDOWN IMMEDIATE;
  STARTUP NOMOUNT;
  SET UNTIL TIME "to_date('2011-12-01 01:01:01','YYYY-MM-DD HH24:MI:SS')" ;
  RESTORE CONTROLFILE from autobackup;
  ALTER DATABASE MOUNT;
  RESTORE DATABASE;
  RECOVER DATABASE;
}
executing command: SET until clause

Starting restore at 05-DEC-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=913 instance=TESTDB72 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=976 instance=TESTDB72 device type=DISK
..
..
..

media recovery complete, elapsed time: 00:00:05
Finished recover at 05-DEC-11

Step 5: Open the database with resetlogs option

RMAN> alter database open resetlogs;

database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer