How to Create Oracle RMAN Recovery Catalog Step by Step

How to Create Oracle RMAN Recovery Catalog Step by Step

Purpose

The Oracle Recovery Manager (RMAN) recovery catalog is a dedicated database schema that stores metadata about backup and recovery operations for one or more target databases. This script demonstrates how to create a recovery catalog by establishing a separate tablespace, creating a catalog owner user, granting necessary privileges, and initializing the catalog schema. Using a recovery catalog provides better backup tracking, supports longer retention policies, and enables advanced RMAN features compared to using only the target database's control file.

Breakdown of Code

Original Script

 1Create a catalog
 2create a tablespace
 3create a user
 4grant connect, resource, recovery_catalog_owner to user
 5
 6rman catalog user/pass@db
 7create catalog tablespace "<tablespace_name>";
 8
 9Note. <tablespace_name> is case sensitive (i.e. it must be uppercase)
10
11Note. If you get the error 'rman: can't open catalog', make sure that oracle's rman is being run (which rman). X11 also has a command called rman. Rename it if necessary.

Step-by-Step Explanation

Step 1: Create a Dedicated Tablespace

First, connect to the catalog database as SYSDBA and create a tablespace to store the recovery catalog objects:

1SQL> CREATE TABLESPACE catalogtbs 
2     DATAFILE '/u03/oracle/catalogtbs_01.dbf' 
3     SIZE 500M 
4     AUTOEXTEND ON;

A dedicated tablespace prevents recovery catalog data from consuming space in the SYSTEM tablespace and allows for independent management and growth monitoring.

Step 2: Create the Catalog Owner User

Create a user account that will own the recovery catalog schema:

1SQL> CREATE USER rman_catalog 
2     IDENTIFIED BY password 
3     DEFAULT TABLESPACE catalogtbs 
4     TEMPORARY TABLESPACE temp 
5     QUOTA UNLIMITED ON catalogtbs;

This user should have unlimited quota on the catalog tablespace to accommodate backup metadata growth.

Step 3: Grant Required Privileges

Grant the necessary roles and privileges to the catalog owner:

1SQL> GRANT CONNECT, RESOURCE, RECOVERY_CATALOG_OWNER TO rman_catalog;

The RECOVERY_CATALOG_OWNER role provides essential privileges including CREATE SESSION, ALTER SESSION, CREATE TABLE, CREATE VIEW, CREATE SYNONYM, CREATE PROCEDURE, and ADMINISTER DATABASE. This role contains all permissions needed to maintain and query the recovery catalog.

Step 4: Create the Recovery Catalog

Connect to RMAN using the catalog owner credentials and create the catalog:

1$ rman catalog rman_catalog/password@catalogdb
2
3RMAN> CREATE CATALOG TABLESPACE "CATALOGTBS";

This command creates all necessary tables, views, indexes, packages, and other database objects required to store backup metadata in the specified tablespace.

Key Points

  • Separate Database: The recovery catalog should reside in a separate database from your target databases to ensure backup metadata remains available even if the target database fails
  • Case Sensitivity: The tablespace name in the CREATE CATALOG command must be enclosed in double quotes and specified in uppercase when using quoted identifiers
  • Minimum Size: A 500MB tablespace is typically sufficient for medium-sized databases with daily backups
  • Enterprise Edition Required: Starting with Oracle Database 12c Release 1 (12.1.0.2), the recovery catalog database must use Enterprise Edition
  • Additional Scripts: Run the dbmsrmansys.sql script to grant additional privileges required for the RECOVERY_CATALOG_OWNER role

Insights and Explanations

Why Use a Recovery Catalog?

While RMAN can operate using the target database's control file alone, a recovery catalog offers significant advantages:

  • Stores backup history longer than control file retention limits
  • Supports centralized management of multiple target databases
  • Enables stored scripts for standardized backup operations
  • Maintains metadata even if the control file is lost
  • Required for certain advanced features like virtual private catalogs

Tablespace Name Case Sensitivity

Oracle database identifiers are case-insensitive by default and converted to uppercase unless enclosed in double quotes. When you specify the tablespace name in the CREATE CATALOG command using quotes (e.g., "catalogtbs"), Oracle treats it as case-sensitive and requires exact matching. Without quotes, Oracle automatically converts the name to uppercase. The script note emphasizes using uppercase in quotes to avoid identifier mismatch errors.

Common Error: "rman: can't open catalog"

This error typically occurs on Linux/Unix systems where the X11 window system includes a different executable also named "rman" (used for audio file conversion). When you type "rman" at the command prompt, the system may execute the X11 version instead of Oracle's Recovery Manager. Use the which rman command to verify which executable is being called. If the wrong rman is found, either:

  • Specify the full path to Oracle's RMAN: $ORACLE_HOME/bin/rman
  • Rename or remove the conflicting X11 rman executable
  • Adjust your PATH environment variable to prioritize Oracle binaries

Registering Target Databases

After creating the catalog, you must register each target database before performing backup operations:

1$ rman target / catalog rman_catalog/password@catalogdb
2
3RMAN> REGISTER DATABASE;

This copies the target database's control file metadata into the recovery catalog and establishes the relationship between the target and catalog.

Network Configuration

Ensure proper network connectivity exists between the catalog database and all target databases by configuring tnsnames.ora entries for the catalog database on each target server. Use secure credential management methods like Oracle Wallet in production environments rather than plain text passwords.

References

Posts in this series