Purge the RECYCLEBIN in Oracle

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;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.