How To Empty Your Recycle Bin?
SQL tutorial | Interview questions | Oracle :: Interview questions :: Oracle DBA Interview questions
Page 1 of 1
How To Empty Your Recycle Bin?
If 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/fyicenter
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
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/fyicenter
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
Similar topics
» What Is a Recycle Bin?
» What Is a Recycle Bin?
» How To Turn On or Off Recycle Bin for the Instance?
» How To Turn On or Off Recycle Bin for the Session?
» How To View the Dropped Tables in Your Recycle Bin?
» What Is a Recycle Bin?
» How To Turn On or Off Recycle Bin for the Instance?
» How To Turn On or Off Recycle Bin for the Session?
» How To View the Dropped Tables in Your Recycle Bin?
SQL tutorial | Interview questions | Oracle :: Interview questions :: Oracle DBA Interview questions
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Sun Jan 31, 2010 12:35 am by Micheal
» Accessing tables of other users in SQL
Sun Jan 31, 2010 12:34 am by Micheal
» Grouping commands in SQL
Sun Jan 31, 2010 12:32 am by Micheal
» Operations on Result Sets in SQL
Sun Jan 31, 2010 12:31 am by Micheal
» Subqueries in SQL
Sun Jan 31, 2010 12:30 am by Micheal
» Joining Relations in SQL
Sun Jan 31, 2010 12:28 am by Micheal
» Delete comand in SQL
Sun Jan 31, 2010 12:27 am by Micheal
» Update command in SQL
Sun Jan 31, 2010 12:26 am by Micheal
» Insert command in SQL
Sun Jan 31, 2010 12:23 am by Micheal