lundi 21 septembre 2015

RMAN-20011

RMAN-20011: target database incarnation is not current in recovery catalog


en exécutant le crosscheck j'ai l'erreur suivante :


RMAN> crosscheck archivelog all;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of crosscheck command at 09/21/2015 17:06:56
RMAN-12010: automatic channel allocation initialization failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20011: target database incarnation is not current in recovery catalog

RMAN>  list incarnation of database;


RMAN> show all ;

RMAN configuration parameters are:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 09/21/2015 17:10:56
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20011: target database incarnation is not current in recovery catalog


SOLUTION

Option 1 - Reset PROD to Previous Incarnation
OR
Option 2 - Re-register PROD with the Recovery Catalog
Finally change the cloned db's DBID:
    Note 224266.1 How to Change the DBID and the DBNAME by using NID


Option 1 - Reset PROD to Previous Incarnation
 A. Check the latest incarnation key for production database in rc_database_incarnation
SQL> select DBID, NAME, DBINC_KEY, RESETLOGS_CHANGE#, RESETLOGS_TIME 
       from RC_DATABASE_INCARNATION
      where dbid=2284119847;

      ==> Check the DBINC_KEY corresponding to the current incarnation of PROD database


B. Connect to the Production Database with RMAN
Be aware that database needs to be in "MOUNT" status to be able to reset the incarnation
$ rman catalog <un/pw@catalog_db> target /
RMAN>
RMAN> reset database to incarnation <dbinc_key>;  
RMAN> resync catalog;
RMAN> list incarnation;   # => Now the production DB incarnation should be the current one and
                          #    the error RMAN-20011 should not raise  anymore

Option 2 - Re-Register PROD with the Recovery Catalog
Warning: Once a database is uregistered from the recovery catalog all backup information will be coming from the controlfile. Therefore you may lose some bakcup information!! If you have other backups that needs to be added to the recovery catalog you must recatalog them afterwards. 
A. Take a backup of the recovery catalog database/schema
B. Confirm the backups you currently have in the controlfile vs recovery catalog. Run the following in both nocatalog and catalog mode:
RMAN> list backup summary;
  
C. Connect to the clone database and recovery catalog and unregister the database:
RMAN> unregister database;
  
D. Connect to prod and the recovery catalog and register the prod database:
RMAN> register database;
RMAN> list incarnation of database;
RMAN> list backup summary;
E. Recatalog any additional backuppieces:
If on disk:
RMAN> catalog start with 'location of the backuppieces'; 

If on tape:
    HOW TO CATALOG TAPE BACKUP PIECES (Doc ID 550082.1)


Dans mon cas (base de test) comme je peux me permettre de le faire :-)   j'ai fait :
  •  unregister database;
  •  register database;


et ensuite j'ai lancé un full  backup de la base.




Aucun commentaire:

Enregistrer un commentaire