應用情境:方便、快速恢複表資料;
閃回表
1.設定表的屬性
alter table aaa enable row movement;
2、恢複表資料到2分鐘以前
flashback table aaa to timestamp sysdate-(1/24/3600)*60*2
閃回資源回收筒
1)、表被drop後,可以在閃回資源回收筒這一邏輯空間找回.
flashback table aaa to before drop;
2)、徹底drop掉表
drop table aaa purge;
3)、資源回收筒
user_recyclebin;
dba_recyclebin;
4)、刪除資源回收筒裡的對象
purge table aaa;
purge index mmm;
5)、清空資源回收筒
purge tablespacetbs;-- 清除資料表空間tbs下的資源回收筒裡的內容;
purge tablespaceusers user scott—清除使用者scott下的資源回收筒裡內容;
purge user_recyclebin—使用者清除自己下面的資源回收筒;
purge dba_recyclebin—清除任何錶空間下的所有資源回收筒;
閃回時間長度
select*from v$parameter wherename='undo_retention'--預設的為900秒
修改閃回保留時間長度
alter system setundo_retention=1800 scope=both;--sys使用者登入,修改保留時間長度為1800秒
注意:
1)對於表結構發生變化的表,無法閃回;
2)閃回表只能恢複表資料,不能恢複表上的約束及索引等對象;
3)若要找回建於表上的其他對象,查詢檢視user_recyclebin,且已經被重新命名了;
本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/