Lesson 3 | Recovery catalog |
Objective | Create a recovery catalog. |
Oracle 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:
- Information on backups of datafiles and archive logs
- Information on datafile copies
- Information on archived redo logs and copies of them
- Information on the physical schema of the target database
- 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:
- Start SQL*Plus and connect with administrator privileges to the database containing the recovery catalog.
- Create a log file that you can use to check for errors.
- Create a user and schema for the recovery catalog.
- Grant the RECOVERY_CATALOG_OWNER role to the schema owner. This role provides the user with privileges to maintain and query the recovery catalog.
- Grant other desired privileges to the RMAN user.
- Check the log file for any errors before continuing.
To create the recovery catalog:
- Connect to the recovery catalog from the operating system command line.
- Issue the CREATE CATALOG command to create the catalog.
- Check the log file for any errors.
Deploying the recovery catalog
Here are some recommendations for deploying the recovery catalog:
- It should be a separate database, not contained within any of the target databases whose backup data it contains.
- 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.
- 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