A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

Recovery Catalog

4 min read

What is Recovery Catalog?

A recovery catalog is a database schema used by RMAN Which is used to stored Metadata of one or
more databases.

Benefits:

  1. It creates the redundancy for the RMAN repository (which is the backup information are stored)
    in the control file of each target database, At the same time Recovery catalog severs the secondary
    metadata repository(if Suppose the target control file and backups are lost Rman metadata still
    maintained in recovery Catalog)
  2. It’s a centralise metadata of all your target databases
  3. It can store metadata history much longer than control file

To store this files from target databases:
This recovery catalog contains metadata of Rman operations of each registered target database

  • Data files and Archived redo log backupset and backup pieces
  • Data file copies
  • Archived redo log and their copies
  • Database structure (tablespace and datafiles)
  • stored Rman scripts which are named user-created sequences of RMAN commands
  • Persistent RMAN configuration settings

Database Registration:
The process of enrolling the target database with in a recovery catalog is called “Registration”

Note:

Recommended Practice is to register every target database into a single recovery catalog Centralization of Metadata in a Base Recovery Catalog:
Base recovery catalog = Normally Can access all the databases which is registered in Recovery Catalog
Virtual recovery catalog = restirced Access of the Own schema Metadata

Recovery Catalog Resynchronization:

For The RMAN Operations like backup,restore and crosscheck will always first updates the own
target control file then it propagates the metadata to recovery Catalog ,the flow of metadata from
mounted control file into recovery catalog is called “Resynchronization”

Basic steps of Managing a Recovery catalog:

1)Create Recovery Catalog
2)Register your Target database
3)If needed, catalog any older backups whose records are no longer stored in the target control file.
4)If needed,Create Virtual Private recovery catalog for specific user to restircted access of database
5)Protect the recovery catalog by including it in your backup and recovery strategy.

Creating Recovery Catalog:
If we use a recovery catalog ,Rman Requires that to maintain a recovery catalog schema
The schema of recovery catalog was created on the default tablespace
The SYS user can’t be owner of recovery catalog

Note: If you are creating recovery catalog for existing database add enough space on the default
tablespace or if you are creating a new database for recovery catalog then additionally space for the
recovery catalog schema itself

Creating Recovery Catalog user:
-After choosing the recovery catalog database ,we need to allocate
necessary space you are ready to create the owner of the recovery
catalog and grant this user necessary privilege

SQL> create user RECCAT identified by RECCAT
2 default tablespace REC_CAT
3 temporary tablespace temp
4 quota unlimited on REC_CAT;

User created.

Execute The Create Catalog Command:
After creating the catalog owner ,use the create catalog command in RMAN it ‘ll creates the catalog
in the default tablespace of the catalog owner

Connect with Rman

Step1 :- If the Catalog tablespace is default just type

RMAN>Create CATALOG;
Step2 :- Or your are using seprate tablespace for recovery catalog

RMAN>CREATE CATALOG TABLESPACE REC_CAT;

Registering a Database in recovery Catalog:
-The process of enrolling of a target database in a recovery catalog is called registration. If a target
database is not registered in the recovery catalog, then RMAN cannot use the catalog to store
metadata for operations on this database.


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

In Your Target Database RMAN:

Step1 :-  %rman TARGET / CATALOG rman@catdb
Step2 :- If the target database is not mounted, then mount or open it:

RMAN> Start Mount;
Step3 :- Register the target database Recovery Catalog

RMAN> Register Database;
Step4 :- Verify that the registration was successful by running

RMAN> report Schema;

Connect to the recovery catalog database(RMAN Repository) & Create a tablespace to store RMAN
catalog database objects

[oracle@centos ~]$ sqlplus "/ as sysdba"

SQL> select global_name from global_name;

GLOBAL_NAME
--------------------
CATALOGD

SQL> create tablespace catalogtbs datafile '/home/oracle/dbfile/catalogtbs1.dbf' size 100M
autoextend on maxsize unlimited;

Tablespace created.

#: Create a RMAN user, assign RMAN tablespace to RMAN user as a default &
grant recovery catalog owner,connect & resource privileges to RMAN user.

SQL> create user recoveryman identified by recoveryman;
User created.

SQL> alter user recoveryman default tablespace catalogtbs temporary tablespace temp;
User altered.

SQL> grant recovery_catalog_owner to recoveryman;
Grant succeeded.
SQL> grant connect,resource to recoveryman;
Grant succeeded.

# : Connect to RMAN on target and recovery catalog database.

[oracle@oracle ~]$ rman target / catalog recoveryman/recoveryman@catalogdb
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 4 14:30:28 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1363580714)
connected to recovery catalog database

#: create catalog by issuing the following command in RMAN prompt.

RMAN> create catalog;
recovery catalog created

#: After creating catalog, Ensure RMAN repository tables by logging into
repository database as RMAN user. This is only for the first time.

[oracle@oracle ~]$ sqlplus "recoveryman/recoveryman@catalogdb"

SQL> show user;
USER is "RECOVERYMAN"

SQL> select table_name from user_tables;

#: Register database with recovery catalog.

RMAN> register database;

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

#: Check whether registration was successful.

RMAN> report schema;

Report of database schema for database with db_unique_name ORCL
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name

1 670 SYSTEM YES /home/oracle/app/oracle/oradata/orcl/system01.dbf
2 490 SYSAUX NO /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
3 30 UNDOTBS1 YES /home/oracle/app/oracle/oradata/orcl/undotbs01.dbf
4 5 USERS NO /home/oracle/app/oracle/oradata/orcl/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name

1 20 TEMP 32767 /home/oracle/app/oracle/oradata/orcl/temp01.dbf
OR


RMAN> LIST INCARNATION OF DATABASE;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time

89 102 ORCL 1363580714 PARENT 1 15-AUG-09
89 90 ORCL 1363580714 CURRENT 945184 02-JAN-14