|
> sec@ora10g> alter session set recyclebin=off;
In 10g, that will turn off other sessions' recyclebin as well. See Note.444032.1 (Ext/Mod "Alter Session Set Recyclebin=Off" Seems To Impact Other Sessions). Although it doesn't mention workaround, all you need to do is use "alter system" to set it to on, or even "alter session", to take advantage of this bug.
Since the note mentions an SGA variable, I checked its value in SGA. Test in 10.2.0.4.
SQL> oradebug setmypid
Statement processed.
SQL> oradebug dumpvar sga kd_recyclebin
ub4 KD_RECYCLEBIN_ [060020060, 060020064) = 00000001
SQL> alter session set recyclebin = off;
Session altered.
SQL> oradebug dumpvar sga kd_recyclebin
ub4 KD_RECYCLEBIN_ [060020060, 060020064) = 00000000
SQL> show parameter recyclebin
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
recyclebin string OFF
This session's recyclebin is indeed OFF. But the problem is that the SGA variable kd_recyclebin is also off. So open a new session to this database:
sqlplus yhuang@mydb
...
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
...
SQL> show parameter recyclebin
NAME TYPE VALUE
------------------------------------ ----------- -----
recyclebin string on
SQL> create table testdrop (x int);
Table created.
SQL> drop table testdrop;
Table dropped.
SQL> flashback table testdrop to before drop;
flashback table testdrop to before drop
*
ERROR at line 1:
ORA-38305: object not in RECYCLE BIN
If I now alter session set recyclebin = on, even in the first session, this second session can un-drop a dropped table now.
Note that kd_recyclebin is an SGA variable; if you log into another session, you can see its current value as well. (To use oradebug, you have to login as sys.) The value in v$parameter (or show parameter) or v$system_parameter for recyclebin is "ON", instead of "on", although isdefault is still TRUE.
The problem does not occur in 11g. Also, the SGA variable no longer exists in 11g.
Yong Huang
[ 本帖最后由 Yong Huang 于 2010-4-26 07:57 编辑 ] |
|