oracle数据闪回举例
oracle数据闪回举例
表test0108 如图:

删除clinic_code ='49342' 的两条数据
delete test0108 where clinic_Code ='49342';-- 删时间点为:2018-01-08 13:50:00;
一、闪回查询 (时间在删除时间点之前)
删除clinic_code ='49342' 的两条数据
delete test0108 where clinic_Code ='49342';-- 删时间点为:2018-01-08 13:50:00;
语法:select * from 表名 as of timestamp to_timestamp('2018-01-08 13:30:00','yyyy-mm-dd hh24:mi:ss');-- 可以查询到 删除的数据
二、闪回表
alter table 表名 enable row movement;-- 修改成允许行移动
flashback table 表名 to timestamp to_timestamp('2018-01-08 13:30:00','yyyy-mm-dd hh24:mi:ss'); --恢复数据
执行到这里的时候 ,数据已经恢复成功
http://www.itemperor.com/a/SQL/227.html
原文链接:http://www.jxszl.com/biancheng/shujuku/445619.html