When the Oracle package specification becomes INVALID

As far as I know, the package body can be replaced and recompiled without affecting the specification. The package specification declares procedures and functions, but does not define them, so they cannot reference objects that can make the package specification INVALID.

I know that a package specification can refer to objects when it uses stand-alone routines and other packages to define variables. In this case, changing referenced objects may invalidate the specification.

Is there any other way in which the specification of an Oracle package can depend on (reference) objects and becomes INVALID regardless of whether the reference object is changed or in another way?

+4
source share
1 answer

A specification may define a variable or type. If the variable is the package specification table.column% type, it can be affected by any ddl operation in the table used to define the variable. The same situation occurs when we define a cursor in the packet header.

I would also be careful with replacing synonyms both in the case of the table referenced by the variable definition and the type used in the header.

The next scenario is privileges. If the package owner loses some grants (say, by re-creating the table), the package specification may also be invalid.

I hope that what I write makes sense.

+2
source

Source: https://habr.com/ru/post/1659129/


All Articles