Wednesday, April 23, 2014

RMAN: Concept and Usage of Recovery Catalog

Recovery catalog is an optional database schema consisting of database objects like tables and views. RMAN uses these objects to store its repository data. The control file of each target database always serves as the primary store for the repository, however, catalog can act as a secondary storage and provides repository redundancy

Information Maintained by Recovery Catalog:

The recovery catalog contains information about both RMAN backups and the target database. Below is what maintained by a typical recovery catalog

  1.  RMAN configuration settings
  2.  RMAN-stored scripts that you create
  3. Target database tablespace and datafile information
  4. Information pertaining to datafile and archived redo log backup sets and backup pieces, as well as datafile and archived redo log copies

Creating RMAN Recovery Catalog:

The recovery catalog isn’t created by defualt when you install oracle database rather we must create it manually and needs to be maintained like any other oracle database .

In this article I am going to create a Recovery Catalog and have a remote database registered in the catalog database.

Below are the steps I have taken to create the catalog.

1. Create a separate database e.g. CATDB. Please note that we could create the recovery catalog in a target database that you want to back up using the recovery catalog, but would be an unwise choice because in such a case, losing the target database means we'll lose the recovery catalog as well. This will make the  recovery much harder or even impossible

2. using SQL*Plus, connect as sys to the CATDB database created in step1 

connect  /  as sysdba

3.  Create a default tablespace for recovery catalog owner as below

 create tablespace cat_data  datafile '/u02/oracle/oradata/CATDB/cat_data_01.dbf' size 1500M;

4. Create recovery catalog owner

create user rman_cat identified by rman_cat
default tablespace cat_data
temporary tablespace temp
quota unlimited on cat_data;

5. Once you create the recovery catalog owner, you must grant that user the
recovery_catalog_owner privilege in order for that user to have the authority to work
with the recovery catalog you’ll create in the next step. 

grant recovery_catalog_owner to rman_cat;

6. Now create the Recovery Catalog by just connecting to the recovery cataog only (not the target database)

RMAN>connect catalog rman_cat/rman_cat@CATDB
connected to recovery catalog database
RMAN>

RMAN> create catalog;

Below is how we can register the database to the newly created catalog

Registering Target Databases:

You want to use a recovery catalog to manage the RMAN repository data for a new database.

rman target / catalog rman_cat/rman_cat@catdb

RMAN> register database;

You can ensure that you have successfully registered the target database by issuing the list incarnation command.

RMAN> list incarnation;

Make sure from the remote server from where you are logging in to connect to the recovery catalog has the recovert catalog database (CATDB) tns entry available in the tnsnames.ora file of  target database.


No comments:

Post a Comment