Wednesday 10 September 2014

Setup of RMAN Catalog

The benefits of running RMAN backup and recovery with a catalog cannot not be overstated. A simple internet search will reveal several reasons why a serious DBA handling several databases should consider setting up a recovery catalog.

The steps involved are pretty straight forward.

1. Creation of the catalog database using DBCA or scripts.



2. Creation of catalog owner and granting necessary roles and privileges.

SQL> create user mycat identified by mycat;

- Grant necessary roles, priviledges to user

SQL> grant recovery_catalog_owner to mycat;
SQL> grant connect, resource to mycat;

3. Creation of the recovery catalog

$ rman catalog mycat/mycat
RMAN> create catalog;

4. Registering the databases which will use this database as recovery catalog



run these commands from each of the concerned databases.


$ rman target / catalog mycat/mycat@CATDB
RMAN> register database;

- Verify that the registration was successful by running REPORT SCHEMA

RMAN> report schema;

To unregister a database TESTDB from RMAN catalog, there are two ways.



1. Unregistering from the target database.


Connect to the target and catalog

rman target / catalog=mycat/mycat@catdb

perform clean -up by deleting existing backups

RMAN> LIST BACKUP SUMMARY;
RMAN> DELETE BACKUP DEVICE TYPE SBT;
RMAN> DELETE BACKUP DEVICE TYPE DISK;

Unregister database

RMAN> UNREGISTER DATABASE;

OR

RMAN> UNREGISTER DATABASE NOPROMPT;

2. Unregistering when there is no access to the target database.

Start RMAN, connect only to the catalog.

$ rman catalog=mycat/mycat@catdb

Unregister the database by name.

RMAN> UNREGISTER DATABASE TESTDB NOPROMPT;

In a case where there is more than one database in the catalog with the same name, you will need to use the DBID to identify the database to unregister. You can find this using the LIST INCARNATION command.

RMAN> LIST INCARNATION OF DATABASE TESTDB;

Once you have the DBID, you can unregister the database using the following script.

    RUN
    { 
      SET DBID 1111111111;
      UNREGISTER DATABASE TESTDB NOPROMPT;
    }









No comments:

Post a Comment