闪回查询

闪回查询

查看是否开启了闪回:

Selectflashback_on from V$database;

SQL> select * from t1;

 

         A

----------

         8

         6

 

SQL> delete from t1 where t1.a =6;

commit;

select * from t1;

select * from t1 as of timestamp sysdate - 1/1440;

1 row deleted.

 

SQL>

Commit complete.

 

SQL>

         A

----------

         8

 

SQL>

 

         A

----------

         8

         6

SCN

SQL> select dbms_flashback.get_system_change_number   from dual;

 

GET_SYSTEM_CHANGE_NUMBER

------------------------

             1.3577E+10

 

SQL> selectdbms_flashback.get_system_change_number||''  from dual;

 

DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER|

----------------------------------------

13576873488

 

SQL> select * from t1;

 

         A

----------

         8

 

SQL> delete from t1 where t1.a =8;

commit;

select * from t1;

select * from t1 as of scn 13576873488

1 row deleted.

 

SQL>

Commit complete.

 

SQL>

no rows selected

 

SQL>

  2  ;

 

         A

----------

         8

 

As of 用来修饰表。

 

SQL> set linesize 3000;

SQL>

selecta,VERSIONS_STARTSCN,VERSIONS_STARTTIME,VERSIONS_ENDSCN,VERSIONS_ENDTIME,VERSIONS_OPERATION,VERSIONS_XIDfrom t1 versions between scn minvalue and maxvalue;SQL>

 

         AVERSIONS_STARTSCN VERSIONS_STARTTIME                                                         VERSIONS_ENDSCN VERSIONS_ENDTIME                                                                        V VERSIONS_XID

---------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------                     ----------- -----------------

         8        1.3577E+10 20-MAR-14 04.26.01 PM                                                                                                                                                               D 060018004F0A0000

         8                                                                                                    1.3577E+1020-MAR-14 04.26.01 PM

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值