oralce 闪回

给你一囗甜甜゛ 提交于 2019-12-03 18:14:13


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"

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!