update commit后找回update前数据


t_sys_client 

1.首先创建临时表
[sql]
  1. create table tmp as  select * from t_sys_client  where 1=0;  
2. 将查询的记录插入到 临时表
[sql]
  1. insert into tmp select * from t_sys_client  as of timestamp sysdate-10/1440;    --10分钟之前的数据  
select * from t2 as of timestamp sysdate-1/1440         -->  1 代表 1分钟前,改成5 代表 5分钟前
这时候临时就是你以前的表了,可以用 where 。   但是,如果十分钟之内,我对t_sys_client 的那一条记录update了两次,这时tmp表中的,就只有最近一次update的历史记录了。要知道这个历史记录上一次的记录,

那就在建立一张临时表

insert into tmp1 select * from t_sys_client  as of timestamp sysdate-10/1440   

这就需要那大概知道 第二个 update 时间了  

指定精准时间
insert into tmp1  select * from t2 as of timestamp to_timestamp('2011-07-12 10:30:00', 'YYYY-MM-DD HH24:MI:SS');


  闪回是10g新特性,那么闪回可以关掉吗? 闪回分 表闪回和数据库闪回,

数据库闪回默认是关闭的,需要手动开启

表闪回是通过 undo 闪回的,刚才的操作是通过 undo 恢复的

相关内容