什么情况导致Oracle软件包无效? [英] What Situations Cause Oracle Packages to Become Invalid?

查看:489
本文介绍了什么情况导致Oracle软件包无效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建此问题的场景:

我们有一个包是另一个包的依赖,有时对父包进行更改会导致依赖包变得无效,但有时它不会。

We have a package that is a dependency of another package, sometimes making changes to the "parent" package causes the dependent package to become invalid, but sometimes it doesn't.

以前我们惊奇地发现了我们。

It has caught us by surprise before.

只要明白什么导致无效,这将是非常有用的我可以预测/计划。

It would be very useful to simply understand what causes invalidation so I could predict/plan for it.

推荐答案

更改包依赖的任何对象(例如表,视图,触发器,其他包)将自动将包标记为无效。作为上面的tuinstoel注释,Oracle足够聪明,可以在首次使用该软件包时重新编译该软件包。

Changing anything object that a package relies upon (e.g. tables, views, triggers, other packages) will automatically mark the package as invalid. As tuinstoel notes above, Oracle is smart enough to recompile the package when it is first used.

如果您担心这一点,每次您进行架构更改(例如表,视图,触发器和过程)时,请运行 DBMS_UTILITY.compile_schema (或让你的DBA做到这一点)。这将强制编译所有包,并让您知道在哪里,或者如果有错误,然后才能找到他们的困难的方式。

If you are concerned about this, every time you make schema changes (e.g. tables, views, triggers, procedures), run a DBMS_UTILITY.compile_schema (or have your DBA do it). This will force compile all the packages and let you know where, or if, there are errors before you find them the hard way.

这篇关于什么情况导致Oracle软件包无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