flashback version query and flashback transaction query exam
时间:2011-03-22 来源:cbso520
结合闪回版本查询和闪回事务查询完成对某个事务修改数据的恢复.例子,
SQL> insert into zdry.test values(8,'uestc');
已创建 1 行。
SQL> commit;
提交完成。
SQL> select versions_xid from zdry.test versions between timestamp sysdate-2/1440 and sysdate;
VERSIONS_XID
----------------
09000F00CF020000
已选择7行。
SQL> select undo_sql from flashback_transaction_query where xid='09000F00CF020000';
UNDO_SQL
--------------------------------------------------------------------------------
delete from "ZDRY"."TEST" where ROWID = 'AAAOQ6AAGAAAAutAAA';
SQL> select * from zdry.test where ROWID = 'AAAOQ6AAGAAAAutAAA';
ID NAME
---------- --------------------
8 uestc
SQL> select * from zdry.test;
ID NAME
---------- --------------------
2 jack
1 jerry
3 andy
4 lau
5 jkk
6 test6
8 uestc
已选择7行。
SQL> delete from "ZDRY"."TEST" where ROWID = 'AAAOQ6AAGAAAAutAAA';
已删除 1 行。
SQL> commit;
提交完成。
SQL> select * from zdry.test;
ID NAME
---------- --------------------
2 jack
1 jerry
3 andy
4 lau
5 jkk
6 test6
已选择6行。
SQL> spool off;