Thread: Why the dropped table not in recyclebin?


Permlink Replies: 14 - Pages: 1 - Last Post: Jun 15, 2008 9:14 AM Last Post By: Aman....
jetq

Posts: 923
Registered: 11/24/06
Why the dropped table not in recyclebin?
Posted: Jun 14, 2008 6:19 PM
Click to report abuse...   Click to reply to this thread Reply
Why the dropped table not lised in recyclebin? But listed in EM console.
I think it maybe a Oracle bug.

SQL> drop table jeff.job;
Table dropped.

SQL> select*from jeff.job;
select*from jeff.job
*
'ERROR at line 1:
ORA-00942: table or view does not exist.
SQL> show recyclebin;
But from the EM console, I can find the dropped table jeff.job and I get the recyclebin name from there.
SQL> flashback table "JEFF"."BIN$T6nzNsfaiAHgQAB/AQAkGA==$0" to before drop rename to "jeff.jobs";

Flashback complete.

Message was edited by:
frank.qian
Justin Cave

Posts: 24,001
Registered: 10/11/99
Re: Why the dropped table not in recyclebin?
Posted: Jun 14, 2008 6:26 PM   in response to: jetq in response to: jetq
Click to report abuse...   Click to reply to this thread Reply
What user are you logged in as? If you're not logged in as JEFF, you'd need to query DBA_RECYCLEBIN, not RECYCLEBIN.

Justin
Hans F

Posts: 710
Registered: 11/16/06
Re: Why the dropped table not in recyclebin?
Posted: Jun 14, 2008 8:15 PM   in response to: jetq in response to: jetq
Click to report abuse...   Click to reply to this thread Reply
Why the dropped table not lised in recyclebin? But
listed in EM console.
I think it maybe a Oracle bug.

I doubt it. I suspect a pebcak but no bug. You may wish to review:

1) the appropriate documentation at http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#sthref2380 and http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12041.htm#i2699447
2) the userid you are using when doing this.


SQL> drop table jeff.job;
Table dropped.

SQL> select*from jeff.job;
select*from jeff.job
*

ORA-00942: table or view does not exist.
SQL> show recyclebin;


Remember that SHOW is a SQLPlus command, not a SQL command. You need to look at the SQLPlus manual for the SHOW command, and you might note that SHOW RECYCLEBIN
is designated for the USER_RECYCLEBIN, not the DBA_ one

But from the EM console, I can find the dropped table
jeff.job and I get the recyclebin name from there.
SQL> flashback table
"JEFF"."BIN$T6nzNsfaiAHgQAB/AQAkGA==$0" to before
drop rename to "jeff.jobs";
jetq

Posts: 923
Registered: 11/24/06
Re: Why the dropped table not in recyclebin?
Posted: Jun 14, 2008 9:02 PM   in response to: Justin Cave in response to: Justin Cave
Click to report abuse...   Click to reply to this thread Reply
I login as sysdba.
Justin Cave

Posts: 24,001
Registered: 10/11/99
Re: Why the dropped table not in recyclebin?
Posted: Jun 14, 2008 9:47 PM   in response to: jetq in response to: jetq
Click to report abuse...   Click to reply to this thread Reply
Then you'd have to query DBA_RECYCLEBIN, not RECYCLEBIN. As Hans points out, SHOW RECYCLEBIN shows the contents of USER_RECYCLEBIN, which only shows you the dropped objects that were owned by the current user.

Additionally, testing recyclebin functionality using the SYS account (SYSDBA is a role, not a user) is probably an error-- objects owned by SYS don't show up in the recyclebin.

Justin
Hans F

Posts: 710
Registered: 11/16/06
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 5:43 AM   in response to: jetq in response to: jetq
Click to report abuse...   Click to reply to this thread Reply
I login as sysdba.

Logging in to user SYS, or to another userid which has sysdba capability?
John Carew

