DROP all tables, views, stored procedures, & Sequences from Schema

Below script will help to delete all tables, constrains from user

Begin
for c in (select table_name from user_tables) loop
execute immediate (‘drop table ‘||c.table_name||’ cascade constraints’);
end loop;
for c in (select view_name from user_views) loop
execute immediate (‘drop view ‘||c.view_name);
end loop;
for c in (select sequence_name from user_sequences) loop
execute immediate (‘drop sequence ‘||c.sequence_name);
end loop;
for c in (select procedure_name from user_procedures) loop
execute immediate (‘drop procedure ‘||c.procedure_name);
end loop;
End;

Below script will help to delete all tables, constrains from user Begin for c in (select table_name from user_tables) loop execute immediate (‘drop table ‘||c.table_name||’ cascade constraints’); end loop; for c in (select view_name from user_views) loop execute immediate (‘drop view ‘||c.view_name); end loop; for c in (select sequence_name from user_sequences) loop execute immediate (‘drop…

Leave a Reply

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