Re: Remove everything from a schema

From: joel garry <joel-garry_at_home.com>
Date: Mon, 1 Dec 2008 17:28:12 -0800 (PST)
Message-ID: <ab38bb48-69be-4626-b50e-c23b063f9c62@f40g2000pri.googlegroups.com>


On Nov 27, 4:33 am, "Álvaro G. Vicario"
<alvaroNOSPAMTHA..._at_demogracia.com> 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 9.2.0.1.0 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?
>
> --
> --http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
> -- Mi sitio sobre programación web:http://bits.demogracia.com
> -- Mi web de humor al baño María:http://www.demogracia.com
> --

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 9.2.0.1.0.

jg

--
@home.com is bogus.
http://paulgraham.com/artistsship.html
Received on Mon Dec 01 2008 - 19:28:12 CST

Original text of this message