4.22 untilClause
Purpose
Use the untilClause
subclause to specify an upper limit by time, SCN, or log sequence number for various RMAN operations.
Usage Notes
To specify a restore point, use the TO
RESTORE
POINT
clause. See "SET" for an example.
Semantics
Syntax Element | Description |
---|---|
Specifies an SCN as an upper, noninclusive limit. RMAN selects only files that it can use to restore or recover up to but not including the specified SCN (see Example 4-41). For example, |
|
Specifies a redo log sequence number and thread as an upper, noninclusive limit. RMAN selects only files that it can use to restore or recover up to but not including the specified sequence number. For example, |
|
Specifies the number of the redo thread. |
|
Specifies a time as an upper, noninclusive limit (see Example 4-42). RMAN selects only files that it can use to restore and recover up to but not including the specified time. For example, When specifying dates in RMAN commands, the date string must be either:
Following are examples of typical date settings in RMAN commands: BACKUP ARCHIVELOG FROM TIME 'SYSDATE-31' UNTIL TIME 'SYSDATE-14'; RESTORE DATABASE UNTIL TIME "TO_DATE('09/20/06','MM/DD/YY')"; Note: The granularity of time-based recovery is dependent on time stamps in the redo log. For example, suppose that you specify the following command: RECOVER DATABASE UNTIL TIME '2013-07-26 17:45:00'; If no redo was written with a time stamp of |
Examples
Example 4-41 Performing Incomplete Recovery to a Specified SCN
This example, which assumes a mounted database, recovers the database up to (but not including) the specified SCN:
STARTUP FORCE MOUNT RUN { SET UNTIL SCN 1418901; # set to 1418901 to recover database through SCN 1418900 RESTORE DATABASE; RECOVER DATABASE; } ALTER DATABASE OPEN RESETLOGS;
Example 4-42 Reporting Obsolete Backups
This example assumes that you want to be able to recover to any point within the last week. It considers as obsolete all backups that could be used to recover the database to a point one week ago:
REPORT OBSOLETE UNTIL TIME 'SYSDATE-7';