ITPub博客

首页 > 数据库 > Oracle > Oracle 11g 闪回版本查询

Oracle 11g 闪回版本查询

原创 Oracle 作者:LuiseDalian 时间:2014-05-05 07:18:14 0 删除 编辑

--多次对40号部门进行修改

scott@TESTDB11>update dept set loc = 'LocE' where deptno = 40;

 

1 row updated.

 

scott@TESTDB11>commit;

 

Commit complete.

 

scott@TESTDB11>update dept set loc = 'LocF' where deptno = 40;

 

1 row updated.

 

scott@TESTDB11>commit;

 

Commit complete.

 

scott@TESTDB11>update dept set loc = 'LocG' where deptno = 40;

 

1 row updated.

 

scott@TESTDB11>commit;

 

Commit complete.

 

--闪回版本查询

scott@TESTDB11>select * from dept

  2  versions between timestamp (systimestamp - interval '15' minute)  and maxvalue;

 

    DEPTNO DNAME          LOC

---------- -------------- -------------

        40 OPERATIONS     LocG

        40 OPERATIONS     LocF

        40 OPERATIONS     LocE

        10 ACCOUNTING     NEW YORK

        20 RESEARCH       DALLAS

        30 SALES          CHICAGO

        40 OPERATIONS     LocD

 

7 rows selected.

 

--只查看40号部门的变化

scott@TESTDB11>select * from dept

  2  versions between timestamp (systimestamp - interval '15' minute)  and maxvalue

  3  where deptno = 40;

 

    DEPTNO DNAME          LOC

---------- -------------- -------------

        40 OPERATIONS     LocG

        40 OPERATIONS     LocF

        40 OPERATIONS     LocE

        40 OPERATIONS     LocD

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

请登录后发表评论 登录
全部评论

注册时间:2012-02-06

  • 博文量
    1986
  • 访问量
    6040880