Oracle® Database Recovery Manager Reference 10g Release 1 (10.1) Part Number B10770-01 |
|
|
View PDF |
flashback::=
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:
FLASHBACK
command does not start modifying the database until it has made sure that it has all the files and resources that it needs.NOLOGGING
changes will be reflected in the flashback which would not be reflected in the results of a point-in-time recovery, because flashback database uses backed-up block images as the basis for undoing changes to your current datafiles.Because FLASHBACK
DATABASE
does not require you to restore a backup, it is usually much faster than incomplete recovery.
RUN
command.ARCHIVELOG
mode.ALTER
DATABASE
...
FLASHBACK
ON
. You can query this status in V$DATABASE.FLASHBACK_ON
.DB_RECOVERY_FILE_DEST
must be set). Flashback logs can only be stored in the flash recovery area.DB_FLASHBACK_RETENTION_TARGET
initialization parameter, and upon the actual retention of flashback logs permitted by available disk space. If there is not enough space in the flash recovery area for the retention of other required files, flashback logs may be deleted to make room. If the FLASHBACK
command does not have enough flashback data to return the database to the requested SCN or time, then RMAN issues an error and does not modify the database.FLASHBACK
on those for which there is sufficient flashback log data. Afterwards, you can perform point-in-time recovery on those files where there was not sufficient flashback log data.ALTER
TABLESPACE
...
FLASHBACK
OFF
.OPEN
RESETLOGS
after running FLASHBACK
DATABASE
. If datafiles are not flashed back because they are offline, then the RESETLOGS
may fail with an error. In that case you must do one of the following:
FLASHBACK
DATABASE
to a time before an OPEN
RESETLOGS
.FLASHBACK
command behaves differently depending on the nature of the status change. Refer to Table 2-3.FLASHBACK
command fails or is interrupted, then the database is left mounted. You can issue another FLASHBACK
command or run RECOVER
to return the database to its original state.RECOVER DATABASE
to re-apply all changes and bring the database back to its state when you started the flashback operation. You can then attempt flashb ack again. If you are satisfied, you can either perform an OPEN RESETLOGS
to abandon all changes after the target time for the flashback, or you can export lost data, use RECOVER DATABASE
to return your database to its state before the flashback database operation, and then re-import the lost data.FLASHBACK DATABASE
operation, your database may not be left at the SCN most immediately before the target time you specify. There are events other than transactions which cause the SCN for your database to be updated. If you use the FLASHBACK DATABASE TO
form of the command and there is a transaction associated with your specified SCN, the database after the flashback operation will include all changes up to and including that transaction. Otherwise, all changes up to but not including that transaction will be included in your datafiles, whether you use the FLASHBACK DATBASE TO
or FLASHBACK DATABASE TO BEFORE
form of the command. Changes after the specified target time or SCN are never applied.
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" |
|
Returns the database to the specified point. Query |
Returns the database to the point up to (and including) the specified SCN. | |
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. | |
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. | |
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. | |
Returns the database to its state at the specified time. You can use any SQL | |
Similar to the |
The following command flash back the database to a particular SCN:
RMAN> FLASHBACK DATABASE TO SCN 46963;
The following command flashes the database by 1/24 of a day, or one hour:
RMAN> FLASHBACK DATABASE TO TIMESTAMP (SYSDATE-1/24);
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');