Skip Headers

Oracle® Database Recovery Manager Reference
10g Release 1 (10.1)

Part Number B10770-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to current chapter
Up
Go to next page
Next
View PDF

FLASHBACK

Syntax

flashback::=

Text description of flashback.gif follows


Text description of flashback

Purpose

Performs a Flashback Database operation, returning the database to (or to just before) target time, as specified by time, SCN or log sequence number.

The result of using flashback database is generally similar to a database point-in-time recovery performed with RECOVER, except for the following principal differences:

Because FLASHBACK DATABASE does not require you to restore a backup, it is usually much faster than incomplete recovery.

Restrictions and Usage Notes

Keywords and Parameters

Syntax Element Description

DEVICE TYPE deviceSpecifier

Allocates automatic channels for the specified device type only. For example, if you configure automatic disk and tape channels, and issue FLASHBACK ... DEVICE TYPE DISK, then RMAN allocates only disk channels. RMAN may need to restore redo logs from backup during the flashback database process. Changes between the last flashback log and the target time must be re-created based on the archived redo log. If no automatic channels are allocated for tape and a needed redo log is on tape, the FLASHBACK operation will fail.

See Also: "deviceSpecifier"

DATABASE

Returns the database to the specified point. Query OLDEST_FLASHBACK_SCN and OLDEST_FLASHBACK_TIME in V$FLASHBACK_DATABASE_LOG to display the approximate lowest SCN and time to which you can flash back. View the current database SCN in V$DATABASE.CURRENT_SCN.

TO SCN = integer

Returns the database to the point up to (and including) the specified SCN.

TO BEFORE SCN = integer

Returns the database to its state just before the specified SCN. Any changes at an SCN lower than that specified are applied, but if there is a change associated with the specified SCN it is not applied.

TO SEQUENCE = integer THREAD = integer

Specifies a redo log sequence number and thread as an upper limit. RMAN applies changes up to (and including) the last change in the log with the specified sequence and thread number.

TO BEFORE SEQUENCE = integer [THREAD = integer]

Specifies a redo log sequence number and thread as an upper limit. RMAN applies changes up to (but not including) the last change in the log with the specified sequence and thread number.

TO TIME = 'date_string'

Returns the database to its state at the specified time. You can use any SQL DATE expressions to convert the time to the current format, for example, FLASHBACK DATABASE UNTIL TIME 'SYSDATE-7'.

TO BEFORE TIME = 'date_string'

Similar to the TO TIME clause, but returns the database to its state including all changes up to but not including changes at the specified time.

Examples

FLASHBACK DATABASE to a Specific SCN: Example

The following command flash back the database to a particular SCN:

RMAN> FLASHBACK DATABASE TO SCN 46963;
FLASHBACK DATABASE to One Hour Ago: Example

The following command flashes the database by 1/24 of a day, or one hour:

RMAN> FLASHBACK DATABASE TO TIMESTAMP (SYSDATE-1/24);
FLASHBACK DATABASE to a Specific Time: Example

The following command uses SQL date conversion functions to specify the target time:

RMAN> FLASHBACK DATABASE TO TIMESTAMP
   TO_TIMESTAMP('2002-03-11 16:00:00', 'YYYY-MM-DD HH24:MI:SS');