有什么办法可以只在服务器上编译一个特定的程序包? [英] Is there Any way to compile only one particular package on server?

查看:89
本文介绍了有什么办法可以只在服务器上编译一个特定的程序包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Oracle服务器不是很聪明,无法捕获更新的软件包. 所以每当我重新编译我的包时.它会引发现有的程序包失效错误.

Oracle server is not so smart to catch updated packages. so whenever I recompile my package. it throws existing package invalidate error.

如果有什么办法可以使我只能刷新服务器上的程序包.因此,我不需要重新启动服务器并停止所有人使用的服务器.

if is there any way so that I can refresh only my package on server. So I don't need to bounce server and stop server which is used by everyone.

推荐答案

  1. 最小化公共函数,过程和变量.在最小化公共对象和最小化程序包状态之后,无效对象和ORA-04068: existing state of packages has been discarded错误将减少.

  1. Minimize public functions, procedures, and variables. Invalid objects and ORA-04068: existing state of packages has been discarded errors will decrease after minimizing public objects and minimizing the package state.

软件包说明中的任何函数或过程都是公共的.更改这些功能和过程可能会更改其他对象使用程序包的方式,从而导致无效.另外,应该对公共API进行彻底的记录和测试.这意味着您希望拥有尽可能少的公共API.由于某些原因,当大多数Oracle程序仅在主体中需要时,不必要地将其所有过程和功能都放在了规范中.此更改将使您的程序更好,缩小依赖关系并最小化无效对象.

Any function or procedure in a package specification is public. Changing those functions and procedures may change the way other objects use the package, causing invalidations. Also, public APIs should be thoroughly documented and tested. Which means you want to have as few public APIs as possible. For some reason most Oracle programs unnecessarily put all their procedures and functions in the specification, when most of them are only needed in the body. This change will make your programs better, shrink dependencies, and minimalize invalid objects.

包装说明中的任何变量也是公共的,并且将在会话期间保持其值.与任何语言一样,公共变量也应最小化.由于某些原因,大多数Oracle程序也不必要在规范中放入很多变量,而不是正文中的变量.如果规范中没有变量,则没有包状态,并且您不会看到ORA-04068.

Any variable in the package specification is also public, and will maintain its value for the duration of the session. As in any language, public variables should also be minimized. For some reason most Oracle programs also unnecessarliy put many variables in the specification, instead of the body. If there are no variables in the specification, there is no package state and you won't see ORA-04068.

请勿在共享系统上进行开发.为每个开发人员提供无限数量的数据库,并合并版本控制的文本文件中的更改.获取无限数量的数据库有很多简便而廉价的方法-本地安装的数据库,虚拟机,容器等.还有多种简便且便宜的方式来控制文本文件的版本-每个现代的IDE都可以打开文件并将其保存到文件系统,然后使用Git或SVN之类的东西.

Do not develop on shared systems. Give every developer an infinite number of databases and merge changes in version-controlled text files. There are many easy and cheap ways to get an infinite number of databases - databases installed locally, virtual machines, containers, etc. There are also many easy and cheap ways to version control text files - every modern IDE can open and save files to the filesystem, then use something like Git or SVN.

让多个开发人员在单个共享系统上工作根本无法扩展.除了以这种方式进行设置稍微容易一些"之外,从字面上看,没有充分的理由再开发这种方式了.

Having multiple developers work on a single shared system simply does not scale. Other than "it was slightly easier to set it up that way", there is literally no good reason to develop that way anymore.

编译体,而不是规范.正如利特尔富特(Littlefoot)建议的那样,请尝试更改机体而不是更改规格. (尽管10g中的依赖关系不太细,但这可能不如现代版本那样有用.)

Compile body, not specification. As Littlefoot suggested, try to change the body instead of the specification. (Although dependencies were less granular in 10g, this may not help as much as it would in modern versions.)

这篇关于有什么办法可以只在服务器上编译一个特定的程序包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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