Step by Step - How to Create And Configure RMAN Recovery Catalog Database
Purpose of the Recovery CatalogA 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.
A recovery catalog is required when you use RMAN in a Data Guard environment. By storing backup metadata for all primary and standby databases, the catalog enables you to offload backup tasks to one standby database while enabling you to restore backups on other databases in the environment.
Basic Concepts for the Recovery CatalogThe 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:
Datafile and archived redo log backup sets and backup pieces
Archived redo logs and their copies
Database structure (tablespaces and datafiles)
Stored scripts, which are named user-created sequences of RMAN commands
Persistent RMAN configuration settings
Database RegistrationThe process of enrolling of a database in a recovery catalog for RMAN use is called registration. The recommended practice is to register every target database in your environment in a single recovery catalog. For example, you can register databases
prod3in a single catalog owned by
catownerin the database
Creating a Recovery Catalog
Configuring the Recovery Catalog DatabaseWhen you use a recovery catalog, RMAN requires that you maintain a recovery catalog schema. The recovery catalog is stored in the default tablespace of the schema. The
SYSuser cannot be the owner of the recovery catalog.
Decide which database you will use to install the recovery catalog schema, and also how you will back up this database. Also, decide whether to operate the catalog database in
ARCHIVELOGmode, which is recommended.
Steps to Create a RMAN Catalog User
- Suppose you have create a oracle database or you already have a database created. We are considering catdb as our Recovery Catalog Database. Connect to database catdb as show below.
C:\set ORACLE_SID=catdb C:\sqlplus / as sysdba
SQL> CREATE USER rman_rc IDENTIFIED BY rman_rc DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
RECOVERY_CATALOG_OWNERrole to the schema owner. This role provides the user with all privileges required to maintain and query the recovery catalog.
SQL> grant RECOVERY_CATALOG_OWNER TO rman;
CATALOGcommand. The command creates the catalog in the default tablespace of the catalog owner.
C:\rman catalog rman_rc/rman_rc RMAN> CREATE CATALOG;
C:\set ORACLE_SID=catdb C:\sqlplus rman_rc/rman_rc SQL> select * from tab;
Registering a Database with the REGISTER DATABASE Command
- The first step in using a recovery catalog with a target database is registering the target database in the recovery catalog.
- Start RMAN and connect to a target database and recovery catalog. The recovery catalog database must be open. For example, issue the following command to connect to the catalog database with the net service name
rman_rc(who owns the catalog schema)
C:\set ORACLE_SID=orcl C:\rman TARGET / CATALOG rman_rc/rman_rc@catdb
RMAN> REGISTER DATABASE;
RMAN> REPORT SCHEMA;