29 | 03 | 2024
Latest Articles
Popular Articles

RMAN

RMAN Recovery Catalog

User Rating:  / 0
PoorBest 

RMAN Recovery Catalog

 

The RMAN Recovery catalog is a repository database used to store info about database backup and database recovery history.

 

We create a sample database with blocksize 8K and characterset AL32UTF8, the additional setup is limited to what is shown below

 

SQL> create tablespace rman;

Tablespace created.

SQL> create user rman identified by rman temporary tablespace temp default tablespace rman;
User created.

SQL> grant recovery_catalog_owner to rman;
Grant succeeded.

SQL> alter user rman quota unlimited on rman;
User altered.

Now we are ready to create the catalog

oracle@hostname:/home/oracle $ rman catalog rman/rman\@DB_CATALOG


Recovery Manager: Release 10.2.0.3.0 - Production on Mon Mar 10 14:40:44 2008
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to recovery catalog database

RMAN> create catalog;
recovery catalog created

Now we are ready to register the target database(s) of which we want to keep the backup and recovery history. Note that the catalog database should be located on another host.

Target database registration ( we need a valid on the target platform pointing to the rman catalog database )


oracle@Oracle:/opt/oracle/admin $ rman target / catalog rman/rman\@DB_CATALOG

Recovery Manager: Release 10.2.0.3.0 - Production on Mon Mar 10 16:39:19 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: MY_DB (DBID=3954204418)
connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

The recovery catalog keeps track of the various incarnations of the database. Note when we open our database wit resetlogs we have another incarnation of our database. This has a significant impact on subsequent recovery scenario' s. Oracle 10G has enhancements with respect to the backup through resetlogs possibilities ( recovery from older database incarnation )

 

 

RMAN> list incarnation;



List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time


1       8       MY_DB 3954204418       PARENT  1          26-FEB-07
1       2       MY_DB 3954204418       CURRENT 547422     04-JUL-07

 

Resynchronization of the catalog

 

When RMAN performs a resynchronization, it compares the recovery catalog to either the current control file of the target database or a backup control file and updates the recovery catalog with information that is missing or changed.

 

RMAN> resync catalog;


starting full resync of recovery catalog
full resync complete

 

Create backup scripts and store them in the recovery catalog

 

RMAN> create script database_full_backup {

configure controlfile autobackup on;
crosscheck backupset;
crosscheck archivelog all;
delete expired backupset;
delete expired archivelog all;
backup incremental level 0 device type disk database skip readonly;
delete noprompt obsolete device type disk;
backup device type disk archivelog all delete input;
backup current controlfile;
delete noprompt obsolete device type disk;
}

created script database_full_backup

 

List registred scripts

 

RMAN> list script names;


List of Stored Scripts in Recovery Catalog


    Scripts of Target Database MY_DB

       Script Name
       Description
       ------------------------------------
       database_full_backup

 

Execute registered scripts

 

RMAN> run { execute script database_full_backup;}


executing script: database_full_backup