Oracle10g中有一個新增得功能Flashback Database,當你啟動它以後,它會定期將已發生變化的塊寫入到閃回日志的日志文件中。請注意這些日志不是由傳統的Log Writer (LGWR) 過程寫入,而是由一種稱作Recovery Writer的新過程來寫入。
$ ps -ef|grep rvwr|grep -v grep
oracle 27231 1 0 17:10:30 ? 0:00 ora_rvwr_eygle
注釋:與常規的重做日志有所不同,回閃日志既不需要DBA創建,也不需要DBA來維護;它們由Oracle Managed Files(OMF)自動在閃回恢復區域所指定的目錄中創建。請注意這些文件不會歸檔,所以,如果在該目錄發生介質故障後就不可能再進行恢復了。
(1)首先啟用閃回數據庫特性
SYS AS SYSDBA on 2005-03-29 16:42:19 >startup mount;
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1301704 bytes
Variable Size 261890872 bytes
Database Buffers 50331648 bytes
Redo Buffers 1048576 bytes
Database mounted.
SYS AS SYSDBA on 29-MAR-05 >alter database archivelog;
Database altered.
SYS AS SYSDBA on 29-MAR-05 >alter database flashback on;
Database altered.
SYS AS SYSDBA on 29-MAR-05 >alter database open;
Database altered.
SYS AS SYSDBA on 29-MAR-05 >alter session set nls_date_format=
'yyyy-mm-dd hh24:mi:ss';
Session altered.
SYS AS SYSDBA on 2005-03-29 17:01:42 >SELECT OLDEST_FLASHBACK_SCN,
OLDEST_FLASHBACK_TIME
2 FROM V$FLASHBACK_DATABASE_LOG;
OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TI
-------------------- -------------------
10642627 2005-03-29 17:01:02
(2)閃回日志
注釋:Oracle會在閃回區來記錄日志。
$ pwd
/data5/flash_recovery_area/EYGLE/flashback
$ ls -l
total 32064
-rw-r----- 1 oracle dba 8200192 Mar 29 16:49 o1_mf_14l5bclp_.flb
-rw-r----- 1 oracle dba 8200192 Mar 29 17:31 o1_mf_14l6w5h4_.flb