What Situations Cause Oracle Packages to Become Invalid?

后端 未结 6 1519
慢半拍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:36

    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.

    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.

提交回复
热议问题