Oracle數據錯刪找回

---如果delete錯了,通過以下方法可以找回數據
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
select * from tableA as of timestamp to_timestamp('2020-09-23 21:25:00','yyyy-mm-dd hh24:mi:ss');

create table tableA _temp   as select * from tableA as of timestamp to_timestamp('2020-09-23 21:20:00','yyyy-mm-dd hh24:mi:ss');

就可以將那個時間點的數據都找到,於是比對出錯刪的數據。

 

 

 

 

 

如果直接想要恢復

flashback table 表名 to timestamp to_timestamp('2016-08-11 16:12:11','yyyy-mm-dd hh24:mi:ss');

但是也可能會出現問題,比如報錯:ORA-08189:未啓用行移動功能,不能閃回表;

alter table 表名 enable row movement; 即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章