Tuesday, October 7, 2014

Resetting the database incarnation using RMAN

Resetting the database incarnation using RMAN

Why would you need to reset the database incarnation?  There are only 2 scenarios.  

  • You are attempting a restore or recover of the database to an SCN to a point in time before the resetlogs command was issued.
  • You are trying to rewind the database to a point in time using flashback database to a database incarnation that has been orphaned.
Connect to RMAN catalog and the target to list the database incarnations


server1:> rman
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Sep 20 14:10:26 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
 

RMAN> connect rmancat inst1/pass1234@rcat
connected to recovery catalog database

RMAN> connect target / 

connected to target database: INST1 (DBID=123456789, not open)


RMAN> list incarnation;
 

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       13      INST1    123456789    PARENT  1          15-OCT-09
1       67       INST1     123456789     PARENT  845267     18-JUL-10
1       645751  INST1     123456789     CURRENT 6742584952 06-AUG-11


While connected to the RMAN issue the reset database to incarnation 67.  Doing this puts the CURRENT incarnation number into an orphaned state.


RMAN> reset database to incarnation 67;

database reset to incarnation 67


Output of list incarnation again to show the new CURRENT and the now ORPHANED

RMAN> list incarnation of database;

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       13      
INST1     123456789    PARENT  1          15-OCT-09
1       67       
INST1      123456789    CURRENT 845267     18-JUL-10
1       645751  
INST1     123456789    ORPHAN  6742584952 06-AUG-11

No comments:

Post a Comment