Oracle: Select all Tables in your Schema and generate DROP TABLE Statement


It is always the same, if you want to clean up a test database, you need to drop all tables from the schema.

I do this like that way:

select CONCAT(CONCAT('drop table "', object_name), '" cascade constraints;') from user_objects where object_type = 'TABLE';

Then you’ll get a nice list with all tables, copy and paste it, for example in your SQL Developer, run it and all Tables are dropped.

Easy peasy 🙂