本文將詳細介紹oracle 數據庫閃回相關語句,需要了解跟多的朋友可以參考下
1將表閃回到某一時間點:
閃回操作前啟用行移動功能
Sql代碼
alter table emp enable row movement;
執行閃回語句:
Sql代碼
flashback table emp to timestamp to_timestamp(‘20120709195000′,’YYYYMMDDHH24:MI:SS’);
2閃回回收站:
Java代碼
SQL>show recyclebin;
SQL>drop table emp;
SQL>show recyclebin;
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
EMP BIN$b+XkkO1RS5K10uKo9BfmuA==$0 TABLE 2012-11-07:15:30:47
SQL>flashback table emp to before drop;或
SQL>flashback table “BIN$b+XkkO1RS5K10uKo9BfmuA==$0” to before drop;
清理回收站:
清除回收站中的單個表:purge table emp
清除整個回收站:purge recyclebin
清除不同的對象回收站:purge user_recyclebin或purge dba_recyclebin
徹底刪除一個table: SQL>drop table emp purge; –表不能被恢復了。
3閃回事物查詢:
Sql代碼
select * from flashback_transaction_query where TABLE_NAME= ‘EMP’