Maintaining the RMAN repository
The RMAN repository is the collection of metadata about your target databases that RMAN uses to conduct its backup, recovery, and maintenance operations. You can either create a recovery catalog in which to store this information or let RMAN store it exclusively in the target database control file. Although RMAN can conduct all major backup and recovery operations using only the control file, some RMAN commands function only when you use a recovery catalog.
Table: Tasks and commands shows the tasks that are required to maintain the RMAN repository and a subset of the repository maintenance commands that perform the tasks. Some of these commands might not be available with all versions of RMAN.
Table: Tasks and commands
Task | Commands that perform the task |
---|
Register a database with the recovery catalog
| Before using RMAN with a recovery catalog, register the target database in the recovery catalog. To register, start and mount the target database but do not open it. At the RMAN prompt, issue a register database command.
|
Reset the incarnation in the recovery catalog
| The reset database command directs RMAN to create a new database incarnation record in the recovery catalog.
|
Crosscheck the information in the RMAN repository
| Because NetBackup can expire images independently from Oracle, the RMAN repository can contain outdated information. Run an RMAN crosscheck to ensure that data in the recovery catalog or control file is in sync with data in the backup image catalog. The crosscheck queries NetBackup for the existence of each backup piece and then marks it as available or expired in the RMAN repository. Use one of the following commands to check the specified files. You need to run separate commands to delete images or repository records.
The change...crosscheck command queries NetBackup to determine if a backup piece is available. If not, RMAN marks the backup piece as expired. If it was expired but is now available, RMAN marks the backup piece as available. The command syntax is as follows: change backuppiece {primary_keylist |
filename_list | tag} crosscheck;
change backupset {primary_keylist} crosscheck;
To crosscheck a database, start RMAN and connect to the target database and to the recovery catalog (if used). At the rman command prompt, enter the following: allocate channel for maintenance type 'SBT_TAPE';
crosscheck backupset of database;
The length of time to perform an RMAN crosscheck depends on several factors:
Number of RMAN backup pieces being crosschecked. Number of RMAN backup pieces past their NetBackup retention period when NetBackup expires them, not RMAN. Format of the RMAN backup piece name and if the Veritas recommended _%t appears at the end of the format statement. Number of Oracle clients. Number of NetBackup policies of any kind.
Length of time NetBackup retains backups and the number of backup images for the client in the NetBackup catalog.
Scheduling time and the length of time between RMAN catalog maintenance operations. Speed and accuracy of host name and reverse host name resolution on the NetBackup master server. Number and complexity of the operations that the NetBackup master server performs during each crosscheck request. Normal performance.
|
Crosscheck using the Copilot share | If files on a Copilot share are deleted outside of RMAN, the subsequent incremental merge backups that are done to the share fail. An RMAN crosscheck of the share must be done before the next backup to prevent more failures. This version of the RMAN crosscheck is slightly different from the other crosscheck examples because of the need to specify type disk instead of type SBT_TAPE. When running the RMAN crosscheck, the default is the NetBackup_policyname. However, if the Datafile copy tag is changed in the Oracle tab, then that tag name must be used in place of NetBackup_policyname. An example of the command syntax follows (using the default NetBackup_policyname): Run {
Allocate channel ch00 type 'disk';
crosscheck backup tag <NetBackup_policyname>;
delete noprompt expired backup;
crosscheck copy <NetBackup_policyname>;
delete noprompt expired copy;
release channel ch00;
} |
Delete obsolete backups | The DELETE OBSOLETE command deletes the backups that are no longer needed to satisfy specified recoverability requirements. You can delete obsolete pieces according to the configured default retention policy, or another retention policy that a DELETE OBSOLETE option specifies. As with other forms of the DELETE command, the deleted files are removed from the backup media (i.e. expired from NetBackup). Then they are deleted from the recovery catalog, and marked as DELETED in the control file. If you specify the DELETE OBSOLETE command with no arguments, then RMAN deletes all the obsolete backups that the currently configured retention policy defines. For example: Allocate channel for maintenance type 'SBT_TAPE';
DELETE OBSOLETE; You can also use the REDUNDANCY or RECOVERY WINDOW clauses with DELETE to delete the backups that are obsolete under a specific retention policy instead of the configured default: DELETE OBSOLETE REDUNDANCY = 3;
DELETE OBSOLETE RECOVERY WINDOW OR 7 DAYS; |
Delete expired backups
| The delete expired backupset command operates only on the expired backup pieces that are found in the recovery catalog. RMAN removes them from the recovery catalog and also from the backup media (i.e. expires them from NetBackup).
To delete expired backup sets of a database from the recovery catalog, start RMAN and connect to the target and the recovery catalog databases. At the RMAN command prompt, type the following commands:
allocate channel for maintenance type
'SBT_TAPE';
delete expired backupset of database;
The crosscheck and delete backupset commands restrict the list of objects to only those that are operated on. The restrictions are placed on the specified Oracle device type (disk or SBT tape), object type (archived logs or database files), and date range.
|
Resynchronize the recovery catalog
| RMAN compares the recovery catalog to either the current control file of the target database or a backup control file. It subsequently updates the catalog with the missing information or changed information.
If you are running in ARCHIVELOG mode, do the following: Resynchronize the recovery catalog regularly because the recovery catalog is not updated automatically when a log switch occurs or when a redo log is archived.
You must also resynchronize the recovery catalog after making any change to the physical structure of the target database. As with log archive operations, the recovery catalog is not automatically updated when a physical schema change is made.
The RMAN backup, copy, restore, and switch commands update the recovery catalog automatically when the target database control file is available. The recovery catalog database is available when one of these commands is executed.
If the recovery catalog is unavailable when you issue backup or copy commands, you should resynchronize it manually.
To resynchronize the recovery catalog, start RMAN and issue the resync catalog command.
|
Change the availability of a backup set or file copy
| Periodically, you might need to notify RMAN that the status of a backup set, backup piece, data file copy, or archived redo log has changed. The RMAN change command enables you to make a variety of useful record changes.
The change ... uncatalog command removes references to a backup piece, data file copy, or archive log from the recovery catalog. This command works only with a recovery catalog.
The change ... delete command removes references to a backup piece, data file copy, or archive log from the control file and recovery catalog. It physically deletes the file. This command works with or without a recovery catalog.
The change ... crosscheck command removes references to a backup piece, data file copy, or archive log from the control file and recovery catalog. The references are removed when that file no longer exists. This command works with or without a recovery catalog.
The change ... unavailable command marks a backup piece, data file copy, or archive log as unavailable. This command works only with a recovery catalog.
|
Validate the restore of backups
|
A restore validation retrieves the backup pieces from storage (NetBackup) and checks that the retrieved pieces are intact. But the restore validation discards the backup pieces without saving the contents into the database. Use restore ... validate when you want RMAN to choose the backups to test.
Use validate backupset when you want to specify the backup sets to test.
|