ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle 闪回查询

oracle 闪回查询

原创 Linux操作系统 作者:paulyibinyi 时间:2008-02-21 10:57:12 0 删除 编辑

C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Thu Feb 21 10:53:55 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> select * from test;

no rows selected

SQL> insert into test values(100);

1 row created.

SQL> commit;

Commit complete.

SQL> select dbms_flashback.get_system_change_number SCN from dual;

       SCN
----------
   3251266

SQL> update test set id=200;

1 row updated.

SQL> update test set id=300;

1 row updated.

SQL> update test set id=400;

1 row updated.

SQL> update test set id=500;

1 row updated.

SQL> commit;

Commit complete.

SQL> select id from test;

        ID
----------
       500

SQL> select dbms_flashback.get_system_change_number SCN from dual;

       SCN
----------
   3251287

--回到原来状态

SQL> select id from test as of scn 3251266
  2  ;

        ID
----------
       100

SQL>

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7199859/viewspace-179722/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
学习数据库

注册时间:2007-12-11

  • 博文量
    907
  • 访问量
    6894417