We are going to learn about “ RMAN-20002″ in this post. We explain this issue and solution of it . To make RMAN store the metadata information, you need to register the database in the recovery catalog. Before the database is registered, the metadata is written to the control file of the target database. So in order to register the database, you need to connect to both the target and catalog database. For this, you need to connect to the catalog database via Oracle Net by configuring both tnsnames.ora and listener.ora files.

 

PROBLEM:

While registering database to rman catalog, getting below error.

RMAN> register database;

RMAN-00571: ================================================
RMAN-00569: ========== ERROR MESSAGE STACK FOLLOWS ==========
RMAN-00571: ================================================
RMAN-03009: failure of register command on default channel at 12/08/2010 13:03:21
RMAN-20002: target database already registered in recovery catalog

 

SOLUTION:

1. Check dbid of the database.

SQL> select dbid from v$database;

DBID
———-
1917723569

2. Connect to catalog and check whether same db is present or not

sqlplus catalog_user/rman@catdb

SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 12 13:50:57 2017

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select DB_KEY,DBID,NAME from rc_database where dbid=1917723569;

DB_KEY DBID NAME
———- ———- ——–
29531 1917723569 CONTEST

</span>

We can see another database CONTEST is already present in the catalog with the same dbid.
so adding new database to catalog with same DBid is failing.

So fix it, we have two options now.
OPTION – 1: ( UNREGISTER EXISTING DBID ENTRY)
If the database, for which same dbid exists in the catalog repository, it not in use , then we can remove the entry and try to register.

sqlplus catalog_user/rman@catdb

SQL> select DB_KEY,DBID,NAME from rc_database where dbid=1917723569;

DB_KEY DBID NAME
———- ———- ——–
29531 1917723569 CONTEST

SQL> EXECUTE dbms_rcvcat.unregisterdatabase(29531, 1917723569);

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

OPTION 2 (CHANGE THE DBID of the database:)

Use nid utility to change the dbid and try to register.

START DATABASE IN MOUNT STAGE

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1.1107E+10 bytes
Fixed Size 7644464 bytes
Variable Size 9294584528 bytes
Database Buffers 1711276032 bytes
Redo Buffers 93011968 bytes
Database mounted.

NID TOOL TO CHANGE DBID:

nid target=sys/oracle@DBATEST

DBNEWID: Release 12.1.0.2.0 – Production on Sun Feb 12 14:03:42 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

Connected to database DBATEST (DBID=1917723569)

Connected to server version 12.1.0

Control Files in database:
/archive/NONPLUG/NONCDB/control01.ctl
/archive/NONPLUG/NONCDB/control02.ctl

Change database ID of database NONCDB? (Y/[N]) => Y

Proceeding with operation
Changing database ID from 1742085976 to 1753637695
Control File /archive/NONPLUG/NONCDB/control01.ctl – modified
Control File /archive/NONPLUG/NONCDB/control02.ctl – modified
Datafile /archive/NONPLUG/NONCDB/system01.db – dbid changed
Datafile /archive/NONPLUG/NONCDB/sysaux01.db – dbid changed
Datafile /archive/NONPLUG/NONCDB/NONCDB/datafile/o1_mf_prim_d9v1bqq3_.db – dbid changed
Datafile /archive/NONPLUG/NONCDB/PLUG/prim01.db – dbid changed
Datafile /archive/NONPLUG/NONCDB/NONCDB/datafile/o1_mf_prim_d9v1fq7k_.db – dbid changed
Datafile /archive/NONPLUG/NONCDB/PLUG/undo_new01.db – dbid changed
Control File /archive/NONPLUG/NONCDB/control01.ctl – dbid changed
Control File /archive/NONPLUG/NONCDB/control02.ctl – dbid changed
Instance shut down

The database ID for database DBATEST changed to 1753637695.
All previous backups and archived redo logs for this database are unusable.
The database is not aware of previous backups and archived logs in Recovery Area.
The database has been shut down, the open database with RESETLOGS option.
Successfully changed database ID.
DBNEWID – Completed successfully.

OPEN DATABASE IN RESETLOGS:

SQL> startup mount
ORACLE instance started.

Total System Global Area 1.1107E+10 bytes
Fixed Size 7644464 bytes
Variable Size 9294584528 bytes
Database Buffers 1711276032 bytes
Redo Buffers 93011968 bytes
Database mounted.
SQL> alter database open resetlogs;

Database altered.

Now try to register:

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

 

About The Author

Leave a Reply