Skip to content

Instantly share code, notes, and snippets.

@donkirkby
Last active August 29, 2015 14:01
Show Gist options
  • Save donkirkby/aae15744f6fff1207e30 to your computer and use it in GitHub Desktop.
Save donkirkby/aae15744f6fff1207e30 to your computer and use it in GitHub Desktop.
Drop all tables and sequences in an Oracle database
set heading off;
set echo off;
set pages 999;
spool dropall.sql
select 'drop table ' || table_name || ';' from user_tables
union all
select 'drop sequence ' || sequence_name || ';' from user_sequences order by 1;
spool off
-- Remove header and footer from dropall.sql, then...
@dropall.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment