Loading...

Delete all tables for Oracle DB

To purge all data from a user schema, I simply generate a drop table statement for each user table.

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

This will generate something like this:

drop table CASELOCK cascade constraints;
drop table CLIENTS cascade constraints;
drop table CLOSECODE cascade constraints;
..