Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Invalid packages not being recompiled by Oracle
<SPAN
class=437542718-28062001>Paul,
<SPAN
class=437542718-28062001>
Lisa
has the correct answer - you must recompile all dependent items.
This
behavior has been standard since the beginning of PL/SQL.
<SPAN
class=437542718-28062001>
<SPAN
class=437542718-28062001>Actually, if your application could be changed to
capture the error, and just call the package a second time, all would be well -
that is - the package would be compiled by the call, and be
validated.
<SPAN
class=437542718-28062001>
I
would suggest either running the dbms_utility.compile_Schema utility (which
I am not a fan of, as it sometimes dies with a recursive sql error) or running
the script below which will re-compile all invalid objects within the
schema.
<SPAN
class=437542718-28062001>
hope
this helps.
<SPAN
class=437542718-28062001>
<SPAN
class=437542718-28062001>
set
heading offset pagesize 5000set pages 100set serveroutput onexec
dbms_output.enable(500000);spool compile.sqldeclarecursor c1
is select 'alter ' || object_type || ' ' || object_name || ' compile;'
out_line from user_objects where status='INVALID'
and object_type in ('PROCEDURE','PACKAGE','FUNCTION','VIEW','TRIGGER')
order by 1;begin for c1_rec in c1 loop
dbms_output.put_line(c1_rec.out_line); end
loop; dbms_output.put_line('exit');end;/spool
off_at_compile
Tom Mercadante <FONT face=Arial
size=2>Oracle Certified Professional
<FONT face=Tahoma
size=2>-----Original Message-----From: Koivu, Lisa
[mailto:lisa.koivu_at_efairfield.com]Sent: Thursday, June 28, 2001
3:20 PMTo: Multiple recipients of list ORACLE-LSubject:
RE: Invalid packages not being recompiled by Oracle
HI Paul,
By chance can you use
dbms_utility.compile_Schema after recompiling? Are you using it already?
I know it doesn't answer your quesiton but this package is suppossed to follow
the dependencies, no matter how odd they are (what you are describing below is
pretty weird).
HTH <FONT color=#0000ff
face=Arial size=2>Lisa Koivu <FONT color=#0000ff face=Arial size=2>Database Bored Administrator <FONT color=#0000ff face=Arial size=2>Ft. Lauderdale, FL, USA
-----Original Message----- <FONT
face=Arial size=1>From: <FONT face=Arial
size=1>Troiano, Paul (CAP, GEFA) [SMTP:Paul.Troiano_at_gecapital.com]
Sent: <FONT face=Arial
size=1>Thursday, June 28, 2001 2:56 PM <FONT face=Arial size=1>To: <FONT face=Arial size=1>Multiple recipients of list ORACLE-L <FONT face=Arial size=1>Subject: <FONT face=Arial size=1>Invalid packages not being recompiled by Oracle
We have one package A that refers to package B. If package B's body and specification are both recompiled by user 1, package A is correctly marked <FONT face=Arial size=2>as invalid. Another user, user 2, then attempts to execute package A and gets the following error stack: