oracle闪回查询

Oracle数据库有时候不小心删除掉数据,想查询这些数据,或者恢复数据,就可以使用带有as of子句的select语句进行闪回查询。

闪回查询过去某个时间段的数据

select * from tb
as of timestamp to_timestamp('2017-11-07 08:50:00', 'yyyy-mm-dd hh:mi:ss')
where code = '001';

闪回恢复

insert into tb(
select * from tb
as of timestamp to_timestamp('2017-11-07 08:50:00', 'yyyy-mm-dd hh:mi:ss')
where code = '001'
);
原文地址:https://www.cnblogs.com/gdjlc/p/7797510.html