oracle 用DEBUG编译ORACLE包有什么影响

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4733091/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 22:29:53  来源:igfitidea点击:

What's the influence of compiling ORACLE packages with DEBUG

oracledebuggingplsql

提问by Robe Elckers

we compile all our Oracle Packages with the DEBUG option enabled. This is the default for our IDE (PLSQLDeveloper). So when we compile a package in the background the following is executed:

我们在启用调试选项的情况下编译所有 Oracle 包。这是我们 IDE (PLSQLDeveloper) 的默认设置。因此,当我们在后台编译包时,会执行以下操作:

ALTER PACKAGE emp_mgmt
   COMPILE DEBUG PACKAGE;

I wonder if there are any performance consequences for this. The Oracle docs about ALTER PACKAGEdo not mention anything about this.

我想知道这是否有任何性能后果。关于ALTER PACKAGE的 Oracle 文档没有提及任何关于此的内容。

采纳答案by Gary Myers

There's a whole range of optimizations that the PL/SQL compilercan do.

PL/SQL 编译器可以进行一系列优化

Setting the mode to debug is equivalent to setting the optimizer level to 1(disabling most of the optimizations)

将模式设置为调试相当于将优化器级别设置为 1(禁用大部分优化)

So it could have a significant impact on performance.

因此,它可能会对性能产生重大影响。

回答by Tim

Oracle provides a Debug API for IDE developers. In the case that a Package is compiled with the DEBUGoption, it is possible to set breaktpoints with that API. If you compiled all packages with the DEBUGoption, someone can set a breakpoint via that API to manipulate the system!

Oracle 为 IDE 开发人员提供了一个调试 API。如果使用该DEBUG选项编译包,则可以使用该 API 设置断点。如果您使用该DEBUG选项编译了所有包,则有人可以通过该 API 设置断点来操纵系统!

So I think it is more an security issue than a preformance problem to compile Packages in debug mode.

所以我认为在调试模式下编译包更像是一个安全问题而不是一个性能问题。

EDIT:SET_BREAKPOINTFunctionin the Oracle documentation

编辑:Oracle 文档中的SET_BREAKPOINT函数

回答by Paolog

Compiling with the debug option definitely affects performance. A simple test that loops 50,000 times calculating a metaphone for example (lots of string tests, if then else ...) takes twice the time in debug mode.

使用调试选项进行编译肯定会影响性能。例如,一个简单的测试循环 50,000 次计算变音素(大量字符串测试,if then else ...)在调试模式下需要两倍的时间。