Home » Purge the RECYCLEBIN in Oracle

Purge the RECYCLEBIN in Oracle

by tuanlp

 

Purge the RECYCLEBIN in Oracle

RECYCLEBIN feature is enabled by default. It is used for the recover purpose if you table is dropped accidentally.

Check the table present in Recyclebin of Oracle

select object_name, original_name, type, can_undrop as "UND", can_purge as "PUR", droptime from recyclebin;

OBJECT_NAME                    ORIGINAL_NAME TYPE  UND PUR DROPTIME
------------------------------ ------------- ----- --- -------------------
BIN#JWva26/9xEPgPRaW/qQoRw==$0 TEST          TABLE YES YES 2019-12-24:17:26:13

Check table present with other commands in recyclebin

-- From current session:
Show recyclebin

select * from user_recyclebin;

--From SYSDBA user
Select * from dba_recyclebin;

Purge the recyclebin from current session

--Remove only one object from current user:
PURGE TABLE test;

-- Remove all objects from current user:
PURGE RECYCLEBIN;

Purge all dropped object from recycle-bin for all user with SYSDBA

PURGE DBA_RECYCLEBIN;

Drop command with Purge so that object not move to recycle-bin

DROP table TEST purge;


You may also like