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: Dropping all objects without dropping the schema

Re: Dropping all objects without dropping the schema

From: <wagen123_at_yahoo.com>
Date: 17 May 2006 14:28:25 -0700
Message-ID: <1147901305.587069.104220@g10g2000cwb.googlegroups.com>


Don't forget to purge the recyclebin (purge recyclebin) after dropping the tables.

Brian Peasland wrote:
> 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" - Unknown
Received on Wed May 17 2006 - 16:28:25 CDT

Original text of this message

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