How To Empty Your Oracle Recycle Bin?
Submitted by: AdministratorIf your recycle bin is full, or you just want to clean your recycle bin to get rid of all the dropped tables, you can empty it by using the PURGE statement in two formats:
* PURGE RECYCLEBIN - Removes all dropped tables from your recycle bin.
* PURGE TABLE table_name - Removes the specified table from your recycle bin.
Here is an example script on how to use the PURGE statement:
SQL> connect HR/globalguideline
Connected.
SQL> CREATE TABLE emp_dept_10
2 AS SELECT * FROM employees WHERE department_id=10;
Table created.
SQL> DROP TABLE emp_dept_10;
Table dropped.
SQL> CREATE TABLE emp_dept_90
2 AS SELECT * FROM employees WHERE department_id=90;
Table created.
SQL> DROP TABLE emp_dept_90;
Table dropped.
SQL> SELECT COUNT(*) FROM recyclebin;
COUNT(*)
----------
5
SQL> PURGE TABLE emp_dept_90;
Table purged.
SQL> SELECT COUNT(*) FROM recyclebin;
COUNT(*)
----------
4
SQL> PURGE RECYCLEBIN;
Recyclebin purged.
SQL> SELECT COUNT(*) FROM recyclebin;
COUNT(*)
----------
0
Submitted by: Administrator
* PURGE RECYCLEBIN - Removes all dropped tables from your recycle bin.
* PURGE TABLE table_name - Removes the specified table from your recycle bin.
Here is an example script on how to use the PURGE statement:
SQL> connect HR/globalguideline
Connected.
SQL> CREATE TABLE emp_dept_10
2 AS SELECT * FROM employees WHERE department_id=10;
Table created.
SQL> DROP TABLE emp_dept_10;
Table dropped.
SQL> CREATE TABLE emp_dept_90
2 AS SELECT * FROM employees WHERE department_id=90;
Table created.
SQL> DROP TABLE emp_dept_90;
Table dropped.
SQL> SELECT COUNT(*) FROM recyclebin;
COUNT(*)
----------
5
SQL> PURGE TABLE emp_dept_90;
Table purged.
SQL> SELECT COUNT(*) FROM recyclebin;
COUNT(*)
----------
4
SQL> PURGE RECYCLEBIN;
Recyclebin purged.
SQL> SELECT COUNT(*) FROM recyclebin;
COUNT(*)
----------
0
Submitted by: Administrator
Read Online Oracle Database Job Interview Questions And Answers
Top Oracle Database Questions
☺ | What Is the Relation of a User Account and a Schema? |
☺ | How To Use Values from Other Tables in UPDATE Statements using Oracle? |
☺ | How To Recover a Dropped Table in Oracle? |
☺ | What Is Input Buffer in SQL*Plus? |
☺ | What Happens to Indexes If You Drop a Table? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Oracle RMAN Interview Questions. |