ITPub博客

首页 > 数据库 > Oracle > 开闪回后recyclebin里没有drop的表

开闪回后recyclebin里没有drop的表

原创 Oracle 作者:fei890910 时间:2014-05-07 20:09:25 0 删除 编辑


一,查看数据库是否开闪回
SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
YES
二,非system用户下删除一张表,并查看recyclebin 不存在emp2表

SQL> conn scott/oracle
Connected.
SQL> drop table emp2;

Table dropped.
SQL> show recyclebin;
ORIGINAL NAME    RECYCLEBIN NAME                OBJECT TYPE  DROP TIME
---------------- ------------------------------ ------------ -------------------
IDX_SPLIT        BIN$65gSaUQEyzzgQAB/AQARNQ==$0 TABLE        2013-11-20:15:53:08
查看recyclebin状态为off 设置为on 报错

SQL> show parameter recyclebin

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
recyclebin                           string      OFF
SQL> alter system set recyclebin=on;
alter system set recyclebin=on
                             *
ERROR at line 1:
ORA-02096: specified initialization parameter is not modifiable with this
option
四,在语句中必须加deferred的参数

SQL> select name from v$parameter where issys_modifiable='DEFERRED';

NAME
--------------------------------------------------------------------------------
backup_tape_io_slaves
recyclebin
audit_file_dest
object_cache_optimal_size
object_cache_max_size_percent
sort_area_size
sort_area_retained_size
olap_page_pool_size

8 rows selected.

五,重新设置recyclebin为on

SQL> conn / as sysdba
Connected.
SQL> alter system set recyclebin=on deferred;

System altered.

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@node1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed May 7 20:09:04 2014

Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
六,删除emp2表,查看recyclebin看到emp2表在里面

SQL> conn scott/oracle
Connected.
SQL> drop table emp2;

Table dropped.

SQL> show recyclebin;
ORIGINAL NAME    RECYCLEBIN NAME                OBJECT TYPE  DROP TIME
---------------- ------------------------------ ------------ -------------------
EMP2             BIN$+M874r5kuCbgQAB/AQAPNQ==$0 TABLE        2014-05-07:20:09:18
IDX_SPLIT        BIN$65gSaUQEyzzgQAB/AQARNQ==$0 TABLE        2013-11-20:15:53:08


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

请登录后发表评论 登录
全部评论

注册时间:2013-08-15

  • 博文量
    122
  • 访问量
    811206