Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: The fastest way of droping a schema???

Re: The fastest way of droping a schema???

From: Joe Kazimierczyk <joseph.kazimierczyk_at_bms.com>
Date: Thu, 19 Apr 2001 07:15:57 -0400
Message-ID: <3ADEC8ED.BE4D4E6@bms.com>

Truncating the tables first, then dropping the objects is the fastest way I've found.

> >
> > I'd like to know the fastest way of droping a schema, that's to say: The
> > objects of an user, the user, the defaut tablespace and the datafiles
> > asociated.
> > I usually use the "DROP USER XXX CASCADE CONSTRAINTS", etc but it's very
> > slow.
> > Do you know some other way??
> > Thank in advance and sorry for my english.
>
> Drop user is slow because you need to be able to roll it back if it
> fails (eg db crash etc). Try dropping the individual objects first, and
> then the user .. ie
>
> select 'drop '||object_type||' '||object_name||';'
> from user_objects
> where object_type not in ('INDEX','PACKAGE BODY')
>
> (I'm too slack to add decodes for tables to cascade constraint etc -
> reader exercise that one)
>
> hth
> connor
> --
> ===========================================
> Connor McDonald
> http://www.oracledba.co.uk (mirrored at
> http://www.oradba.freeserve.co.uk)
>
> "Some days you're the pigeon, some days you're the statue"
Received on Thu Apr 19 2001 - 06:15:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US