Re: Recompiling invalid objects with a batch file

From: gazzag <gareth_at_jamms.org>
Date: Wed, 4 Jun 2008 03:01:31 -0700 (PDT)
Message-ID: <0867f8e6-dd1e-4007-9fa3-0292fb86664f_at_26g2000hsk.googlegroups.com>


On 4 Jun, 10:51, gazzag <gar..._at_jamms.org> wrote:
> On 3 Jun, 20:35, Ubiquitous <web..._at_polaris.net> wrote:
>
>
>
> > I asked because I was unable to find them, but it might be because I don't
> > have rights on those objects here.
>
> The syntax you're after is:
>
> ALTER <object_type> <object_name> RECOMPILE;
>
> So, in answer to your OP, you could refine the following script:
>
> SELECT 'ALTER '||object_type||' '||object_name||' COMPILE;'
> FROM user_objects
> WHERE status != 'VALID';
>
> Spool the output to a file.  This will become your recompile script.
>
> HTH
>
> -g

[Quoted] Sorry, in my previous post "ALTER <object_type> <object_name> RECOMPILE;" should be "ALTER <object_type> <object_name> COMPILE;"

COMPILE *not* RECOMPILE.

Apologies. Received on Wed Jun 04 2008 - 12:01:31 CEST

Original text of this message