Re: Recompiling invalid objects with a batch file

From: gazzag <>
Date: Wed, 4 Jun 2008 02:51:21 -0700 (PDT)
Message-ID: <>

[Quoted] [Quoted] On 3 Jun, 20:35, Ubiquitous <> 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 Received on Wed Jun 04 2008 - 11:51:21 CEST

Original text of this message