ITPub博客

首页 > 数字化转型 > ERP > Flashback transaction 的内容是否须commit

Flashback transaction 的内容是否须commit

原创 ERP 作者:kl911 时间:2007-09-20 23:19:56 0 删除 编辑

答案是否定的,不管怎样只要块的改变记录在undo segment里面,该动作就会作为flashback transaction的候选人:

conn hr/hr;

create table t1 as select employee_id, salary from employees;

delete t1 where employees=197;

commit;

delete t1 where employees=196;

(without commit)

SQL> select operation,undo_sql,table_name from flashback_transaction_query
2 where table_name='T1';

OPERATION
--------------------------------
UNDO_SQL
----------------------------------------------------------------------------
TABLE_NAME
----------------------------------------------------------------------------
DELETE
insert into "HR"."T1"("EMPLOYEE_ID","SALARY") values ('196','3100');
T1

DELETE
insert into "HR"."T1"("EMPLOYEE_ID","SALARY") values ('197','3000');
T1


(现在看到了结果,不管是否提交,只要undo里面记录了,就会显示出来)

rollback;

SQL> select operation,undo_sql,table_name from flashback_transaction_query
2 where table_name='T1';

OPERATION
--------------------------------
UNDO_SQL
---------------------------------------------------------------------------
TABLE_NAME
---------------------------------------------------------------------------
DELETE
insert into "HR"."T1"("EMPLOYEE_ID","SALARY") values ('197','3000');
T1


闪回事务查询的测试和验证,结果为是否commit,对查询结果没有影响;

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/661919/viewspace-970534/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 第一桶金
下一篇: 新的规划
请登录后发表评论 登录
全部评论

注册时间:2008-01-03

  • 博文量
    20
  • 访问量
    318355