Use the change command to alter the information in your recovery catalog.
Using the Change Command
You will rarely run into a situation where you want to change the information in your recovery catalog.
On those rare occasions, you can use the change command. The change command works only on backup set, backup pieces, data file copies, and archive log and control files.
Some of the change command options work with or without a recovery catalog. The basic syntax for a change command is:
rman>change <filetype> <name> <option>;
The <filetype> options are archivelog, backuppiece,
backupset, controlgilecopy, and datafilecopy. The <name> is usually a quoted string that identifies a file.
The valid choices for the <option>; keyword are in the table below.
Used with or without a recovery catalog
Removes references from the catalog. Use this to notify Recovery Manager when you have deleted items by
means other than the change delete command, which is covered in the next lesson.
Marks references as unavailable. Use this when a file cannot be found or may have been relocated. Files marked unavailable will not be
used during a restore or recovery operation.
Marks references as available. If an unavailable file is located, it can be made available for use during a backup or restore.
With and without
Removes references from the catalog and deletes the physical OS file. This option is covered in the next lesson.
With and without
Removes references from the catalog and control file. This option is covered in the next lesson.
In this first example, your D disk is lost and the data file copy on that drive is no longer available. Hence, you do not want Recovery Manager to consider this backup file during a recovery strategy.
We have just mentioned the change command and explained how it can be used to modify the retention window assigned to a specific backup.
The change command allows you to change the status of a backup. You might have a case where one of your backup media devices becomes unavailable for a period of time (perhaps someone spilled a drink down the power supply).
In this event, you can use the change command to indicate that the backups on that device are unavailable.
Once you have properly scolded the employee for fiddling around in your hardware area with a drink and have fixed the device, you can change the status of that backup set with the change command again so that it will take on an AVAILABLE status.
You can also change a backup status to UNAVAILABLE, indicating that the backup is not currently available.
This effectively disqualifies the backup from consideration during restore and recovery operations, but protects the backup record from being removed
during the execution of the delete expired command. Some change commands, such as the change unavailable command, are not valid when the backup set pieces are stored in the FRA.
Here are some examples of the use of the change command:
Using the change command, you can modify the status of archived redo log backups.
For example, you can modify the status to UNAVAILABLE for all archived redo logs that
have been backed up at least a given number of times. You can also change the status of
all backups that occurred using a given device.
In the next lesson, you will learn how to use the delete and validate commands.