table of Contents
In Oracle, there is also a recycle bin, that is drop table table_name
, the table will not be completely deleted through ordinary commands , but all the information of the table will be migrated to the recycle bin for storage, and there is no real deletion to free up space.
Ordinary delete table
Delete the table with constraints
drop table table_name cascade constraints;
Delete the table completely
If you want to completely delete the table to free up space, you can delete it by adding the keyword purge
drop table table_name purge;
Check the recycle bin and the situation recycle bin
Check the status of the recycle bin
select * from recyclebin;
Clean up the specified table in the recycle bin
purge table "table_name";
Clean up the entire recycle bin
purge recyclebin;
Restore the normally deleted table from the recycle bin
Recover deleted tables from the recycle bin
flashback table table_name to before drop;
Restore and rename the table deleted from the recycle bin
flashback table old_table_name to before drop rename to new_table_name;