oracle 閃回查詢

paulyibinyi發表於2008-02-21

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部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-179722/,如需轉載,請註明出處,否則將追究法律責任。

相關文章