2008年01月15日
Oracle 10g FlashBack
主要內容如下:
|
Recovery at all levels:
Flashback的好處:
Flashback 結構:
使用 Flashback 的要求:
flashback 管理
操作面:
查看flash recovery area當用的指令
設定tablespace內的boject是否要使用 flashback 的功能
Flashback database:
flashback table/index/trigger/constraints
flashback version query
flashback transaction query
常用指令
總結:
補充:
supplemental log
|
Flashback的好處:
|
Flashback 結構:
|
使用 Flashback 的要求:
|
flashback 管理
|
操作面:
查看flash recovery area當用的指令
| SQL> select estimated_flashback_size , flashback_size from v$flashback_database_log; SQL>select oldest_flashback_scn , oldest_flashback_time from v$flashback_database_log; SQL>select * from v$flashback_database_stat; oldest_flashback_scn/oldest_flashback_time : 在使用flashback做不完全還原時,可還原到的最舊的scn值跟時間點 v$flashbacj_database_stat :每一個小時更新一次資訊,裏面記錄著大可還原的scn值,現在flahback recovery空間的使用大小。用於評估我們是否需要調整 flashback的保留時間、使用空間等參數 |
設定tablespace內的boject是否要使用 flashback 的功能
| SQL>alter tablespace <ts_name> flashback {on | off} SQL>select name , flashback_on from v$tablespace; note:當你重建 control file 後 ,tablespace 會設為預設值為 on |
Flashback database:
| RMAN>flashback database to time = to_date('2007-01-01 12:00:00','yyyy-mm-dd hh24:mi:ss'); RMAN>flashback database to scn = 1234567; RMAN>flashback database to sequence=123 thread=1; SQL>flashback database to timestamp(sysdate-1/24); SQL>flashback database to scn 123456; 在 data guard 中的應用,我們都知道 standby機器在平常運作時都是處於 mount ,但我們可以利用 flashback database的方式,將standby開起後,進行測試相關程式後,再把他 flashback 到未變的時間點 SQL>create restore point test_standby guarantee flashback database; (建立一個新的還原點) SQL>drop restore point test_standby; (刪除一個還原點) SQL>flashback database to restore point test_standby; (還原整個db到指定的還原點) SQL>flashback table employees to restore point test_standby; (還原指定的 table 到時定的時間點,,而時間就依指定的還原點建立的時刻) 可在sqlplus裏可做flashback的動作,也可在rman中執行。要注意的是,當使用timestamp時,需要指定 "小數秒" 的值,不然會出現錯誤 注意:
|
flashback table/index/trigger/constraints
注意
|
flashback version query
無法使用的情況:
|
flashback transaction query
注意
|
常用指令
額外
|
總結:
| object level | scenario | flashback technology |
| database | drop user | flashback database |
| truncate table | flashback database | |
| batch job:partial changes | flashback database | |
| table | drop table | flashback drop |
| update with wrong where clause | flashback table | |
| compare current data against the data at some time in the past | flashback query | |
| Tx | Batch job runs twice,but you are unsure of the objects affected | flashbacj query |
補充:
supplemental log
|
引用URL
http://cgi.blog.roodo.com/trackback/4987759
回應文章 
Lovely. Great site.
Posted by home loan
at 2009年01月30日 05:36