Oracle® Database Recovery Manager Reference 10g Release 1 (10.1) Part Number B10770-02 |
|
|
View PDF |
recover::=
recoverObject::=
Text description of recoverObject
dbObject::=
Text description of recoverOptionList
sizeSpec::=
The RECOVER command has three uses:
When performing media recovery, RMAN first looks for archived logs or image copies on disk, and if none are available, then it restores logs from backups to the LOG_ARCHIVE_DEST_1
destination (or the SET
ARCHIVELOG
DESTINATION
) as needed for the recovery.
Complete and point-in-time recovery of a database can use both incremental backups and redo logs. If RMAN has a choice between applying an incremental backup or applying redo, then it always chooses the incremental backup. If overlapping levels of incremental backup are available, then RMAN automatically chooses the one covering the longest period of time. RMAN can apply incremental backups to restored files that were not created as part of an incremental backup.
Note: When RMAN applies incremental backups, it recovers changes to objects created with the |
See Also:
|
RESETLOGS
operations transparently if the parent incarnation backups were restored. If required, the RECOVER
command can also restore and apply archived logs and incremental backups from prior incarnations.ALLOCATE CHANNEL
commands in a RUN
block with your RECOVER
command.DISK
channel. If incremental backups need to be restored during recovery, then you must either use configured channels or manually allocate channels of the same type that created these backups.SET
UNTIL
command before both the RESTORE
and RECOVER
commands. If you run SET
UNTIL
after the RESTORE
operation, then you may not be able to perform media recovery on the database to the target time, because the restored files may have time stamps later than the target time.SET UNTIL
, followed by RESTORE DATABASE
and RECOVER DATABASE
) or recover wholly contained tablespaces to a point in time different from the rest of the database (TSPITR, in which case you must use RECOVER TABLESPACE... UNTIL...
). For more information on DBPITR, see tOracle Database Backup and Recovery Advanced User's Guide.For more information on TSPITR, see the procedure described in Oracle Database Backup and Recovery Advanced User's Guide .RECOVER
DATABASE
command does not recover any files that are offline normal or read-only at the point in time to which the files are being recovered. RMAN omits offline normal files with no further checking. If CHECK READONLY
is specified, then RMAN checks each read-only file on disk to ensure that it is already current at the desired point in time. If CHECK READONLY
is not specified, then RMAN omits read-only files.RESETLOGS
option after incomplete recovery or recovery with a backup control file.CONFIGURE
DEVICE
TYPE
command (except for DISK
, which is preconfigured) before specifying the DEVICE
TYPE
option.RECOVER
with the DEVICE
TYPE
option.Syntax Element | Description |
---|---|
|
Allocates automatic channels for the specified device type only. For example, if you configure automatic disk and tape channels, and issue See Also: "deviceSpecifier" |
Syntax Element | Description |
---|---|
|
Applies incremental backups to the specified image copy to roll it forward to any time equal to or before the most recent incremental backup of the file. The existing image copy is overwritten, and remains in a fuzzy state during the recovery. You must meet the following requirements:
Note: RMAN issues a warning (not an error) if it cannot recover to the specified time (or current time if none is specified) because no incrementals are available. |
Specifies a tag name to identify the image copy to be rolled forward. |
|
|
Applies incremental backups to the specified datafile image copy. Refer to description of |
|
Lists tablespaces that should not be recovered, which is useful for avoiding recovery of tablespaces containing only temporary data or for postponing recovery of some tablespaces. The If you perform incomplete recovery, then |
Specifies a past time, SCN, or log sequence number for termination of the See Also: "untilClause" |
Syntax Element | Description |
---|---|
|
Specifies that the entire database is to be recovered. By default, RMAN performs complete recovery. For incomplete recovery, specify an |
|
Specifies a list of one or more datafiles to recover. Specify datafiles by either filename (by using a quoted string) or absolute datafile number (by using an integer). If you are using the control file as the exclusive repository for RMAN metadata, then the filename must be the name of the datafile as recorded in the control file. If you are using a recovery catalog, then the filename of the datafile must be the most recent name recorded in the catalog, even if the name in the control file has been updated more recently. For example, assume that a datafile was renamed in the control file. The instance then fails before you can resynchronize the catalog. Specify the old name of the datafile in the See Also: "datafileSpec" |
|
Specifies tablespaces by tablespace name. |
Syntax Element | Description |
---|---|
|
Specifies various recovery options. |
Specifies the tag for an archived log backup to be used during recovery. If the tagged backup does not contain all the necessary logs for recovery, RMAN uses logs or incremental backups as needed from whatever is available. Note that tag names are not case sensitive and display in all uppercase. |
|
Can only be used when performing TSPITR. Used to automate the management of auxiliary set files during TSPITR. Specifies a location where auxiliary set datafiles, control files and online logs are created during TSPITR if another location for an individual file is not explicitly specified. If you do not specify See also: The chapter on TSPITR in Oracle Database Backup and Recovery Advanced User's Guide for more details about the auxiliary destination. |
|
Tests data and index blocks that pass physical corruption checks for logical corruption, for example, corruption of a row piece or index entry. If RMAN finds logical corruption, it logs the block in the If the total number of physical and logical corruptions detected for a file is less than its Note: The |
|
Checks the headers of read-only files to ensure that they are current before omitting them from the recovery. |
|
Deletes archived logs restored from backups or copies that are no longer needed. RMAN does not delete archived logs that were already on disk before the If you do not specify Note: If archived redo logs are restored to the flash recovery area then the |
|
Specifies the tag for an incremental backup to be used during recovery. If the tagged backup does not contain all the necessary incrementals for recovery, then RMAN uses logs or incremental backups as needed from whatever is available. Note that tag names are not case sensitive and display in all uppercase. See Also: "BACKUP" to learn how a tag can be applied to an individual copy of a duplexed backup set, and to learn about the default filename format for backup tags |
|
Suppresses the application of redo logs--only incremental backups are applied. This option is intended for recovery of Note: Incremental backups of |
|
Use the Note: You can use this clause only if you have restored a backup taken since the last RESETLOGS operation. Otherwise, the database returns an error. |
|
The When you use this clause during trial recovery (that is, in conjunction with the TEST clause), |
|
Specifies not to perform recovery in parallel. Serial execution is the default for |
|
Specification of integer indicates the degree of parallelism, which is the number of parallel threads used in the parallel operation. Each parallel thread may use one or two parallel execution servers. Normally the database calculates the optimum degree of parallelism, so it is not necessary for you to specify For more complete information on
|
The following example takes tablespace tools
offline, uses automatic channels to restore and recover it (deleting the logs that it restored from tape), then brings it back online:
SQL "ALTER TABLESPACE tools OFFLINE IMMEDIATE"; RESTORE TABLESPACE tools; # restore only 2M of logs at a time, then delete them RECOVER TABLESPACE tools DELETE ARCHIVELOG MAXSIZE 2M; SQL "ALTER TABLESPACE tools ONLINE";
The following example uses the preconfigured disk channel and manually allocates one media management channel to use datafile copies on disk and backups on tape, and restores one of the datafiles in tablespace users
to a different location:
RMAN> RUN { ALLOCATE CHANNEL dev2 DEVICE TYPE sbt; SQL "ALTER TABLESPACE users OFFLINE IMMEDIATE"; SET NEWNAME FOR DATAFILE '?/oradata/trgt/users01.dbf' TO '/tmp/users01.dbf'; RESTORE TABLESPACE users; SWITCH DATAFILE ALL; RECOVER TABLESPACE users; SQL "ALTER TABLESPACE users ONLINE"; }
Assume that all datafiles and control files as well as archived redo log 40 were lost due to a disk failure. Because you do not have incremental backups, you need to recover the database with available archived redo logs. You do not need to restore tablespace history
because it has not changed since log 40. After connecting to the target and recovery catalog, follow the example shown here:
RMAN> STARTUP FORCE NOMOUNT; RMAN> RUN { SET UNTIL SEQUENCE 530 THREAD 1; # Recover database until log sequence 40 RESTORE CONTROLFILE TO '/tmp/control01.ctl'; RESTORE CONTROLFILE FROM '/tmp/control01.ctl'; # Replicates to CONTROL_FILES locations ALTER DATABASE MOUNT; RESTORE DATABASE SKIP TABLESPACE temp, history; RECOVER DATABASE SKIP FOREVER TABLESPACE temp; } RMAN> ALTER DATABASE OPEN RESETLOGS;
If the database uses locally-managed temporary tablespaces, then you must add tempfiles to these tablespaces after restoring a backup control file, using the SQL ALTER TABLESPACE
... ADD TEMPFILE
command:
RMAN> SQL "ALTER TABLESPACE temp ADD TEMPFILE ''?/oradata/trgt/temp01.dbf'' REUSE";
Assume that at time t1 you create an image copy of datafile 3
:
BACKUP FOR RECOVER OF COPY WITH TAG DATAFILE 3 FORMAT '/disk1/3img.df' TAG "DF3CPY";
You can also refer to the datafile copy by its tag, with this form of the command:
RMAN> RECOVER COPY OF DATAFILE 3 WITH TAG "DF3CPY";
At time t2, t3, and t4 you make incremental backups of the database. To roll forward the image copy of datafile 3
to the date of the latest incremental backup, use the RECOVER command. You can identify the datafile by its filename with this form of the command:
RMAN> RECOVER DATAFILECOPY '/disk1/3img.df';
Assume that you have an image copy backup of a datafile and you want to roll it forward in time using incremental backups. Use RECOVER DATAFILECOPY with the UNTIL TIME UNTIL TIME option. For example, run the following command:
RMAN> RECOVER DATAFILECOPY '/disk1/3img.df' UNTIL TIME 'SYSDATE-7';
Available incremental backups are applied to the datafile copy to recover it to the desired point in time. Redo from the archived redo logs is not applied by this command.