Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Dropping all objects without dropping the schema
Jflem wrote:
> Newbie question here-
>
> How does one drop all of the objects in a given schema without dropping
> the schema itself? I have looked at various threads and have tried the
> following with no luck.. I am running 10gR2
>
> select 'drop trigger', trigger_name, trigger_name, ';' from
> user_triggers;
> select 'drop sequence', sequence_name, sequence_name, ';' from
> user_sequences;
> select 'drop table', table_name, tablespace_name, 'cascade
> constraints;' from user_tables;
>
Try the following:
SPOOL drop_me.sql
SELECT 'DROP '||object_type||' '||object_name||';'
FROM user_objects;
SPOOL off
@drop_me
HTH,
Brian
-- =================================================================== Brian Peasland oracle_dba_at_nospam.peasland.net http://www.peasland.net Remove the "nospam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three" - UnknownReceived on Wed May 17 2006 - 15:46:34 CDT