Oracle 11g闪回flashback(2)


SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------使用上面的系统包必须赋予权限:grant execute on dbms_flashback to hr;
                3115836


SQL>
SQL> insert into student values(1,'zhangsan',23);
1 row inserted


SQL> commit;
Commit complete


SQL>  select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;
TO_CHAR(SYSDATE,'YYYYMMDDHH24:
------------------------------
20150124 19:51:36


SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
                3115938


SQL> update student s set s.name='wangwu' where s.id = 1;
1 row updated


SQL> commit;
Commit complete


SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
                3115954


SQL>  select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;
TO_CHAR(SYSDATE,'YYYYMMDDHH24:
------------------------------
20150124 19:52:26


SQL> insert into student values (2,'mazi',24);
1 row inserted


SQL> commit;
Commit complete


SQL>  select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;
TO_CHAR(SYSDATE,'YYYYMMDDHH24:
------------------------------
20150124 19:52:58


SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
                3116062


SQL>
SQL> select  versions_starttime,versions_endtime,versions_xid,versions_operation,id,name,age from student
  2  versions between scn minvalue and maxvalue;
VERSIONS_STARTTIME                                              VERSIONS_ENDTIME                                                  VERSIONS_XID VERSIONS_OPERATION          ID NAME                    AGE
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ---------------- ------------------ ----------- -------------------- -----------
24-1月 -15 07.52.54 下午                                                                                                                          0B00080005010000 I                            2 mazi                      24
24-1月 -15 07.52.15 下午                                                                                                                          13000100FE000000 U                          1 wangwu                  23
24-1月 -15 07.51.29 下午                                          24-1月 -15 07.52.15 下午                                          12001F00FF000000 I                            1 zhangsan                23

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/647f086b6eb914738c7dda51df50b04b.html