RESYNC

Syntax

resync::=

Description of resync.gif follows
Description of the illustration resync.gif

Purpose

To perform a full resynchronization of the recovery catalog. You can also use RESYNC CONTROLFILE to resynchronize the current control file with the RMAN repository in a control file copy.

Resynchronizations can be full or partial. When full, RMAN updates all changed records for the physical schema: datafiles, tablespaces, redo threads, and online redo logs. If the database is open, RMAN also obtains data about rollback segments. When partial, RMAN reads the current control file to update data, but does not resynchronize metadata about the physical schema or rollback segments.

When you run RESYNC CATALOG, RMAN creates a snapshot control file in order to obtain a read-consistent view of the control file, then updates the recovery catalog with any new information from the snapshot. The RESYNC CATALOG command updates the classes or records described in the following table.

Record Type Description
Log history Records that are created whenever a log switch occurs. Note that log history records describe an online log switch, not a log archival.
Archived redo logs Records associated with archived logs that were created by archiving an online redo log, copying an existing archived redo log, or restoring backups of archived redo logs.
Backups Records associated with backup sets, backup pieces, proxy copies, and image copies.
Physical schema Records associated with datafiles and tablespaces. If the target database is open, then rollback segment information is also updated.

RMAN automatically executes a full or partial resynchronization of the recovery catalog as needed when you execute RMAN commands, so long as the control file is mounted and the recovery catalog database is available at command execution. RMAN reads the current control file and resynchronizes metadata about the physical schema if it determines that this information has changed. If RMAN does detect a change, then it performs a full resynchronization.

Use RESYNC CATALOG to perform manual full resynchronizations when:

  • The recovery catalog is unavailable when you issue any of the commands that automatically perform a resynchronization.

  • You are running in ARCHIVELOG mode, because the catalog is not updated automatically when a log switch occurs or when an online redo log is archived.

  • You have made changes to the physical structure of the target database such as adding or dropping a tablespace. As with archive operations, the recovery catalog is not updated automatically when the physical schema changes.

The primary use for RESYNC CONTROLFILE occurs when you re-create the control file (for example, to change the database name), which causes you to lose RMAN records. You can then resynchronize the newly created control file with an old copy.

Restrictions and Usage Notes

  • You must be connected to a recovery catalog when running RESYNC CATALOG, but a catalog connection is not required for RESYNC CONTROLFILE.

  • RMAN updates physical schema information in the recovery catalog only when the target database has the current control file mounted. If the target database has mounted a backup control file, a freshly created control file, or a control file that is less current than a control file that was used previously, then RMAN does not update physical schema information in the recovery catalog.

Keywords and Parameters

Syntax Element Description
CATALOG Updates the recovery recovery catalog with RMAN metadata in the current control file (default) or a control file copy.
CONTROLFILE Updates the current control file (and recovery catalog, if RMAN is connected to one) with RMAN metadata from a control file copy.
FROM CONTROLFILECOPY 'filename' Specifies the name of the control file copy to use for resynchronization. Physical schema information is not updated when you use this option.

Note: The control file copy can either be in the current database incarnation, or created in a prior incarnation (that is, prior to the most recent OPEN RESETLOGS).


Examples

Resynchronizing the Recovery Catalog in ARCHIVELOG Mode: Example This example performs a full resynchronization after archiving all unarchived redo logs:

CONNECT TARGET / CATALOG rman/rman@catdb
SQL "ALTER SYSTEM ARCHIVE LOG ALL";
RESYNC CATALOG;

Resynchronizing the Current Control File from a Backup: Example This example updates the RMAN repository in the current control file with metadata from a backup control file:

CONNECT TARGET / NOCATALOG
RESYNC CONTROLFILE FROM CONTROLFILECOPY '/tmp/cfile.dbf';

Resynchronizing the Recovery Catalog After a Structural Change: Example This example adds a datafile to tablespace users and then resynchronizes the catalog:

#!/usr/bin/tcsh
# connect in nocatalog mode and add datafile
rman TARGET / NOCATALOG <<EOF
SQL "ALTER TABLESPACE users ADD DATAFILE ''?/oradata/trgt/users03.dbf'' 
     SIZE 1M AUTOEXTEND ON NEXT 10K MAXSIZE 10M";
EXIT
EOF
# connect in catalog mode and resynchronize
rman TARGET / CATAOG rman/rman@catdb <<EOF
RESYNC CATALOG;
EOF