4.对DML操作的闪回查询
a.测试
- SQL> create table t as select * from dba_users;
Table created.
- SQL> select count(*) from dba_users;
COUNT(*)
----------
22
22 rows deleted.
- SQL> select count(*) from t;
COUNT(*)
----------
0
- SQL> select dbms_flashback.get_system_change_number from dual;
select dbms_flashback.get_system_change_number from dual
*
ERROR at line 1:
ORA-00904: : invalid identifier
- SQL> conn sys/sys as sysdba
Connected.
- SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
1388195
- SQL> select count(*) from t as of scn 1388190;
select count(*) from t as of scn 1388190
*
ERROR at line 1:
ORA-00942: table or view does not exist
- SQL> select count(*) from t as of scn 1388193;
COUNT(*)
----------
0
- SQL> select count(*) from t as of scn 1388190;
COUNT(*)
----------
22
--在scn 1388190的时刻数据都还在。
- SQL> insert into t select * from t as of scn 1388190;
22 rows created.
- SQL> select count(*) from t;
COUNT(*)
----------
22
阅读(1310) | 评论(0) | 转发(1) |