How to Drop All Tables in Your Tablespace in Oracle

Sometimes, you will have to drop all tables in your Tablespace in the Oracle database. In such cases, here is an easy way to do it.

Run the following command:

select 'drop table ', table_name, 'cascade constraints;' from user_tables;

The above SQL command will return scripts to drop tables existing in your Oracle database tablespace.

Copy the output of the above SQL command as a script and run it.

Doing so will drop all of your tables in your tablespace.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *