Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: invalid procedure/trigger

Re: invalid procedure/trigger

From: shuan.tay\(PCI¾G¸R³Ô\) <shuan.tay_at_pci.co.id>
Date: Wed, 08 Jan 2003 22:28:39 -0800
Message-ID: <F001.0052AFB4.20030108222839@fatcity.com>


Thanks to all.
It works!

Have a nice day.

  To check for invalid objects:
  select object_type, owner, object_name     from dba_objects
   where object_type in ('PACKAGE','PACKAGE BODY','PROCEDURE','FUNCTION')

     AND OWNER IN ('MyOwner1','MyOwner2')
     and status = 'INVALID'
    order by decode(object_type,'PACKAGE',0,

'PACKAGE BODY',1,
'FUNCTION', 2,
'PROCEDURE',3,
'TRIGGER',4
5), owner, object_name;

  To create sql to recompile the invalid ones:

  select 'alter '

         || decode(object_type,'PACKAGE BODY','package',lower(object_type))
         || ' ' || owner||'.'||object_name || ' compile '
         || decode(object_type,'PACKAGE BODY','body;',';')
    from dba_objects
   where object_type in ('PACKAGE','PACKAGE BODY','PROCEDURE','FUNCTION')
     AND OWNER IN ('MyOwner1','MyOwner2')
     and status = 'INVALID'
    order by decode(object_type,'PACKAGE',0,

'PACKAGE BODY',1,
'FUNCTION', 2,
'PROCEDURE',3,
'TRIGGER',4
5), owner, object_name;

  Djordje

    Dear all DBAs,

    Is there any way to check whether the procedures or triggers is valid?     and if it's not valid, recompile it automatically.     Some of the DBAs here always forgot to check procedures/triggers after modify table.

    Thanks in advance.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: =?big5?B?c2h1YW4udGF5XChQQ0m+R7hSs9RcKQ==?=
  INET: shuan.tay_at_pci.co.id

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Jan 09 2003 - 00:28:39 CST

Original text of this message

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