Unregister Database From RMAN catalog

Posted: February 26, 2013 in RMAN

Many times we have situations where we need to unregister our database from RMAN catalog. To unregister database we have two options:

1) through sqlplus
2) through RMAN command

SQLPLUS:

First, get the DBID from rc_database table of rman catalog. Here i can see that TEST1 has two entried in RMAN catalog.

SQL> select db_key,DBID,NAME from RMANPRD1.rc_database where name='TEST1';

DB_KEY DBID NAME
---------- ---------- --------
69095 2718327690 TEST1
21669922 2825531829 TEST1

Now, select the current DBID of database from v$database.


SQL> select dbid from v$database;

DBID
----------
2825531829

So, we need to remove DBID “2718327690” from catalog. Connect with catalog owner thtough sqlplus


SQL> exec dbms_rcvcat.unregisterdatabase(69095,2718327690);

PL/SQL procedure successfully completed.

SQL> select db_key,DBID,NAME from RMANPRD1.rc_database where name='WUTST';

DB_KEY DBID NAME
---------- ---------- --------
21669922 2825531829 WUTST

One entry is removed from the RMAN catalog. Now, we will unregister through RMAN command only.

RMAN Command:

First select the DBID from rman catalog that needs to be unregistered.


SQL> select db_key,DBID,NAME from RMANPRD1.rc_database where name='TEST2';

DB_KEY DBID NAME
---------- ---------- --------
21672968 529342741 TEST2
6118 422125281 TEST2

Now, select the current dbid from the database.


SQL> select dbid from v$database;

DBID
----------
529342741

So, dbid “422125281” needs to be unregister from catalog. Connect to rman catalog, set DBID and unregister database.


/home/oracle =>rman catalog rmanuser/rmanuser@catdb

Recovery Manager: Release 10.2.0.4.0 - Production on Tue Feb 26 08:18:31 2013

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

connected to recovery catalog database

RMAN> set dbid 422125281

executing command: SET DBID
database name is "TEST2" and DBID is 422125281

RMAN> unregister database;

database name is "TEST2" and DBID is 422125281

Do you really want to unregister the database (enter YES or NO)? YES
database unregistered from the recovery catalog

Now, check the RMAN catalog again and old dbid is removed from catalog.


SQL> select db_key,DBID,NAME from RMANPRD1.rc_database where name='TEST2';

DB_KEY DBID NAME
---------- ---------- --------
21672968 529342741 TEST2

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