Recently, I came across an interesting scenario related to RMAN. We registered a New database , say STD to catalog and scheduled RMAN backup of that database using GRID 11g. When executed RMAN backup job, it failed with below error (in execution log):
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20004: target database name does not match name in recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 04/13/2013 19:10:53
RMAN-03014: implicit resync of recovery catalog failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20004: target database name does not match name in recovery catalog
Opened putty session for Database host
Set the database environment.
Executed:
rman target / catalog catalog_user/password@catalog_tns
Recovery Manager: Release 11.2.0.3.0 – Production on Sat Apr 13 20:30:51 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: STD (DBID=3149054025)
connected to recovery catalog database
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
——- ——- ——– —————- — ———- ———-
1241980 1241998 PLMQDBT 33752017 PARENT 1 16-FEB-06
1241980 1241981 PLMQDBT 33752017 CURRENT 565658 03-JUN-09
181806 181813 HYPERPRD 37907210 PARENT 1 09-FEB-04
181806 181807 HYPERPRD 37907210 CURRENT 336500 17-NOV-06
24192179 24192292 TST3 3149054025 PARENT 92602138 24-SEP-10
24192179 24192180 TST3 3149054025 PARENT 112669199319 19-APR-11
24192179 24248819 TST3 3149054025 CURRENT 5977649872563 14-SEP-12
RMAN>
Shockingly STD database was not there in the “List Incarnations” output and for same DBID we can see there was another database registered in catalog.
But When we had registered this STD db with catalog, it didn’t throw any error. Although the registration seemed successful, it wasn’t successful as the STD is not listed in List Incarnation output.
To make sure, Connected to catalog DB
SQL> select NAME from rc_database where DBID=3149054025;
NAME
————————
TST3
TST3 was a clone of STD. We use RMAN Duplicate to clone databases.
As part of the duplicating operation, RMAN automates the following steps:
• Creates a control file for the duplicate database
• Restores the target datafiles to the duplicate database and performs incomplete recovery by using all available incremental backups and archived redo logs
• Shuts down and starts the auxiliary instance .
• Opens the duplicate database with the RESETLOGS option after incomplete recovery to create the online redo logs (except when running DUPLICATE …FOR STANDBY, in which case RMAN does not open the database)
• Generates a new, unique DBID for the duplicate database (except when you create a standby database with DUPLICATE … FOR STANDBY, in which case RMAN does not create a unique DBID)
So what went wrong?
Apparently, RMAN Duplicate didn’t complete when Instance was cloned and Database was restored and recovered manually. And DBA forgot to run nid and dbid remained same for source and target.
Resolution
To resolve, we un-registered the both databases with that DBID, re-register STD to catalog. Changed DBID for the second database TST3 with the NID utility and then registered it into catalog.
How to Change the DBID and the DBNAME by using NID [ID 224266.1]