update commit后找回update前数据
update commit后找回update前数据
t_sys_client1.首先创建临时表
[sql]
- create table tmp as select * from t_sys_client where 1=0;
[sql]
- insert into tmp select * from t_sys_client as of timestamp sysdate-10/1440; --10分钟之前的数据
这时候临时就是你以前的表了,可以用 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 恢复的
评论暂时关闭