What is the Recycle Bin?

The recycle bin is a data dictionary table containing information about dropped objects. Dropped tables and any associated objects such as indexes, constraints, nested tables, and the likes are not removed and still occupy space.
Enabling and Disabling the Recycle Bin
ALTER SESSION SET recyclebin = OFF;
ALTER SYSTEM SET recyclebin = OFF;
ALTER SESSION SET recyclebin = ON;
ALTER SYSTEM SET recyclebin = ON;
An example of recovery:
drop table SALARY2016;
select object_name,original_name,type,can_undrop as “undo”,can_purge as “PUR”, droptime
from dba_recyclebin where original_name like SALARY%’ order by droptime;
OBJECT_NAME ORIGINAL_NAME TYPE undo PUR DROPTIME
BIN$JZgAyoU+u1DgUxQVCApelQ==$0 SALARY2016 TABLE YES YES 2016-08-04:13:39:27
flashback table “BIN$JZgAyoU+u1DgUxQVCApelQ==$0” to before drop;
Restoring Dependent objects:
select index_name from dba_indexes where table_name=’SALARY2016’’;
INDEX_NAME
—————
BIN$JZgAyoU9u1DgUxQVCApelQ==$0
alter index “BIN$JZgAyoU9u1DgUxQVCApelQ==$0” rename to IDX_ID_PK;
Users can purge the recycle bin of their own objects, and release space for objects
PURGE RECYCLEBIN;

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *