首页 > 数据库 > Oracle > Oracle 11g 闪回版本查询
|
--多次对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/ ,如需转载,请注明出处,否则将追究法律责任。