Step by Step - How to Create And Configure RMAN Recovery Catalog Database
Purpose of the Recovery Catalog
A 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 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:-
Datafile and archived redo log backup sets and backup pieces
-
Datafile copies
-
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 Registration
The 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 databasesprod1
, prod2
, and prod3
in a single catalog owned by catowner
in the database catdb
.Creating a Recovery Catalog
Configuring the Recovery Catalog Database
When 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. TheSYS
user 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
ARCHIVELOG
mode, 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
- Create a user and schema for the recovery catalog.
SQL> CREATE USER rman_rc IDENTIFIED BY rman_rc DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
- Grant the
RECOVERY_CATALOG_OWNER
role 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;
- After creating the catalog owner, create the catalog tables with the RMAN
CREATE
CATALOG
command. The command creates the catalog in the default tablespace of the catalog owner. C:\rman catalog rman_rc/rman_rc RMAN> CREATE CATALOG;
- You can now connect to the catalog user from sqlplus to check the tables and view names created by the above command.
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
catdb
as userrman_rc
(who owns the catalog schema) C:\set ORACLE_SID=orcl C:\rman TARGET / CATALOG rman_rc/rman_rc@catdb
- Register the target database in the connected recovery catalog. RMAN creates rows in the catalog tables to contain information about the target database, then copies all pertinent data about the target database from the control file into the catalog, synchronizing the catalog with the control file.
RMAN> REGISTER DATABASE;
- Verify that the registration was successful by running
REPORT
SCHEMA
RMAN> REPORT SCHEMA;
I'm so happy to read this blog.
ReplyDelete