问题描述
据我所知,可以在不影响规格的情况下更换和重新编译包装体.程序包规范声明了过程和函数,没有定义它们,因此它们不能引用可以使程序包规范为INVALID的对象.
As far as I know a package body can be replaced and recompiled without affecting the specification. A package specification declares procedures and functions, not defines them, so they can not reference objects, that can make the package specification INVALID.
我知道一个程序包规范在使用独立子程序和其他程序包定义其变量时可以引用对象.在这种情况下,更改引用的对象可能会导致规范无效.
I know that a package specification can reference objects when it uses stand-alone subprograms and other packages to define it's variables. In this case changing referenced objects may cause the specification invalidation.
Oracle包规范是否可以通过其他任何方式依赖(引用)对象,并且无论引用对象发生变化还是其他方式,它们都变得无效?
Is there any other way how an Oracle package specification can depend on (reference) objects and become INVALID whether when referenced objects chаnge or another way?
推荐答案
在规范中可以定义变量或类型.如果变量为table.column%type,则包规范可能会受到用于定义变量的表上任何ddl操作的影响.同样的情况是在包标头中定义游标时.
In specification there can be defined variable or type. If variable is table.column%type package specification can be affected by any ddl operation on the table used for defining variable. The same situation is when in package header we define cursor.
在变量定义引用的表和标头中使用的类型的情况下,我也要谨慎地进行同义词交换.
I would also be careful with synonyms swapping both in case of table referenced by variable definition and type used in header.
下一个场景是特权.如果程序包的所有者将放弃一些授权(可以说是由于重新创建表),则程序包规范也可能失效.
Next scenario are privileges. If owner of package will loose some grants (lets say due to table recreating) package spec can also go invalid.
我希望我写的东西有意义.
I hope what I'm writing make sense.
这篇关于Oracle软件包规范什么时候失效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!