Unregister database from RMAN Catalog

posted Sep 16, 2010, 6:47 AM by Sachchida Ojha   [ updated Sep 16, 2010, 6:55 AM ]
To unregister a database from the recovery catalog.

============================================================================================
A dynamic script
-------------------------
sqlplus rman/rman@rman
set lines 200
spo unregister_test1.sql
select 'execute dbms_rcvcat.unregisterdatabase ('||db_key||','||dbid||');' from rc_database where name = 'test1';
spo off
@@unregister_test1.sql
exit


===========================================================================================
Unregistering a Database

In this example, you connect to the target database test1 and then unregister it:

rman TARGET SYS/oracle@test1 CATALOG rman/rman@catdb

RMAN> UNREGISTER DATABASE NOPROMPT;
Unregistering a Database That is Not Unique in Catalog: Example

The following UNIX shell script unregisters database testdb from the recovery catalog. Because multiple databases called testdb are registered in the recovery catalog, and because RMAN is not connected to the target database (which has already been deleted from the file system), you must run SET DBID:

rman CATALOG rman/rman@catdb
RMAN> RUN
{  
  SET DBID 1334531173;   # specifies test database by DBID
  UNREGISTER DATABASE testdb NOPROMPT;
}

Restrictions and Usage Notes

  • Execute only at the RMAN prompt.
  • RMAN must be connected to the recovery catalog in which the target database is registered.
  • You can identify the database to unregister in one of three ways:
    • Connect RMAN to the target database
    • Provide the database_name argument to identify the database to unregister, if the database name is unique;
    • Use SET DBID to identify the database if RMAN is not connected to the target database and the database_name is not unique in the recovery catalog.


Comments