The SQL PURGE statement is an Oracle-specific administrative command that irrevocably removes dropped database objects or entire recycle bins. When you issue a normal DROP, Oracle moves the object to the recycle bin so it can be restored with FLASHBACK. PURGE skips or empties that safety net and releases the space immediately. You can purge a single table, index, materialized view log, or an entire tablespace’s recycle bin. DBAs can also purge every user’s recycle bin with PURGE DBA_RECYCLEBIN. Once PURGE executes, the object’s metadata and data blocks are marked free and cannot be recovered with FLASHBACK TABLE or FLASHBACK DROP. Because the operation is permanent, Oracle requires the same privileges as DROP plus specific object ownership or the SYSTEM privilege DROP ANY. Use PURGE only when you are certain the object is no longer needed or when reclaiming space is urgent.
object_type
(STRING) - Required. TABLE, INDEX, TABLESPACE, RECYCLEBIN, or DBA_RECYCLEBIN indicating what to purge.object_name
(IDENTIFIER) - Name of the table, index, or tablespace to purge (not used with RECYCLEBIN or DBA_RECYCLEBIN).USER
(IDENTIFIER) - Optional when purging a tablespace; limits the operation to objects owned by a specific user.DROP, FLASHBACK TABLE, FLASHBACK DROP, RECYCLEBIN, TRUNCATE, PURGE BINARY LOGS
Oracle Database 10g Release 1 (2003)
Oracle purges the object from the current schema. Always fully qualify names when multiple schemas contain similarly named objects.
Yes. Oracle marks the data blocks as free so subsequent inserts or extensions can reuse them without waiting for space reclamation jobs.
DROP is usually faster because it only renames the object into the recycle bin. PURGE must update additional data dictionary tables to remove all metadata. Use DROP for quick removal and PURGE afterward if recovery is not needed.
No. Drop the foreign key or purge the referencing objects first. Otherwise Oracle raises ORA-00604/ORA-30501 dependency errors.