Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is anyone able to point me in the direction of a tool/script that will drop all tables from a specified database connection? Ideally Java/JDBC.

I have a development database and don't have much control over it, but I can drop tables one by one. It takes time to do this, especially seeing as I need to look at the FKs etc.

An app that did a topological sort to find which order to delete the tables in would be great :)

share|improve this question
What type of database is the server running? And I presume the "don't have much control over it" means you couldn't just do something like DROP DATABASE name (and maybe then CREATE DATABASE name if you intend to rebuild). –  DMA57361 Sep 12 '11 at 11:53
This database is Oracle, though something generic would be great as I work with lots of databases. As for what I can do, I can do individual "drop table ..." style queries, but I don't think I can do "drop database ..." style, and don't want to risk it either :) –  Rich Sep 12 '11 at 12:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.