Enabling Flashback Database

To revert the entire database to a prior point in time, you can either revert the entire database to a prior point in time by restoring a backup and doing point-in-time recovery, or you can enable Flashback Database. When you enable Flashback Database, the database generates flashback logs in the fast recovery area. These logs are used to flash back the database to a specified time. During usual operation, the database occasionally logs images of data blocks to the flashback logs. The database automatically creates, deletes, and resizes flashback logs.

Use the following command to check if Flashback Database is enabled for your target database:

SELECT FLASHBACK_ON FROM V$DATABASE;

To enable Flashback Database:

  1. Ensure that you configure a fast recovery area and that the database is running in ARCHIVELOG mode.
  2. Connect Oracle Recovery Manager (RMAN) to the target database as described in "Connecting to the Target Database Using RMAN."
  3. Optionally, specify the length of the desired flashback window (in minutes) by setting the DB_FLASHBACK_RETENTION_TARGET initialization parameter.

    The default value for this parameter is 1440 minutes, which is one day. The following command specifies that the flashback window must be 3 days.

    ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320;
    
  4. Enable the Flashback Database feature for the whole database using the following command:
    ALTER DATABASE FLASHBACK ON;
    

You can also execute the commands in this section by connecting to the target database using SQL*Plus instead of RMAN.

See Also: