Monday, March 29, 2010

How To Use RMAN For Backup And Restore In A Standby Database Environment

RMAN can back up the standby database and its associated archived redo logs.
Standby backups of datafiles and archived redo logs are fully interchangeable
with primary database backups. In other words, you can run the RESTORE command
to restore a backup of a standby datafile to the primary database, and you can
restore a backup of a primary datafile to the standby database. The standby
control file and primary control file, however, are not interchangeable.

Prerequisites:

- The standby database is created and fully functioning.
- An Rman catalog is established. Use the same Rman catalog for the primary
database and the standby database. Do not create a separate Rman catalog for
the standby database.
- Do not register the standby database in the Rman catalog, only the primary
database is to be registered.

To take backup on the standby database:

- The standby database should preferably be in 'mount standby' mode, not in
'recover managed standby' mode. On ver. 9.0.1 the subsequent redo log
applications fail with ORA-01157 ORA-01110 if the database was in 'recover
managed standby' mode during backup, after which "alter database recover
managed standby database;" must be reissued.
- The standby database is the target database
- Connect to the Rman catalog
- Run backup
- On ver. 8.1.7, run 'resync catalog' after the backup
- Check with 'list backupset of database' that the new backupset is stored in
the Rman catalog

On ver. 8.1.7 it is necessary to manually resync the catalog in order to get
the backupset taken on the standby database stored in the Rman catalog. The
resync will do a partial resynchronization, this is updating the catalog with
the changed information in the control file.

To run restore on the standby database:

- The standby database is in 'mount standby' mode (not in 'recover managed
standby' mode)
- The standby database is the target database
- On ver. 8.1.7, connect nocatalog to Rman; do not connect to the Rman
catalog as the restore will be run against the primary database if connected to
the Rman catalog
- On rel. 9i, connecting to the Rman catalog as well as connecting nocatalog
works
- Run restore

To run restore on the primary database:

- The primary database is the target database
- Connect to the Rman catalog
- Check with 'list backupset of database' that the backupset taken on the
standby database is accessible
- Run restore

Reference:

Metalink Doc ID: 203980.1

For Oracle ver. 8.1.7:

For Oracle ver. 9.0.1:

For Oracle ver. 9.2.0.1:

1 comment: