RMAN-20004: target database name…

来源:互联网 发布:json串转json对象 编辑:程序博客网 时间:2024/05/22 10:32

In this Document
  Symptoms
  Changes
  Cause
  Solution


Applies to:

Oracle Server - Enterprise Edition - Version: 8.1.7.0 to 11.2.0.2 -Release: 8.1.7 to 11.2
Information in this document applies to any platform.

Symptoms

Database is in 10g.
Recovery catalog has been configured.
Production Database has been cloned and a connection has been madefrom the clone to Catalog database using rman.
Dbid of the clone instance has not been changed.

Rman backup fails with



RMAN-00571:
RMAN-00569:
RMAN-00571:
RMAN-03002: failure of resync command at 01/5/2009 08:10:05
RMAN-06004: ORACLE error from recovery catalog database
RMAN-20004: target database name does not match name in recoverycatalog

Changes

Production Database has been cloned and a connection has been madefrom the clone to Catalog database using rman.

Cause

Production database has been cloned . The clone database has samedbid but different database name.
Connect from clone to recover catalog remove information about theProduction database and shows
dbid and dbname of Clone. Hence the error


Solution

In the example below


Prod --> dbname of production database
Clone -> dbname of cloned database
dbid --> 106560009 for both Prod and Clone .



Step 1:- Verify the dbid of prod

Connect to prod database

SQL> Select dbid,name from v$database ;

DBID NAME
---------- ---------
106560009 PROD

SQL> Select * from v$database_incarnation ;

INCARNATION# RESETLOGS_CHANGE# RESETLOGS PRIOR_RESETLOGS_CHANGE#PRIOR_RES
------------ ----------------- --------- --------------------------------
STATUS RESETLOGS_ID PRIOR_INCARNATION#FLASHBACK_DATABASE_ALLOWED
------- ------------ --------------------------------------------
1 5.9651E+12 12-AUG-09 5.9651E+12 12-AUG-09
PARENT 694721674 0 NO

2 5.9651E+12 20-AUG-09 5.9651E+12 12-AUG-09
CURRENT 695392949 1 NO

Step 2 :- Verify the dbid registered in Catalogdatabase

Connect to Catalog database as catalog user

SQL>Connect rman/rman

Select distinct DBID from rc_database;

DBID
----------
700602800
106560009

SQL> Select dbid,name ,DBINC_KEY,RESETLOGS_CHANGE#from rc_database ;

DBID NAME DBINC_KEY RESETLOGS_CHANGE#
---------- -------- ---------- -----------------
700602800 TEST 1973056 5.9653E+10
106560009 CLONE 1970053 5.9654E+10


Step 3 :-


From Step 1 and Step2 its clear the catalog database informationhas got registered with Clone instance information and does notshow any information about the Prod database.

There are two options

Option a> If Clone Instance information inCatalog is not required

1>Connect to sqlplus of catalogdatabase

Connect as the catalog users

execute dbms_rcvcat.unregisterdatabaseunregisterdatabase(<dbinc_key, <dbid>);

So in our example for Clone database in Rc_database it is

execute dbms_rcvcat.unregisterdatabaseunregisterdatabase (1970053,106560009) ;

Alternate option
# Instead using dbms packages from SQL to unregisterdatabase,  you can use RMAN UnregisterDatabase
# command.
#
# RMAN command 'UNREGISTER DATABASE' is available
# since 10g Release 1 (10.1).

   RMAN>UNREGISTER DATABASE ;

Ensure you connect to CLONE and CATALOG  tounregister the clone database information.

# For more details on RMAN UNREGISTER command, please refere toRMAN Reference Guide!
#

Once done

Select dbid,name ,DBINC_KEY,RESETLOGS_CHANGE# from rc_database;

Should not show information about the CLONE

2> From PROD connect tocatalog

rman target / catalog username/password@connectstring

Rman> Register database ;

Once done try taking a backup



Option b
-----------


Create a new Catalog schema for Prod.

Register the Prod database with the new Catalog schema.

If you are aware about few backup piece which are no longer shownin control file you can Catalog the same in 10g using

rman > Catalog start with '<locationof backup piece>' ;

To catalog tape backup piece

HOW TO CATALOG TAPE BACKUP PIECES Document 550082.1

0 0