Xref: alice comp.databases.oracle.misc:40659 comp.databases.oracle.server:65149 comp.databases.oracle.tools:31656
Path: alice!news-feed.fnsi.net!newspump.monmouth.com!newspeer.monmouth.com!newsfeed.tli.de!newscore.gigabell.net!newscore.ipf.de!news-fra.pop.de!uunet!ams.uu.net!ffx.uu.net!nntphub.cb.lucent.com!news
From: Kenneth C Stahl <BlueSax@Unforgettable.com>
Newsgroups: comp.databases.oracle.misc,comp.databases.oracle.server,comp.databases.oracle.tools
Subject: Re: drop all source
Date: Thu, 09 Sep 1999 13:20:21 -0400
Organization: xyzzy
Lines: 82
Message-ID: <37D7EC55.D91066E9@Unforgettable.com>
References: <37D7E4A2.E9414630@cs.unm.edu>
Reply-To: BlueSax@Unforgettable.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 4.51 [en] (Win95; U)
X-Accept-Language: en-US,en

Wynette Richards wrote:

> We periodically drop all our source code and
> rebuild it from scratch (via make files).  We use the
> following procedure to drop all source:
>
>    create or replace procedure drop_all_source
>    is
>       cur integer;
>       rows integer;
>       drop_command varchar2(300);
>
>       cursor source_drop_cur is
>          select distinct name, type
>          from            user_source
>          where  type != 'PACKAGE BODY' and
>                 name != 'DROP_ALL_SOURCE';
>
>    begin
>       dbms_output.enable(1000000);
>       cur := dbms_sql.open_cursor;
>
>       for record in source_drop_cur loop
>          drop_command := 'drop ' || record.type || ' ' || record.name;
>          dbms_sql.parse( cur, drop_command, dbms_sql.native );
>          rows := dbms_sql.execute( cur );
>          dbms_output.put_line( drop_command );
>       end loop;
>
>       dbms_sql.close_cursor(cur);
>
>    end;
>
> (We exclude package bodies in the select because it is sufficient
> to drop the package header -- the body will follow.)
>
> This works ok.  But it takes a long time to run (15 or 20 minutes)
> since we have a lot of source code.  (It takes about as long to
> drop the source code as to rebuild it from scratch.)  I'm sure it
> is slow becauseeach time a package is dropped Oracle has to update
> its dependency tree for that package.
>
> Is there an easier/quicker way to drop *all* the source code for
> a user?

I'm not convinced that you even need to go thorugh all of this. As long as
you have "create or replace" in all of your source code there really isn't
any need to drop the procedures/packages before you do a re-compile unless
you are so tight on space in your system tablespace that you have no room
for a compile. I think if you just allow the procedures to be replaced
you'll end up using less time overall.

-------------------------------------------------------------------------------------------------

-
-------------------------------------------------------------------------------------------------

-
-------------------------------------------------------------------------------------------------

-
-------------------------------------------------------------------------------------------------

-
-------------------------------------------------------------------------------------------------

-
-------------------------------------------------------------------------------------------------

-
-------------------------------------------------------------------------------------------------

-
-------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------






