oracle 10G数据闪回的用法:
(1)创建闪回用户查询
登陆sys用户
创建用户
SQL>create user test identified by test;
赋值闪回权限
SQL>grant execute on dbms_flashback to test;
连接test
SQL>conn test/test;
启动行移动功能
SQL>alter table test enable row movement;
(2)创建测试表,插入测试记录
SQL>create table test(id number);
SQL>insert into test values (1);
SQL>insert into test values (2);
SQL>commit;
SQL>delete test;
(3)执行闪回操作
SQL>flashback table test to timestamp to_timestamp('2010-09-23 19:30:30','yyyy-mm-dd hh24:mi:ss');
SQL>select * from test;
ID
----
2
(4)如果执行其他操作
SQL> execute dbms_flashback.disable;
第二种方法参考同事的方法
SELECT * FROM TEST;
select dbms_flashback.get_system_change_number from dual;
查找时间点
select count(*) from test;
delete from test;
commit;
select count(*) from tEST as of scn 11278446510035;
select count(*) from tEST as of scn 11278446510000;
查找上面两个时间点之间的数据insert into test select * from test as of scn 11278446510000;select * from test;