Database Reference
In-Depth Information
2. Set the DB_FLASHBACK_RETENTION_TARGET parameter to the desired value. This value is
in minutes, which equates to three days:
SQL> alter system set db_flashback_retention_target=4320 scope=both;
3. Enable the Flashback capability:
SQL> alter database flashback on;
4. Now the database can be opened for normal use:
SQL> alter database open;
As you can see, enabling Flashback Database is fairly simple. A key point for you to know
is how far back in time you need to be able to flash back from, or know the DB_FLASHBACK_
RETENTION_TARGET parameter value. The DB_FLASHBACK_RETENTION_TARGET value will
determine how far you can flash back the database in minutes. In the preceding example, we
specified the value of 4,320, which is for three days; the default value is 1,440, or one day.
Monitoring Flashback Database
The Flashback Database can be monitored by using a few dynamic views: V$DATABASE ,
V$FLASHBACK_DATABASE_LOG , and V$FLASHBACK_DATABASE_STAT . These views provide some
valuable information regarding the status of the Flashback Database and the supporting
operations.
The V$DATABASE view displays whether the Flashback Database is on or off. This tells
you whether the Flashback Database is enabled or not.
Let's query the V$DATABASE view and see the results:
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------
YES
SQL>
Query the V$FLASHBACK_DATABASE_LOG to determine the amount of space required in the
recovery area to support the flashback activity generated by changes in the database. The
values in the OLDEST_FLASHBACK_SCN and OLDEST_FLASHBACK_TIME columns give you informa-
tion regarding how far back you can use Flashback Database. This view also shows the size
of the flashback data in the FLASHBACK_SIZE column. The column ESTIMATED_FLASHBACK_
SIZE can be used to identify the estimated size of flashback data that you need for your cur-
rent target retention. Shown next is an example of querying the V$FLASHBACK_DATABASE_LOG :
SQL> select
2 oldest_flashback_scn,
Search WWH ::




Custom Search