When does an Oracle Package Specification become INVALID

南楼画角 提交于 2019-12-07 11:10:46

问题


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.

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?


回答1:


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.



来源:https://stackoverflow.com/questions/40296088/when-does-an-oracle-package-specification-become-invalid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!