Re: source of package invalidation

From: Kurt Franke <Kurt-Franke_at_web.de>
Date: Thu, 12 Mar 2009 20:33:24 +0100
Message-Id: <1189903397_at_web.de>


Hi,

a short rule to aoid those problems is never to reference an object in static pl/sql code for which dynamic code exists with ddl for this object. Once dynamic ddl is coded each access must be done dynamically to avoid dependencies and thus state invalidation caused by the dynamic ddl

regards

kf

>
> Maybe there is some code, running now and then, that uses NDS (
> execute immediate) to execute some DDL, that in turn invalidates a
> package body of which sessions hold state.
> This code would not show up in DBA_DEPENDENCIES...
> It would give the symptoms you describe.
>
> Just a thought.
>
> Toon
>
> On Thu, Mar 12, 2009 at 4:39 PM, Stephens, Chris <chris_stephens_at_
> admworld.com> wrote:
>
> I’ve gotten several private emails that demonstrate I didn’t clearly
> explain the problem I’m having.
>
> The package compiles fine once recompiled. It is my understanding
> that when an attempt is made to execute a procedure or function
> contained in the package, automated compiling should take place and
> the executor should be non the wiser. This is not what we are seeing.
> Instead the application receives the error:
>
> ORA-04068: existing state of packages has been discarded ORA-04061:
> existing state of package body "PROJECT.PCKG_CHARGECODE" has been
> invalidated ORA-04065: not executed, altered or dropped package body "
> PROJECT.PCKG_CHARGECODE"
>
> We have added an exception handler in the code to recompile the
> package with “execute immediate ‘alter package xxxx compile’;” that
> prevents the user from seeing the error but I would like to prevent
> this from being necessary in the first place.
>
> Also, am I wrong in expecting the compilation to happen automatically?
>
> This is a 10.2.0.4 database on RHEL 5 by the way.
>
> From:oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.
> org] *On Behalf Of *Stephens, Chris
> *Sent:* Thursday, March 12, 2009 10:24 AM
> *To:*oracle-l_at_freelists.org
> *Subject:* source of package invalidation
>
> We are seeing packages invalidated in our production database and I
> don’t have a clue how to track down the actual cause.
>
> I’ve taken a look at dba_dependencies and know the potential
> candidates for causing the invalidation but I’m looking to actually
> identify the chain of events that is causing this.
>
> Is there an oracle event that can be set to generate a trace file for
> something like this?
>
> Any other ideas on how to track this down?

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Mar 12 2009 - 14:33:24 CDT

Original text of this message