Catalog Maintenance   «Prev  Next»

Lesson 5 Using RMAN to resynchronize a database
Objective Demonstrate how to resynchronize a target database using the resynch command.

Using RMAN to resynchronize a Database

Question: How do I resynchronize a target database using the resynch command in Oracle 11g?
Oracle's Recovery Manager (RMAN) can use a recovery catalog to store backup metadata, enhancing its ability to manage backups effectively. To keep the recovery catalog up-to-date with the target database, RMAN periodically performs a resynchronization operation. Resynchronization updates the metadata in the recovery catalog from the control file of the target database. This process ensures that the recovery catalog contains a comprehensive record of all RMAN backups and changes to the physical structure of the target database.
You can manually trigger a catalog resynchronization using the RESYNC CATALOG command in RMAN. This might be necessary if changes have been made to the database structure or if you suspect that the catalog has become out-of-sync for some reason. Follow these steps to resynchronize a target database using the RESYNC CATALOG command in Oracle 11g:
  1. Log into the Oracle server
    Begin by logging into the Oracle database server. Use the server's operating system commands. The specific commands vary based on the operating system your Oracle database is hosted on.
  2. Set the Oracle environment:
    Set the Oracle environment using the oraenv or coraenv script.
    . oraenv

    When prompted, enter the SID of the database you want to connect to.
  3. Start RMAN
    Start the RMAN utility by typing the following command in your terminal:

    This command starts the RMAN command-line interface. Note that RMAN does not require a username or password when you start it.
  4. Connect to the target database and recovery catalog
    Connect RMAN to the target database and recovery catalog. Replace target_user, target_password, catalog_user, and catalog_password with the correct credentials:
    CONNECT TARGET target_user/target_password;
    CONNECT CATALOG catalog_user/catalog_password@catalog;
  5. Resynchronize the catalog
    To manually resynchronize the recovery catalog with the target database, use the RESYNC CATALOG command:

    This command updates the recovery catalog to reflect the state of the target database's control file.

After executing these commands, the recovery catalog will be resynchronized with the target database, ensuring that all metadata are up-to-date. Always remember to ensure that your recovery catalog is periodically synchronized with your target database to have an accurate and reliable source of metadata for backup and recovery operations.

Recovery Catalog is used to keep track of your target Database

The recovery catalog is used to keep track of your target database and all the files required to recover your database in the event of a failure. Events relating to your target database do not automatically update the recovery catalog. These events include:
  1. Adding or dropping a tablespace
  2. Adding data files to an existing tablespace
  3. Adding or dropping rollback segments
  4. Log switches
  5. Mounting a backup or noncurrent control file
Several actions can alter the physical makeup of your target database that will not be reflected in your recovery catalog. It is important that these changes be recorded so that your recovery catalog correctly reflects the state of your target database, so it is good practice to resynchronize your database with its entries in the recovery catalog after these events.
You may run into a situation where your rollback segments sit on a corrupt disk. You could drop the existing rollback segments and add new ones. The result of these actions will not appear in your recovery catalog. You would need to force a resynchronization to update the recovery catalog. When you perform a resynchronization operation, Recovery Manager will update only those entries in the recovery catalog that are different than the control file information.

Resynch command syntax

The following is the command syntax for a resynch:
resynch catalog [from controlfilecopy < control file> ]

To resynchronize using the current control file:
RMAN> resynch catalog

To resynchronize specifying a specific control file:
RMAN> resynch catalog from controlfilecopy 


The recovery catalog is not automatically updated when a log switch occurs, when a log file is archived, or when you modify your database structure. This information is stored in the control file and should be updated to your recovery catalog.
In the next lesson, you will learn more about situations where the resynch command is used.