Show recycle is not showing anything in Oracle

Enabled Recycle bin is not showing anything in Oracle

Reason for showing the recyclebin empty is you are able to login with SYS user and using the SYSTEM tablespace. So that it show recycle bin empty.

Check Recycle Bin is enabled

SQL> show parameter recyclebin
NAME		     TYPE	 VALUE
-------------------- ----------- ------------
recyclebin	     string	 on

I am login with the sys user that why its not capturing the result as we are using system tables with SYS user. We can see the example below by connecting with SYS user:

Note: Please connect with Normal user to avoid this error.

SQL> show user 
USER is "SYS"
SQL> create table test (id number);

Table created.

SQL> insert into test values ( 1);

1 row created.

SQL> insert into test values (2);

1 row created.

SQL> commit;

Commit complete.

SQL> drop table test;

Table dropped.

SQL> show recyclebin
SQL> 
SQL> 

Now connect with Normal user SCOTT and show the example again for Recyclebin usage:

SQL> show pdbs;
    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  MOUNTED
	 3 PDB1 			  READ WRITE NO
SQL> conn scott@pdb1
Enter password: 
Connected.

SQL> create table test (id number);
Table created.

SQL> insert into test values (1);
1 row created.

SQL> insert into test values (2);
1 row created.

SQL> commit;
Commit complete.

SQL> drop table test;
Table dropped.

SQL> show recyclebin;
ORIGINAL NAME RECYCLEBIN NAME		     OBJECT TYPE DROP TIME
------------- ------------------------------ ----------- ----------------
TEST	      BIN$Fh1VKrueZFngYw8CAAq+WA==$0 TABLE	 2024-04-15:11:30:03

Leave a Reply