Unregister a Database From an RMAN Recovery Catalog
There are multiple ways to unregister a database from an RMAN recovery catalog.
- UNREGISTER DATABASE (Catalog and Database)
- UNREGISTER DATABASE (Catalog Only)
- DBMS_RCVCAT (Catalog Only)
UNREGISTER DATABASE (Catalog and Database)
This option is available from Oracle 10g onward. If we still have access to the database we can start RMAN, connecting to both the target database and the catalog.
rman target=sys/password@w2k1 catalog=rman/rman@catdb
We may wish to perform some clean-up first, like deleting the existing backups.
RMAN> list backup summary; RMAN> delete backup device type sbt; RMAN> delete backup device type disk;
When ready, we use the
UNREGISTER DATABASE command.
RMAN> unregister database; OR RMAN> unregister database noprompt;
UNREGISTER DATABASE (Catalog Only)
This option is available from Oracle 10g onward. If we no longer have access to the target database, we can still unregister it from the catalog using the
UNREGISTER DATABASE command in RMAN.
Start RMAN, connecting only to the catalog.
Unregister the database by name.
RMAN> unregister database wk21 noprompt;
If there is more than one database in the catalog with the same name, we will need to use the DBID to identify the database to unregister. We can find this using the
LIST INCARNATION command.
RMAN> list incarnation of database wk21;
Once we have the DBID, we can unregister the database using the following commands.
set dbid 1312293510; unregister database;
DBMS_RCVCAT (Catalog Only)
If we no longer have access to the target database, we can still unregister it from the catalog using the
DBMS_RCVCAT package in SQL.
Connect to the catalog database using SQL*Plus, then query the
DBID values as follows.
SQL> connect rman/rman@catdb Connected. SQL> select db_key, dbid, name from rc_database where name = 'W2K1'; DB_KEY DBID NAME ---------- ---------- -------- 23085 1312293510 W2K1 1 row selected. SQL>
DBID can then be used to unregister the database using the
SQL> execute dbms_rcvcat.unregisterdatabase(23085 , 1312293510); PL/SQL procedure successfully completed. SQL>
For more information see:
Hope this helps. Regards Tim...