
We have two methods to unregister database from RMAN recovery catalog.
Method 1st:
Unregister target database with the help of “Unregister database” RMAN command.
Consider following hands-on, ORCL database is currently registered with the recovery catalog, ensure this with the help of “list incarnation” & “report schema” RMAN command:
Note:
ORCL is the target database & catalogdb is the catalog database.
[oracle@oracle ~]$ export ORACLE_SID=orcl
[oracle@oracle ~]$ rman target / catalog recoveryman/recoveryman@catalogdb
Recovery Manager: Release 11.2.0.1.0 – Production on Thu Jan 9 12:59:30 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1363580714)
connected to recovery catalog database
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
——- ——- ——– —————- — ———- ———-
913 926 ORCL 1363580714 PARENT 1 15-AUG-09
913 914 ORCL 1363580714 CURRENT 945184 02-JAN-14
2 20 CATALOGD 2196388840 PARENT 1 15-AUG-09
2 4 CATALOGD 2196388840 CURRENT 945184 03-JAN-14
OR
RMAN> report schema;
Report of database schema for database with db_unique_name ORCL
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
—- ——– ——————– ——- ————————
1 680 SYSTEM YES /home/oracle/app/oracle/oradata/orcl/system01.dbf
2 570 SYSAUX NO /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
3 30 UNDOTBS1 YES /home/oracle/app/oracle/oradata/orcl/undotbs01.dbf
4 5 USERS NO /home/oracle/app/oracle/oradata/orcl/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
—- ——– ——————– ———– ——————–
1 22 TEMP 32767 /home/oracle/app/oracle/oradata/orcl/temp01.dbf
Now, to unregister target database ( ORCL ), connect to RMAN prompt and issue the “unregister database” command:
[oracle@oracle ~]$ export ORACLE_SID=orcl
[oracle@oracle ~]$ rman target / catalog recoveryman/recoveryman@catalogdb
Recovery Manager: Release 11.2.0.1.0 – Production on Thu Jan 9 13:11:10 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1363580714)
connected to recovery catalog database
RMAN> unregister database;
database name is “ORCL” and DBID is 1363580714
Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog
Target database ( ORCL ) has been unregistered successfully, ensure this with the help of “list incarnation” & “report schema” RMAN command:
[oracle@oracle ~]$ export ORACLE_SID=orcl
[oracle@oracle ~]$ rman target / catalog recoveryman/recoveryman@catalogdb
Recovery Manager: Release 11.2.0.1.0 – Production on Thu Jan 9 12:56:02 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1363580714)
connected to recovery catalog database
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
——- ——- ——– —————- — ———- ———-
2 20 CATALOGD 2196388840 PARENT 1 15-AUG-09
2 4 CATALOGD 2196388840 CURRENT 945184 03-JAN-14
OR
RMAN> report schema;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of report command at 01/09/2014 13:06:30
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
Method 2nd:
Unregister target database with the help of “dbms_rcvcat.unregisterdatabase” procedure:
Consider following hands-on.
ORCL database is currently registered with the recovery catalog, ensure this with the help of “list incarnation” & “report schema” RMAN command as mentioned in method 1st.
Now, to unregister target database ( ORCL ), connect to the RMAN recovery catalog database with recovery manager owner & issue the following query to get database key and database id:
[oracle@oracle ~]$ export ORACLE_SID=catalogdb
[oracle@oracle ~]$ sqlplus “recoveryman/recoveryman”
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 9 12:48:48 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select db_key,dbid,name from rc_database;
DB_KEY DBID NAME
———- ———- ——–
653 1363580714 ORCL
2 2196388840 CATALOGD
Now, Execute dbms_rcvcat.unregisterdatabase procedure ( from the recovery catalog owner ) to unregister the database from the recovery catalog:
Note:
This procedure gets DB_KEY & DB_ID that we just retrive with the help of above query.
Syntax: dbms_rcvcat.unregisterdatabase(db_key,db_id);
SQL> execute dbms_rcvcat.unregisterdatabase(653,1363580714);
PL/SQL procedure successfully completed.
Target database ( ORCL ) has been unregistered successfully, ensure this with the help of “list incarnation” & “report schema” RMAN command as mentioned in method 1st.
***********************************************************************
Note: Please don’t hesitate to revert in case of any query OR feedback.
Thanking you.
Have a easy life ahead.
Your blogs are true blessings… Thums up to your explanation style.. in love with this blog 🙂
Thank you shubham for writing, you kind words are true inspiration for me.
Stay tune, and Subscribe my Blog for more updates.
Hi,
Note: ETXXXXX DB already dropped and OH uninstalled before unregister db from rman catalog.
Please help me on this situation,
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
Version 19.10.0.0.0
SQL>
SQL> conn rman
password:
Connected.
SQL>
SQL> SELECT db_key, dbid, name FROM rc_database WHERE name = ‘ETXXXXX’;
DB_KEY DBID NAME
———- ———- ——–
1155283277 4245563187 ETXXXXX
SQL>
SQL> EXECUTE dbms_rcvcat.unregisterdatabase(‘1155283277′,’4245563187’);
BEGIN dbms_rcvcat.unregisterdatabase(‘1155283277′,’4245563187’); END;
*
ERROR at line 1:
ORA-02292: integrity constraint (RMAN.BSF_F2) violated – child record found
ORA-06512: at “RMAN.DBMS_RCVCAT”, line 2279
ORA-06512: at “RMAN.DBMS_RCVCAT”, line 2269
ORA-06512: at line 1