Oracle DBA Tips and Techniques

By Arjun Raja

REMOVE BACKUPS FROM FRA BEFORE RECOVERY

Posted by Arjun Raja on November 30, 2009

Before attempting to restore and recover a database to a point before the current resetlogs, make sure to delete all files in the ‘backup’ area of the FRA – RMAN catalogs files in the ‘backup’ area in the FRA and if it finds a controlfile backup of time after the resetlogs it will use that backup.

Situation –

Database TEST restored and recovered from old backup – point in time recovery and database opened with RESET LOGS .

Backups run on new database and controlfile autobackup to FRA.

Database blown away later that day.

Same night another restore and recovery attempted to same time as previous recovery –

Restore completes but Recovery fails with following error –

RMAN-06004: ORACLE error from recovery catalog database: RMAN-20003: target
database incarnation not found in recovery catalog

A check of the restore and recovery log –

searching for all files in the recovery area
cataloging files…
cataloging done

List of Cataloged Files
=======================
File Name:
/u03/oradata/flash_recovery_area/OFSAP/autobackup/2009_09_02/o1_mf_s_696491414_59v5rqrc_.bkp

RMAN catalogs the files in the FRA and if there is a controlfile autobackup
in the FRA it uses that file – and resets the incarnation of the database –
since the file in the FRA belonged to the previous database which ran on
this box after a RESETLOGS.

The alert log shows this when the RESTORE and RECOVER UNTIL TIME command is
issued –

Thu Sep 3 23:05:31 2009
New incarnation branch detected in Backup, filename
/u03/oradata/flash_recovery_area/OFSAP/autobackup/2009_09_02/o1_mf_s_696491414_59v5rqrc_.bkp
Inspection of file changed rdi from 2 to 3
Setting recovery target incarnation to 3
Thu Sep 3 23:05:31 2009
Setting recovery target incarnation to 3
Thu Sep 3 23:38:08 2009
Full restore complete of datafile 5 /u02/oradata/ofsap/ofsa_data03.dbf.
Elapsed time: 0:29:53
checkpoint is 24996620767
Fri Sep 4 00:10:04 2009

The way out is to RESET the incarnation of the database to the previous
incarnation – when the backup was taken and catalog updated .

List incarnation of database –

Recovery Manager: Release 10.2.0.4.0 – Production on Fri Sep 4 05:02:43
2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: TEST (DBID=2764499561, not open)

RMAN> list incarnation of database;

using target database control file instead of recovery catalog

List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
——- ——- ——– —————- — ———- ———-
1 1 TEST 2764499561 PARENT 738795154 30/APR/04
2 2 TEST 2764499561 ORPHAN 23856965510 03/AUG/09
3 3 TEST 2764499561 CURRENT 25008195933 02/SEP/09

RMAN> RESET DATABASE INCARNATION TO 2;

RMAN> list incarnation of database;

using target database control file instead of recovery catalog

List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
——- ——- ——– —————- — ———- ———-
1 1 TEST 2764499561 PARENT 738795154 30/APR/04
2 2 TEST 2764499561 CURRENT 23856965510 03/AUG/09
3 3 TEST 2764499561 ORPHAN 25008195933 02/SEP/09

Remove all backups from FRA.

Now restart the Restore and recovery – And it will work.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: