Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: The fastest way of droping a schema???
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