Configure and Manage RMAN Recovery Catalog

Recovery Catalog: A set of Oracle tables and views used by RMAN to store RMAN repository information about one or more Oracle databases. RMAN uses this metadata to manage the backup, restore, and recovery of Oracle databases.

Target Database: In an RMAN environment, the database to which you are connected as TARGET. The target database is the database on which you are performing RMAN operations.

Basic Concepts for the RMAN Recovery Catalog:

The recovery catalog contains metadata about RMAN operations for each registered target database. When RMAN is connected to a recovery catalog, RMAN obtains its metadata exclusively from the catalog. The catalog includes the following types of metadata:

  • Data file and archived redo log backup sets and backup pieces
  • Data file copies
  • Archived redo logs and their copies
  • Database structure (tablespaces and data files)
  • Stored scripts, which are named user-created sequences of RMAN commands
  • Persistent RMAN configuration settings

Purpose of the RMAN Recovery Catalog:

recovery catalog is a database schema used by RMAN to store metadata about one or more Oracle databases. Typically, you store the catalog in a dedicated database. A recovery catalog provides the following benefits:

  • A recovery catalog creates redundancy for the RMAN repository stored in the control file of each target database. The recovery catalog serves as a secondary metadata repository. If the target control file and all backups are lost, then the RMAN metadata still exists in the recovery catalog.
  • A recovery catalog centralizes metadata for all your target databases. Storing the metadata in a single place makes reporting and administration tasks easier to perform.
  • A recovery catalog can store metadata history much longer than the control file. This capability is useful if you must do a recovery that goes further back in time than the history in the control file. The added complexity of managing a recovery catalog database can be offset by the convenience of having the extended backup history available.

Steps to create catalog database:

  • Catalog DB Host Name: ocm12c
  • Catalog DB Name: RCATDB
  • Target DB Host Name: dbupgrade
  • Target DB Name: ORCL

Connect to catalog database and perform below steps:

[oracle@ocm12c ~] sqlplus sys/oracle@RCATDB
SQL> CREATE TABLESPACE tbs_rcat DATAFILE ‘/u02/oradata/cat/rccat01.dbf’ SIZE 200M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;
SQL> CREATE USER rcat IDENTIFIED BY Oracle
  TEMPORARY TABLESPACE temp 
  DEFAULT TABLESPACE tbs_rcat 
  QUOTA UNLIMITED ON tbs_rcat;
SQL> GRANT RECOVERY_CATALOG_OWNER TO rcat;

Register the Database in the Recovery Catalog:

[oracle@ocm12c ~] rman catalog rcat/Oracle@RCATDB
RMAN> CREATE CATALOG;
Recovery Manager: Release 12.2.0.1.0 - Production on Thu Nov 5 16:40:25 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to recovery catalog database

RMAN> create catalog;

recovery catalog created

RMAN> exit

Register Target (DB:::ORCL) Database:

[oracle@dbupgrade admin]$ export ORACLE_SID=ORCL
[oracle@dbupgrade admin]$ rman target / catalog rcat/Oracle@RCATDB
connected to target database: ORCL (DBID=6432023168)
connected to recovery catalog database

RMAN> REGISTER DATABASE;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> LIST INCARNATION;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       16      ORCL     1580708519       PARENT  1          24-AUG-13
1       17      ORCL     1580708519       PARENT  925702     04-OCT-20
1       2       ORCL     1580708519       CURRENT 991283     05-OCT-20

Upgrade Catalog:

[oracle@ocm12c ~] rman target / catalog rcat/Oracle@RCATDB

RMAN> UPGRADE CATALOG;

recovery catalog owner is RCAT
enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> UPGRADE CATALOG;

recovery catalog upgraded to version 12.02.00.01
DBMS_RCVMAN package upgraded to version 12.02.00.01
DBMS_RCVCAT package upgraded to version 12.02.00.01.

Unregister From Catalog:

RMAN> UNREGISTER DATABASE;

database name is "ORCL" and DBID is 1576578354

Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog