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

In "Oracle 11g R2", you can resynchronize a target database using the `RESYNC CATALOG` command in Recovery Manager (RMAN). This is necessary when the recovery catalog needs to be updated with the latest control file information from the target database.
Steps to Resynchronize a Target Database using RMAN
Step 1: Connect to RMAN
First, connect to RMAN with both the 1) target database and the 2) recovery catalog:
rman target / catalog rman_user/password@catalog_db

  • target / → Connects to the target database using OS authentication.
  • catalog rman_user/password@catalog_db → Connects to the RMAN recovery catalog.

Step 2: Perform Resynchronization
Once connected, execute the `RESYNC CATALOG` command:
RMAN> RESYNC CATALOG;

This command updates the recovery catalog with the latest metadata from the target database.
When to Use the RESYNC CATALOG Command
  • If the recovery catalog is out of sync with the control file of the target database.
  • After making structural changes in the database (e.g., adding tablespaces, datafiles, or renaming objects).
  • If backups are missing from the catalog but exist in the control file.
  • After manually registering a new target database to ensure the catalog has the most recent metadata.

Automatic vs. Manual Resynchronization
  • Automatic: RMAN automatically resynchronizes the catalog when running BACKUP, COPY, and CHANGE commands.
  • Manual: Use RESYNC CATALOG explicitly when necessary.

Verifying Resynchronization After executing the command, you can verify that the recovery catalog is updated by checking backup metadata:
RMAN> LIST BACKUP SUMMARY;

or
RMAN> LIST BACKUP OF DATABASE;


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 for Oracle8 (Legacy)

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 
C:\oracle8\database\ctl1orc1.ora

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.

The commands provided for resynchronizing the RMAN catalog in Oracle 8 have minor syntax differences compared to the more recent Oracle Database versions like Oracle 19c. The fundamental purpose of these commands, however, remains the same, which is to ensure that the RMAN repository (catalog) is synchronized with the control file records.
Here’s how you can update the syntax for Oracle 19c:
Original Script in Oracle 8 Syntax
resynch catalog [from controlfilecopy <control file>]

RMAN> resynch catalog
RMAN> resynch catalog from controlfilecopy 

Rewritten Script for Oracle 19c: Oracle 19c simplifies some RMAN operations and improves usability. However, for your specific task of resynchronizing the catalog, the command structure remains essentially the same. The correct terminology and use would be to ensure that it is consistent with recent documentation:
# To resynchronize the RMAN catalog using the current control file:
RMAN> RESYNC CATALOG;

# To resynchronize specifying a specific control file copy:
RMAN> RESYNC CATALOG FROM CONTROLFILECOPY 'C:\oracle19\database\ctl1orc1.ora';

Key Changes and Considerations:
  1. Case Sensitivity: While RMAN is not case-sensitive, scripts are often written in uppercase to conform to SQL convention.
  2. File Path: Ensure the path to the control file copy reflects the actual location and version of your Oracle 19c environment.
  3. Control File Specification: The path to the control file copy needs to be within quotes, especially if the path includes spaces or is a string.

This syntax should work with Oracle 19c. Always verify paths and configurations specific to your environment and ensure you have the appropriate backups before running such operations.
In the next lesson, you will learn more about situations where the resynch command is used.

SEMrush Software Target 5SEMrush Software Banner 5