Posts: 1,614
Registered: 06/13/07
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 6:29 AM   in response to: Justin Cave in response to: Justin Cave
Click to report abuse...   Click to reply to this thread Reply
so,dropping table by sys account bypasses recyclebin and directly deleted.
Is it true?
Aman....

Posts: 8,910
Registered: 05/20/01
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 6:37 AM   in response to: John Carew in response to: John Carew
Click to report abuse...   Click to reply to this thread Reply

so,dropping table by sys account bypasses recyclebin and directly deleted.
Is it true?

No its not true.Objects dropped by sys or any user will go in recyclebin provided they are not stored in the system tablespace.If the object is a part of the system tablespace,it wont come under recyclebin and is immediately.Mostly all the objects of Sys are in system tablespace only so it appears that sys's objects don't go inrecyclebin.But the key point is the tablespace not the schema.
Aman....
John Carew

Posts: 1,614
Registered: 06/13/07
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 7:59 AM   in response to: Aman.... in response to: Aman....
Click to report abuse...   Click to reply to this thread Reply
I made a test.
if I create table by user sys, which belongs system tablespace, when I drop it, there is nothing in recyclebin.it is directly deleted.
Paul M.

Posts: 8,657
Registered: 12/26/02
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 8:14 AM   in response to: John Carew in response to: John Carew
Click to report abuse...   Click to reply to this thread Reply
Aman is right :
SYS@db102 > create table foo(a number);

Table created.

SYS@db102 > drop table foo;

Table dropped.

SYS@db102 > sho recyclebin
SYS@db102 > create table foo(a number) tablespace users;

Table created.

SYS@db102 > drop table foo;

Table dropped.

SYS@db102 > sho recyclebin
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME

------------------------------
-------------------
FOO BIN$T7XU+MRoGBfgQAB/AQB4KA==$0 TABLE 2008-06-15:17:11:51
SYS@db102 >
N. Gasparotto

Posts: 18,604
Registered: 08/22/02
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 8:19 AM   in response to: John Carew in response to: John Carew
Click to report abuse...   Click to reply to this thread Reply
Or why do not put user's objects into the SYSTEM tablespace :
SQL> show user
USER is "SCOTT"
SQL> sho recyclebin
SQL> create table foo(a number) tablespace system;

Table created.

SQL> drop table foo;

Table dropped.

SQL> sho recyclebin
SQL> create table foo(a number) tablespace users;

Table created.

SQL> drop table foo;

Table dropped.

SQL> sho recyclebin
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME

------------------------------
-------------------
FOO BIN$4lSCQj3kR1ejQ0STqEJ/BA==$0 TABLE 2008-06-15:17:19:08
SQL>

Nicolas.

Thanks to Paul for the table's name ;-)
And good luck for Tuesday evening !
Message was edited by:
N. Gasparotto
Paul M.

Posts: 8,657
Registered: 12/26/02
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 8:43 AM   in response to: N. Gasparotto in response to: N. Gasparotto
Click to report abuse...   Click to reply to this thread Reply
And good luck for Tuesday evening !

Thanks Nicolas, and you too...:-)

...but it could be useless...
Aman....

Posts: 8,910
Registered: 05/20/01
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 8:47 AM   in response to: John Carew in response to: John Carew
Click to report abuse...   Click to reply to this thread Reply

if I create table by user sys, which belongs system tablespace, when I drop it, there is nothing in recyclebin.it is directly deleted.

Well I guess that's what I said in my reply,Paul and Nicolas demonstrated.
Hope you are clear now.
Aman....
John Carew

Posts: 1,614
Registered: 06/13/07
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 9:10 AM   in response to: Aman.... in response to: Aman....
Click to report abuse...   Click to reply to this thread Reply
thanks a lot Aman, as usual you again helped me:)
Aman....

Posts: 8,910
Registered: 05/20/01
Re: Why the dropped table not in recyclebin?
Posted: Jun 15, 2008 9:14 AM   in response to: John Carew in response to: John Carew
Click to report abuse...   Click to reply to this thread Reply
Ricardinho,
Your welcome :).
Aman....
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums