What Situations Cause Oracle Packages to Become Invalid?

后端 未结 6 1498
慢半拍i
慢半拍i 2020-12-31 18:22

The scenario that created this question:

We have a package that is a dependency of another package, sometimes making changes to the \"parent\" package causes the d

6条回答
  •  被撕碎了的回忆
    2020-12-31 18:49

    I agree with Thomas Jones-Low however there are a couple more issues to do with long sessions and recompilation.

    If you reference a package in a session and that package (or a dependant package) gets recompiled during the same session then you'll get oracle error "ORA-06508: PL/SQL: could not find program unit being called"

    Once you've referenced the package in a session you generally can't change the package without invalidating it for that session. This is a particular problem for development environments where packages change frequently but also a problem for production environments where you want to do a small patch without taking the whole environment down. Note that this error will occur even when there are no errors in the changed packages.

提交回复
热议问题