Backup Recovery   «Prev  Next»
Lesson 3Recovery catalog
ObjectiveCreate a recovery catalog.
Recovery Manager maintains a repository called the recovery catalog, which contains information about backup files and archived log files. RMAN uses the information within the recovery catalog, which is obtained from the control file, to determine how to execute the requested backup and recovery operations. The recovery catalog contains:
  1. Information on backups of datafiles and archive logs
  2. Information on datafile copies
  3. Information on archived redo logs and copies of them
  4. Information on the physical schema of the target database
  5. Stored scripts, which are named user-created sequences of RMAN and SQL commands
Snapshot control file
The recovery catalog obtains crucial RMAN metadata from the target database control file. This metadata must be kept up-to-date; hence, RMAN must synchronize with the control file of the target data frequently. RMAN generates a snapshot control file, which is a temporary backup control file, each time it resynchronizes. This snapshot control file ensures that RMAN has a consistent view of the control file either when refreshing the recovery catalog or when querying the control file. The Oracle8i server ensures that only one RMAN session accesses a snapshot control file at any point in time. This safeguard is necessary to ensure that two RMAN sessions do not interfere with each other's use of the snapshot control file.
If the recovery catalog is destroyed and its backup is not available, you can partially reconstruct the catalog from the current control file or control file backups. But, you should always aim to have a valid, recent backup of your recovery catalog.

Setting up the recovery catalog schema

To set up the recovery catalog schema:
  1. Start SQL*Plus and connect with administrator privileges to the database containing the recovery catalog.
  2. Create a log file that you can use to check for errors.
  3. Create a user and schema for the recovery catalog.
  4. Grant the RECOVERY_CATALOG_OWNER role to the schema owner. This role provides the user with privileges to maintain and query the recovery catalog.
  5. Grant other desired privileges to the RMAN user.
  6. Check the log file for any errors before continuing.
To create the recovery catalog:
  1. Connect to the recovery catalog from the operating system command line.
  2. Issue the CREATE CATALOG command to create the catalog.
  3. Check the log file for any errors.

Deploying the recovery catalog
Here are some recommendations for deploying the recovery catalog:
  1. It should be a separate database, not contained within any of the target databases whose backup data it contains.
  2. Use RMAN to back up the Recovery Catalog database. However, for these backups, start RMAN with the NOCATALOG option, so that the backup repository for the Recovery Catalog is its own control file.
  3. After each backup of the Recovery Catalog, use manual (NOT RMAN!) procedures to back up the Recovery Catalog control file, so that you can restore it if you ever need to restore the Recovery Catalog.
The catalog’s availability can be set through one of the following techniques: standby database or replication. You can maintain two separate Recovery Catalog databases: one is automatically synchronized because it is used for everyday production operations, and the other is kept in sync manually, by periodically issuing the RESYNC CATALOG command.
For the purpose of the examples within this module, the recovery catalog is maintained within a separate database. BACKUP is the name of the catalog database, where the user id/password for the RMAN user is RMAN/RMAN. The target database, which is to be backed up, is called PETS. The user id/password to the database is RMAN/RMAN.
Note that the examples illustrated within this module are written for Oracle8i (8.1.5) Enterprise Edition for Microsoft Windows.
The next lesson shows how to create a backup script.
Creating Recovery Catalog
Click the Exercise link below to try your hand at creating a recovery catalog on your own.
Creating Recovery Catalog