Re: Remove everything from a schema

From: joel garry <>
Date: Mon, 1 Dec 2008 17:28:12 -0800 (PST)
Message-ID: <>

On Nov 27, 4:33 am, "Álvaro G. Vicario"
<> wrote:
> I want to remove all the contents of a schema (tables, indexes,
> sequences...) in my development box so I can checkout a fresh working
> copy of the web site I'm working on and generate all objects from
> scratch. The server runs version in a separate network machine
> and I'd rather not ask the DBA to do it for me every time.
> What's the easiest way to do it?
> --
> -- Álvaro G. Vicario - Burgos, Spain
> -- Mi sitio sobre programación web:
> -- Mi web de humor al baño María:
> --

Michel's script is pretty trick. Another option might be to ask the DBA to create you a package with the drop user cascade and add user just for you. But if there are others it may reduce his workload for them, too. Suggestions like that presented properly can help DBA/ developer relations.

For myself, I like to work on the server, partly because I can run stuff like this as scripts, the scripts tend to pick up most modifications the vendors make, and the drop user followed by a tablespace coalesce makes sure I don't leave wasted space about - be sure you are using locally managed tablespaces, anyways. I worry when I see things like


-- is bogus.
Received on Mon Dec 01 2008 - 19:28:12 CST

Original text of this message