DBA Tips Archive for Oracle
No Title[an error occurred while processing this directive]
by Michael New, MichaelNew@earthlink.net, Gradation LLC
Use of a recovery catalog is optional although highly recommended. Regardless of whether or not a recovery catalog is being used, the RMAN will "always" write backup metadata to the control file of the target database. The following is an example of how to create an RMAN recovery catalog in a new database named CATDB. Note that the owner of an RMAN recovery catalog cannot be the SYS user and the database hosting the recovery catalog (CATDB in example below) should be a different database from the target database you will be backing up, created on a different host and on different disks than the target database.
Create a database for the recovery catalog (i.e. CATDB).
Create a tablespace for the recovery catalog.
Create database user to hold recovery catalog objects.
Grant the RECOVERY_CATALOG_OWNER role to the new schema owner. This role provides the user with privileges to create, maintain, and query the recovery catalog.
After creating the catalog owner, create the recovery catalog by using the CREATE CATALOG command within the RMAN interface. This command will create the catalog in the default tablespace of the catalog owner or you can explicitly set the tablespace name to be used by using the "TABLESPACE" option as shown below.
Just as you can create the recovery catalog schema, you can also remove it using the DROP CATALOG command. Of course, all data contained in the schema will be lost so take a backup before dropping the catalog.
Before using RMAN with a recovery catalog, register the target database(s) in the recovery catalog. RMAN will obtain all information it needs to register the target database from the target database itself. As long as each target database has a distinct DBID, you can register more than one target database in the same recovery catalog. Each database registered in a given catalog must have a unique database identifier (DBID), but not necessarily a unique database name. The following example registers a target database named TESTDB1 to the newly created recovery catalog within the database named CATDB. The target database must be either mounted or opened in order to register it.
As easy as it is to register a target database in the recovery catalog, it is just as easy to unregister a database.
To unregister an existing database, simply connect to that database and to the recovery catalog and issue the following command:
If the database has been removed then in most cases, all you need to supply is the name of the database. For example, to remove the TESTDB1 database, issue the following command:
A more difficult situation exists when multiple databases with the same name are registered in the recovery catalog. In this case, you need to know the DBID for the database you want to remove from the recovery catalog. Since this method necessitates the need to set the DBID, the unregister command will need to be performed within a run block:
Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX / Linux server environment. Jeff's other interests include mathematical encryption theory, tutoring advanced mathematics, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 20 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science and Mathematics.
Copyright (c) 1998-2018 Jeffrey M. Hunter. All rights reserved.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at firstname.lastname@example.org.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.
Last modified on
Monday, 13-May-2013 18:11:01 EDT
Page Count: 5279