Wednesday 22 August 2012

11g R2 – Registering a Database in the Recovery Catalog


Hi,

My name is Mark Tiger, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g).

Gathering information for some DBA tasks can be time-consuming, even although the commands that you need to issue eventually can be over quite quickly.  I have gone through this process over and over again, and have decided to help other Oracle DBA’s in the community.

In this blog, I will give you the details of how to carry out those tasks; that typically need a lot of research, before you can do them.  I will try to present the information in an easy to understand way.  My hope is that this will save you lots of time in research, and help to make you more productive as an Oracle DBA.  The illustrations are primarily meant for Linux, since this is a Platform; that enjoys preference from Oracle.  However they are easily adaptable for versions of UNIX/AIX and windows etc.

11g R2 – Registering a Database in the Recovery Catalog                             

The process of enrolling a target database in a recovery catalog is called “Registration”.  If the target database is not registered in the recovery catalog, then RMAN can’t use the catalog to store the metadata about the database.  You can run RMAN, but the data will be stored in the control files only.

If you are not using the recovery catalog in a Data Guard environment, then you can use the REGISTER command to register each database.  Each database must have a unique DBID.  If you use the CREATE DATABASE statement in SQL, or the RMAN DUPLICATE command, then the database is automatically assigned a unique DBID.  If you create a database by other means, then the copied database may have the same DBID, as its source database.  You can change the DBID with the “DBNEWID” utility.  Once the databases have different DBID’s, then you can register the source and copied database in the same recovery catalog.

You use the UNREGISTER command to unregister a database from the recovery catalog.

In a Data Guard environment, the primary and standby databases share the same DBID and database name.  To be eligible for registration in the recovery catalog, each database in the Data Guard environment, must have different DB_UNIQUE_NAME values.  The DB_UNIQUE_NAME initialization parameter can be set in the pfile.

If you use RMAN in a Data Guard environment, then you can use the REGISTER DATABASE command only for the Primary database.  There are two techniques that you can use to register a Standby database in the recovery catalogue.
·         Connect to the standby database as TARGET; RMAN will automatically register the database in the recovery catalog.
·         When you run the CONFIGURE DB_UNIQUE_NAME command for a standby database that is not known to the recovery catalog; RMAN will automatically register the standby database if the Primary database is registered.

REGISTER DATABASE command
The first step in using a recovery catalog with a target database is registering the target database in the recovery catalog.  In a Data Guard environment, you can only register the Primary database with the REGISTER DATABASE command.
Complete the following steps:
·         Start RMAN and connect to a target database, and the recovery catalog.  The recovery catalog database must be open.
$ rman target / catalog rman@catdb
·         If the target database is not mounted, then mount or open it.
RMAN> startup mount;
·         Register the target database in the connected recovery catalog.
RMAN> REGISTER DATABASE;
RMAN creates rows in the catalog tables to contain information about the target database, then copies all pertinent data about the target database, from the control file into the catalog.  This synchronizes the catalog with the control file.
·         Verify that the registration was successful by running REPORT SCHEMA;
RMAN> report schema;



P.S. I am busy preparing Nine books on preparing for the Oracle 11g R2 OCM DBA exam.  Watch this spot for details on the books, as they start becoming available.

No comments:

Post a Comment