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: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Wed, 18 Apr 2001 19:21:25 +0800
Message-ID: <3ADD78B5.5720@yahoo.com>

Alvin wrote:
>
> 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 Wed Apr 18 2001 - 06:21:25 CDT

Original text of this message

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