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; 即可

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