小菜鸟今天不小心update时更新了数据库所有数据,提交后才发现。
1.首先获取最后一次DML的时间:
select max(ora_rowscn),to_char(scn_to_timestamp(max(ora_rowscn)),'yyyy-mm-dd hh24:mi:ss') from 表名;
2.拷贝一份这张表:
create table 表名_recove as select * from 表名
as of timestamp to_timestamp('2018-04-17 12:43:08','yyyy-mm-dd hh24:mi:ss');
3.将拷贝的表的值复制进原来表中就可以啦
delete from 原表
insert into 原表 select * from 原表_recove ;
应该还有更好的办法,请多指教。。