Oracle® Database Backup and Recovery Reference 11g Release 2 (11.2) Part Number E10643-06 |
|
|
PDF · Mobi · ePub |
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 copyRMAN must be connected as TARGET
to a database instance, which must be started.
"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
.
change::=
(maintSpec::=, forDbUniqueNameOption::=, keepOption::=, deviceSpecifier::=)
maintSpec::=
(listObjList::=, archivelogRecordSpecifier::=, maintQualifier::=, recordSpec::=, deviceSpecifier::=)
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 |
---|---|
maintSpec |
Specifies which files you want to CHANGE .
See Also: |
forDbUniqueNameOption |
Changes the metadata for objects that are exclusively associated with the specified DB_UNIQUE_NAME in a Data Guard environment.
See Also: |
AVAILABLE |
Changes the status of a backup or copy to AVAILABLE in the repository. RMAN searches for the file and verifies that it exists.
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: |
keepOption |
Changes the exemption status of a backup or copy in relation to the configured retention policy. For example, specify CHANGE ... NOKEEP to remove the KEEP attributes for a backup, making it subject to the backup retention policy.
The See Also: |
resetDbUniqueNameOption |
Associates the files in maintSpec with a different database in a Data Guard environment.
See Also: |
UNAVAILABLE |
Changes the status of a backup or copy to UNAVAILABLE in the repository (see Example 2-35). View the status in the LIST output or recovery catalog views.
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 |
UNCATALOG |
Removes references to a data file copy, backup piece, or archived redo log from the recovery catalog, and updates records in the target control file to status DELETED (see Example 2-36). The CHANGE ... UNCATALOG command does not touch physical backups and copies. Use this command to notify RMAN when a file is deleted by some means other than a DELETE command.
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 |
DEVICE TYPE deviceSpecifier |
Executes the CHANGE for the specified device type only (see deviceSpecifier ). This option is valid only if you have configured automatic channels and have not manually allocated channels. For example, if you run CHANGE UNCATALOG ... DEVICE TYPE DISK , then RMAN only uncatalogs files on disk. |
changeFailure |
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 DB_UNIQUE_NAME for a database in a Data Guard environment. The first value specifies the old DB_UNIQUE_NAME for the database currently recorded in the recovery catalog, whereas the second specifies the new DB_UNIQUE_NAME .
RMAN must be connected to a recovery catalog and a mounted target database. The target database should not have the Typically, you use this command after you have changed the Assume that you have 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 |
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 |
---|---|
RESET DB_UNIQUE_NAME |
Associates the files in maintSpec with the target database (see Example 2-39). Table 2-2 explains the RMAN behavior when different options are specified.
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 |
TO db_unique_name |
Associates the files in maintSpec with the specified database in a Data Guard environment. |
This clause enables you to change the status of failures. Use the LIST
FAILURE
command to show the list of failures.
Example 2-35 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-07 1 1 NO TAG20070427T115348 3 B A A DISK 24-MAR-07 1 1 NO TAG20070427T115452 4 B F A DISK 24-APR-07 1 1 NO TAG20070427T115456
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-20070424-00 RECID=4 STAMP=588858897 Changed 1 objects to UNAVAILABLE status
Example 2-36 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-37 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 should never become obsolete.
RMAN> CONNECT TARGET /
RMAN> CONNECT CATALOG rman@catdb
recovery catalog database Password: password
RMAN> CHANGE BACKUP TAG 'consistent_db_bkup' KEEP FOREVER;
Example 2-38 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-06 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-06 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-39 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-40 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 rman@catdb
recovery catalog database Password: password
RMAN> CHANGE DB_UNIQUE_NAME FROM dgrdbms4 TO sfrdbms4;