sys@ORCL> variable scn number;
sys@ORCL> exec :scn :=dbms_flashback.get_system_change_number;
PL/SQL procedure successfully completed.
sys@ORCL> print scn;
SCN
----------
697882
sys@ORCL> select count(*) from big_table;
COUNT(*)
----------
10005
sys@ORCL> delete from big_table; --刪除數據
10005 rows deleted.
sys@ORCL> select count(*) from big_table; --檢測是否刪除
COUNT(*)
----------
0
sys@ORCL> select count(*) from big_table as of scn:scn;
COUNT(*)
----------
10005
sys@ORCL> commit; --跨事務
Commit complete.
sys@ORCL> select *
2 from (select count(*) from big_table),(select count(*) from big_table as of scn:scn)
3 /
COUNT(*) COUNT(*)
---------- ----------
0 10005
sys@ORCL> flashback table big_table to scn:scn;
flashback table big_table to scn:scn
*
ERROR at line 1:
ORA-08185: Flashback not supported for user SYS
sys@ORCL> show user;
USER is "SYS"
oralce 閃回
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.