ITPub博客

首页 > 数据库 > Oracle > 回收站浅谈

回收站浅谈

原创 Oracle 作者:roc_phoenix 时间:2016-03-22 10:36:55 0 删除 编辑
17:57:58 sys@RODMAN>show parameter recycle


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
buffer_pool_recycle                  string
db_recycle_cache_size                big integer 0
recyclebin                           string      on
18:01:56 sys@RODMAN>show recyclebin
18:02:04 sys@RODMAN>select count(*) from  dba_recyclebin;


  COUNT(*)
----------
         3
18:03:13 sys@RODMAN>set line 1000
18:03:02 sys@RODMAN>SELECT OWNER,OBJECT_NAME,ORIGINAL_NAME,DROPTIME FROM dba_recyclebin;
OWNER                          OBJECT_NAME                    ORIGINAL_NAME                    DROPTIME
------------------------------ ------------------------------ -------------------------------- -------------------
MDSYS                          BIN$KXgne1aMKo/gU2U4qMCPsA==$0 SDO_FEATURE_USAGE                2016-01-17:01:52:17
MDSYS                          BIN$KXgne1aLKo/gU2U4qMCPsA==$0 SDO_FEATURE_USAGE_UPDATE         2016-01-17:01:52:17
MDSYS                          BIN$KXgne1aKKo/gU2U4qMCPsA==$0 SYS_C004934                      2016-01-17:01:52:17

恢复表:
18:08:23 sys@RODMAN>conn rodman/rodman
Connected.
18:08:35 rodman@RODMAN>select * from tab;


TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
T                              TABLE


18:08:40 rodman@RODMAN>drop table t;


Table dropped.


18:08:52 rodman@RODMAN>set line 1000
18:09:07 rodman@RODMAN>SELECT OWNER,OBJECT_NAME,ORIGINAL_NAME,DROPTIME FROM dba_recyclebin;


OWNER                          OBJECT_NAME                    ORIGINAL_NAME                    DROPTIME
------------------------------ ------------------------------ -------------------------------- -------------------
MDSYS                          BIN$KXgne1aMKo/gU2U4qMCPsA==$0 SDO_FEATURE_USAGE                2016-01-17:01:52:17
MDSYS                          BIN$KXgne1aLKo/gU2U4qMCPsA==$0 SDO_FEATURE_USAGE_UPDATE         2016-01-17:01:52:17
MDSYS                          BIN$KXgne1aKKo/gU2U4qMCPsA==$0 SYS_C004934                      2016-01-17:01:52:17
RODMAN                         BIN$Lo1ImOROHZHgU2U4qMD8eA==$0 T                                2016-03-21:18:08:51
RODMAN                         BIN$Lo1ImORNHZHgU2U4qMD8eA==$0 INDEX_T                          2016-03-21:18:08:51


18:09:12 rodman@RODMAN>flashback table t to before drop;


Flashback complete.


18:09:44 rodman@RODMAN>SELECT OWNER,OBJECT_NAME,ORIGINAL_NAME,DROPTIME FROM dba_recyclebin;


OWNER                          OBJECT_NAME                    ORIGINAL_NAME                    DROPTIME
------------------------------ ------------------------------ -------------------------------- -------------------
MDSYS                          BIN$KXgne1aMKo/gU2U4qMCPsA==$0 SDO_FEATURE_USAGE                2016-01-17:01:52:17
MDSYS                          BIN$KXgne1aLKo/gU2U4qMCPsA==$0 SDO_FEATURE_USAGE_UPDATE         2016-01-17:01:52:17
MDSYS                          BIN$KXgne1aKKo/gU2U4qMCPsA==$0 SYS_C004934                      2016-01-17:01:52:17


18:09:57 rodman@RODMAN>select count(*) from t;


  COUNT(*)
----------
     80784
     
清空回收站     
18:11:39 rodman@RODMAN>select * from recyclebin;


no rows selected


18:11:58 rodman@RODMAN>purge recyclebin;


Recyclebin purged.     
     
18:12:48 rodman@RODMAN>conn / as sysdba
Connected.
18:13:20 sys@RODMAN>select count(*) from dba_recyclebin;


  COUNT(*)
----------
         3


18:13:32 sys@RODMAN>purge dba_recyclebin;


DBA Recyclebin purged.


18:13:39 sys@RODMAN>select count(*) from dba_recyclebin;


  COUNT(*)
----------
         0

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

上一篇: 字符集查询
下一篇: 大表删除数据
请登录后发表评论 登录
全部评论

注册时间:2015-09-18

  • 博文量
    48
  • 访问量
    126265