Database Reference
In-Depth Information
To enable the Flashback Database feature, alter your database into flashback mode, as shown:
SQL> alter database flashback on;
Note
In oracle 10g the database must be in mount mode to enable Flashback database.
You can verify the flashback status, as follows:
SQL> select flashback_on from v$database;
After you enable Flashback Database, you can view the flashback logs in your FRA with this query:
select name, log#, thread#, sequence#, bytes
from v$flashback_database_logfile;
The range of time in which you can flash back is determined by the DB_FLASHBACK_RETENTION_TARGET parameter.
This specifies the upper limit, in minutes, of how far your database can be flashed back.
You can view the oldest SCN and time you can flash back your database to by running the following SQL:
select
oldest_flashback_scn
,to_char(oldest_flashback_time,'dd-mon-yy hh24:mi:ss')
from v$flashback_database_log;
If, for any reason, you need to disable Flashback Database, you can turn it off, as follows:
SQL> alter database flashback off;
You can use either RMAN or SQL*Plus to flash back a database. You can specify a point in time in the past, using
one of the following:
SCN
Timestamp
Restore point
RESETLOGS operation (works from RMAN only)
This example creates a restore point:
Last
SQL> create restore point flash_1;
Next, the application performs some testing, after which the database is flashed back to the restore point so that a
new round of testing can begin:
SQL> shutdown immediate;
SQL> startup mount;
SQL> flashback database to restore point flash_1;
SQL> alter database open resetlogs;
At this point, your database should be transactionally consistent with how it was at the SCN associated with the
restore point.
 
 
Search WWH ::




Custom Search