哪些情况会导致 Oracle 包失效?

What Situations Cause Oracle Packages to Become Invalid?(哪些情况会导致 Oracle 包失效?)
本文介绍了哪些情况会导致 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 包失效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
MyBatis support for multiple databases(MyBatis支持多个数据库)
Oracle 12c SQL: Missing column Headers in result(Oracle 12c SQL:结果中缺少列标题)
SQL query to find the number of customers who shopped for 3 consecutive days in month of January 2020(查询2020年1月连续购物3天的客户数量)
How to get top 10 data weekly (This week, Previous week, Last month, 2 months ago, 3 month ago)(如何每周获取前十大数据(本周、前一周、上个月、2个月前、3个月前))
Select the latest record for an Id per day - Oracle pl sql(选择每天ID的最新记录-Oracle pl SQL)