1.验证在未启用闪回功能的情况下回收站功能也可以使用
1)确认当前数据库版本为10.2.0.3
sys@ora10g> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
sys@ora10g> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
2)确认数据库为启用闪回功能
sys@ora10g> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
3)模拟删除sec用户下的t表,并使用回收站恢复之
(1)创建测试表T
sec@ora10g> create table t as select * from all_objects;
Table created.
(2)drop之前的确认
sec@ora10g> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
T TABLE
sec@ora10g> select OBJECT_NAME,ORIGINAL_NAME,OPERATION from user_recyclebin;
OBJECT_NAME ORIGINAL_NAME OPERATION
------------------------------ -------------------------------- ---------
BIN$hHoZrihpVOPgQAB/AQBsWg==$0 T DROP
(5)恢复被drop的表T
sec@ora10g> flashback table t to before drop;
Flashback complete.
sec@ora10g> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
T TABLE
OK,到此我们已经验证在闪回功能为开启的情况下我们依然可以对误drop的表进行闪回恢复。
2.决定回收站功能启用与否的因素
其实在Oracle 10gR2版本中,回收站是否启用是由“recyclebin”参数来控制的。
默认情况下,这个参数是启用的(on)。
sys@ora10g> show parameter recyclebin
NAME TYPE VALUE
--------------- -------------------- ----------
recyclebin string on
Oracle官方文档中的描述信息参考:
链接:http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams175.htm#REFRN10264
RECYCLEBIN is used to control whether the Flashback Drop capability is turned on or off. If the parameter is set to OFF, then dropped tables do not go into the recycle bin. If this parameter is set to ON, dropped tablesgo into the recycle bin and can be recovered.