2.8 CHANGE
Purpose
Use the CHANGE
command to perform the following tasks:
-
Update the availability status of backups and copies recorded in the RMAN repository
-
Change the priority of or close failures recorded in the automatic diagnostic repository
-
Update the
DB_UNIQUE_NAME
recorded in the recovery catalog for the target database -
Associate the backup of a database in a Data Guard environment with a different database in the environment
See Also:
Oracle Database Backup and Recovery User's Guide to change the availability status of a backup or copy
Prerequisites
RMAN must be connected as TARGET
to a database instance, which must be started.
Usage Notes
"RMAN Backups in a Data Guard Environment" explains the difference between the association and accessibility of a backup. In a Data Guard environment, the database that creates a backup or copy is associated with the file. You can use maintenance commands such as CHANGE
, DELETE
, and CROSSCHECK
for backups when connected to any database in the Data Guard environment if the backups are accessible. In general, RMAN considers tape backups created on any database as accessible to all databases in the environment, whereas disk backups are accessible only to the database that created them.
For example, suppose that you connect RMAN as TARGET
to standby database standby1
and back it up to tape and disk. If the tape drive becomes unavailable, then you can connect RMAN as TARGET
to any primary or standby database in the Data Guard environment to change the status of the tape backup to UNAVAILABLE
. After the tape drive is repaired, you can connect RMAN as TARGET
to any database to change the status of the tape backup back to AVAILABLE
. However, if the disk backup is accidentally removed by an operating system utility, then RMAN can only change the status of the disk backup when connected as TARGET
to standby1
.
Syntax
change::=
(maintSpec::=, forDbUniqueNameOption::=, keepOption::=, deviceSpecifier::=)
(listObjList::=, archivelogRecordSpecifier::=, maintQualifier::=, recordSpec::=, deviceSpecifier::=)
Semantics
change
This clause enables you to change the status of RMAN repository records. To obtain the primary keys of RMAN repository records whose status you want to change, run a LIST
command or query the recovery catalog views.
Syntax Element | Description |
---|---|
|
Specifies the preplugin files that you want to |
Specifies which files you want to The See Also: |
|
Changes the metadata for objects that are exclusively associated with the specified See Also: |
|
|
Changes the status of a backup or copy to This feature is useful when a previously unavailable file is made available again. You can also use this option to alter the repository status of backups and copies from prior incarnations. This is the only If you execute Note: You can view the status of backups in the Note: |
Changes the exemption status of a backup or copy in relation to the configured retention policy. For example, specify The See Also: |
|
Associates the files in See Also: |
|
|
Changes the status of a backup or copy to This option is useful when a file cannot be found or has migrated offsite. RMAN does not use a file that is marked
Note: If you execute Note: The |
|
Removes references to a data file copy, backup piece, backup set, or archived redo log from the recovery catalog, and updates records in the target control file to status The If you execute Caution: If you resynchronize from a backup control file, or upgrade the recovery catalog, then records previously removed from the RMAN repository with Note: The |
|
Does not display a prompt when performing an uncatalog operation with the recovery catalog. |
DEVICE TYPE deviceSpecifier |
Executes the |
Specifies changes for failures recorded by the Data Recovery Advisor. |
|
DB_UNIQUE_NAME FROM db_unique_name TO db_unique_name |
Updates the metadata in the recovery catalog to reflect a new RMAN must be connected to a recovery catalog and a mounted target database. The target database must not have the Typically, you use this command after you have changed the Assume that you changed the
In the scenario in which only the old name is listed, execute In the scenario in which both the old and new names are listed, RMAN automatically executes the following commands when you run
Thus, RMAN changes the association of all backups for the |
resetDbUniqueNameOption
This clause enables you to associate backups made on one database in a Data Guard environment with a different database in the environment. The following table explains the RMAN behavior when different options are specified with RESET DB_UNIQUE_NAME
.
Table 2-2 RESET DB_UNIQUE_NAME Options
TO db_unique_name | FOR DB_UNIQUE_NAME | RMAN Behavior |
---|---|---|
No |
No |
RMAN associates the Typically, you would execute |
Yes |
No |
RMAN associates the |
No |
Yes |
RMAN restricts its operations to |
Yes |
Yes |
RMAN restricts its operations to |
Syntax Element | Description |
---|---|
|
Associates the files in When changing the association of the files from one database to another database, RMAN deletes the duplicate names from the recovery catalog. For example, if you change the association of data file copy Use caution when specifying the |
|
Associates the files in |
changeFailure
This clause enables you to change the status of failures. Use the LIST
FAILURE
command to show the list of failures.
Syntax Element | Description |
---|---|
|
Enables you to change priority or close failures recorded in the Automatic Diagnostic Repository. By default RMAN prompts for confirmation before performing the requested change. The target database to which RMAN is connected must be a single-instance database and must not be a physical standby database. |
|
Changes only open failures. |
|
Changes only critical failures. |
|
Changes only failures with |
|
Changes only failures with |
|
Changes only failures whose priority cannot be determined until the database is mounted. |
|
Changes only the specified failure. |
EXCLUDE FAILURE failnum |
Excludes the specified failures from the change. Use a comma-delimited list to specify multiple failures |
|
Closes the specified failures by setting their status to |
|
Changes the priority of the specified failures to |
|
Does not prompt for confirmation before modifying the specified failures. |
Examples
Example 2-44 Updating Backups to Status UNAVAILABLE
Assume that you have temporarily moved backup set 4 to a different location because of a space issue on disk. The backup, which has the key 4, is still listed as available:
RMAN> LIST BACKUP SUMMARY;
List of Backups =============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------- -- -- - ----------- --------------- ------- ------- ---------- --- 1 B A A DISK 24-FEB-13 1 1 NO TAG20130427T115348 3 B A A DISK 24-MAR-13 1 1 NO TAG20130427T115452 4 B F A DISK 24-APR-13 1 1 NO TAG20130427T115456
You do not want to uncatalog the backup because you plan to move it back to its original location when more disk space is available. Thus, you make the backup unavailable as follows (sample output included):
RMAN> CHANGE BACKUPSET 4 UNAVAILABLE; changed backup piece unavailable backup piece handle=/disk2/backup/c-3257893776-20130424-00 RECID=4 STAMP=588858897 Changed 1 objects to UNAVAILABLE status
Example 2-45 Uncataloging and Recataloging Archived Redo Log Files
In this example, you move all archived redo log files to a new directory, uncatalog them, and then recatalog them in the new location:
RMAN> HOST '/bin/mv $ORACLE_HOME/dbs/*.arc /disk2/archlog/'; RMAN> CHANGE ARCHIVELOG ALL UNCATALOG; RMAN> CATALOG START WITH '/disk2/archlog' NOPROMPT;
Example 2-46 Changing a Database Backup into an Archival Backup
Assume your goal to is to change a database backup into an archival backup, which you plan to store offsite. Because the backup is consistent and requires no recovery, you do not need to store archived redo log files with the backup. The example uses the CHANGE ... KEEP FOREVER
command to specify that the backup is never obsolete.
RMAN> CONNECT TARGET /
RMAN> CONNECT CATALOG rco@catdb
recovery catalog database Password: password
RMAN> CHANGE BACKUP TAG 'consistent_db_bkup' KEEP FOREVER;
Example 2-47 Changing the Status of a Failure
In the following example, the LIST
FAILURE
command shows that a data file has corrupt blocks. The failure number is 5 and has a priority of HIGH
. This data file contains nonessential data, so you decide to change the priority of this failure to low.
RMAN> LIST FAILURE; List of Database Failures Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------- 5 HIGH OPEN 11-DEC-13 datafile 8 contains corrupt blocks RMAN> CHANGE FAILURE 5 PRIORITY LOW; List of Database Failures Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------- 5 HIGH OPEN 11-DEC-13 datafile 8 contains corrupt blocks Do you really want to change the above failures (enter YES or NO)? YES changed 1 failures to LOW priority
Example 2-48 Associating Backups with a New Database in a Data Guard Environment
Assume that standby1
, standby2
, and standby3
are standby databases associated with primary database is prod
. This example assumes that RMAN is connected to target database prod
and a recovery catalog.
You are planning to remove standby1
from your environment, so you want to associate the standby1
backups with your primary database. You are also planning to remove standby3
from your environment, so you want to associate the standby3
backups with standby2
. You execute the following commands:
CHANGE BACKUP FOR DB_UNIQUE_NAME standby1 RESET DB_UNIQUE_NAME; CHANGE BACKUP FOR DB_UNIQUE_NAME standby3 RESET DB_UNIQUE_NAME TO standby2;
Example 2-49 Updating a DB_UNIQUE_NAME in the Recovery Catalog
Assume that a standby database has the DB_UNIQUE_NAME
initialization parameter setting of dgrdbms4
, which you decide to change to sfrdbms4
. You shut down the standby instance, change the DB_UNIQUE_NAME
initialization parameter to sfrdbms4
, and restart the standby instance.
Later, to update the recovery catalog to reflect the changed unique name of the standby database, you connect RMAN to the primary database and recovery catalog, and then execute the CHANGE
command as follows:
RMAN> CONNECT TARGET /
RMAN> CONNECT CATALOG rco@catdb
recovery catalog database Password: password
RMAN> CHANGE DB_UNIQUE_NAME FROM dgrdbms4 TO sfrdbms4;