purge keyword in Oracle

1. Three ways to delete a table

     drop table
      truncate table 
drop table tableName purge; This is to delete directly without entering the recycle bin    

2. Purpose of purge

Clears the tables and indexes in the oracle recycle bin (recyclebin) and frees the space associated with them. You can also empty the recycle bin or clear the deleted part of the table space recorded in the table space.
      Note: You cannot rollback and restore after purge.

3. The syntax of purge


4.   Examples

1) Check the Recycle Bin

select * from RECYCLEBIN;

2)PURGE TABLE recycle_tmp;

The oldest version is deleted by default.

3) Clear the table according to the recycle bin OBJECT_NAME

SELECT object_name, original_name, operation, droptime FROM RECYCLEBIN;  

purge table "BIN$34btciE8RySPmHqIlCGnVg==$0";

4) Use flashback

FLASHBACK TABLE recycle_tmp TO BEFORE DROP;

Empty the recycle bin directly



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325723777&siteId=291194637