Oracle9i Recovery Manager Reference Release 2 (9.2) Part Number A96565-01 |
|
RMAN Commands , 39 of 59
recoverObject::=
recoverOptionList::=
To apply redo logs or incremental backups to one or more restored datafiles in order to update them to a specified time.
RMAN first looks for archived logs or image copies on disk, and if none are available, then it restores logs from backups as needed for the recovery. If you specify DELETE
ARCHIVELOG
, then RMAN deletes the logs after restoring them.
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. Note that 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:
Oracle9i Recovery Manager User's Guide to learn how to recover datafiles |
ALLOCATE CHANNEL
command must precede RECOVER
unless you do not need to restore archived redo log or incremental backups.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 a RESTORE
and before a RECOVER
, then you may not be able to perform media recovery on the database to the time required because the restored files may have time stamps later than the specified time.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" |
|
Specifies that the entire database is to be recovered. Unless you specify an |
Specifies a noncurrent time, SCN, or log sequence number for termination of the See Also: "untilClause" |
|
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 tablespaces by tablespace name. |
Specifies a noncurrent time, SCN, or log sequence number for termination of the See Also: "untilClause" |
|
|
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 known 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. 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 various recovery options. |
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 |
|
Checks the headers of read-only files to ensure that they are current before omitting them from the recovery. |
|
Suppresses the application of redo logs--only incremental backups are applied. This option is intended for recovery of Note: Incremental backups of |
|
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 Provided the sum of physical and logical corruptions detected for a file remain below its Note: 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 |
|
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. |
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:
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, you do:
STARTUP FORCE NOMOUNT; 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; } 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 SQL "ALTER TABLESPACE temp ADD TEMPFILE ''?/oradata/trgt/temp01.dbf'' REUSE";
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|