Oracle 11g 閃回版本查詢

LuiseDalian發表於2014-05-05

--多次對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部落格 ” ,連結:http://blog.itpub.net/17013648/viewspace-1153859/,如需轉載,請註明出處,否則將追究法律責任。

相關文章