Last active
August 29, 2015 14:01
-
-
Save donkirkby/aae15744f6fff1207e30 to your computer and use it in GitHub Desktop.
Drop all tables and sequences in an Oracle database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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