How to Drop All Tables in Your Tablespace in Oracle

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;Code language: JavaScript (javascript)

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.

Leave a Reply

Discover more from BHUTAN IO

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top