PLS-00123:程序太大(Diana节点),同时试图编译包 [英] PLS-00123: program too large (Diana nodes) while trying to compile a package

查看:2201
本文介绍了PLS-00123:程序太大(Diana节点),同时试图编译包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译程序包时出现错误信息:

While compiling a package, I ran into an error message:

Error: PLS-00123: program too large (Diana nodes)
Line: 1

有问题的程序包有大约1k行13k线在身体。在研究过程中,我遇到了此问题Tom问题

The package in question has about 1k lines (spec) + 13k lines in body. While researching on this, I came across this Ask Tom question


在编译PL / SQL单元时,
编译器构建一个解析树。 PL / SQL单元的
最大大小是
,由解析
树的大小决定。

When compiling a PL/SQL unit, the compiler builds a parse tree. The maximum size of a PL/SQL unit is determined by the size of the parse tree. A maximum number of diana nodes exists in this tree.

最多7.3个,你可以拥有 2 ** 14 (16K)
diana节点,从8.0到8.1.3,允许
2 ** 15
使用8.1.3,这个限制已经放松了
,所以你现在可以有
2 ** 26 (即64M)这个
树中的diana节点用于包和类型body。

Up to 7.3, you could have 2**14 (16K) diana nodes, and from 8.0 to 8.1.3, 2**15 (32K) diana nodes were allowed. With 8.1.3, this limit has been relaxed so that you can now have 2**26 (i.e., 64M) diana nodes in this tree for package and type bodies.

虽然没有简单的方法
翻译行的限制
的源代码,已经有我们的
观察,已经有
大约5到10个节点每行
的源代码。在8.1.3之前,
编译器可以清楚地编译高达
约3000行代码。

从8.1.3开始,限制是
机构和类型
机构,现在可以有
大约高达大约6,000,000
行代码。

While there is no easy way to translate the limits in terms of lines of source code, it has been our observation that there have been approximately 5 to 10 nodes per line of source code. Prior to 8.1.3, the compiler could cleanly compile up to about 3,000 lines of code.
Starting with 8.1.3, the limit was relaxed for package bodies and type bodies which can now have approximately up to about 6,000,000 lines of code.

这是一个粗略的估计。如果你的
代码有很多空格,长的
标识符等,你可能会得到
源代码大于这个。

This is a rough estimate. If your code has many spaces, long identifiers, etc., you may end up with source code larger than this.

现在,即使你考虑到最后一个关于许多空格的列表,

Now even if you take into consideration the last list about many spaces & large identifiers, I think it's reasonable to conclude that it's no where close the limits referred above.

更多,

如何检查包的当前大小:

How to Check the Current Size of a package:

要检查包的大小,
最接近的相关数字你可以在数据字典中使用
PARSED_SIZE
查看USER_OBJECT_SIZE。此值
提供了存储在 SYS.IDL_xxx $
表中的
字节中DIANA的大小,而不是大小
共享池。

To check the size of a package, the closest related number you can use is PARSED_SIZE in the data dictionary view USER_OBJECT_SIZE. This value provides the size of the DIANA in bytes as stored in the SYS.IDL_xxx$ tables and is NOT the size in the shared pool.

[...]

例如,您可能开始
遇到64K当
USER_OBJECT_SIZE 中的 PARSED_SIZE 不超过50K时,限制

For example, you may begin experiencing problems with a 64K limit when the PARSED_SIZE in USER_OBJECT_SIZE is no more than 50K.

查询此视图会得到 48929 的结果 - 所以我认为它的大小是47k ?

Querying this view gives a result of 48929 - so I assume it's fair to size is 47k ?

奇怪的部分是,从另一个模式获取相同的对象并在我遇到问题的区域运行它导致成功的编译。

The weird part is, fetching the same object from another schema and running it in the area I'm having problem results in successful compilation.

那么为什么这个特定区域会导致问题?

So why is this particular area causing problem ?

推荐答案

程序是否通过添加调试信息来编译代码?显然,它在此论坛帖子上有所不同。

Does the program you compile your code with add debug information? Apparently it makes difference illustrated on this forum post.



debug进行编译时的问题是在调试时添加
的额外代码。

The issue when doing a compile for debug is the extra code that is added in for the debugging.

您可以尝试这些查询:

ALTER PACKAGE debug COMPILE;
SELECT type, source_size, parsed_size, code_size
FROM user_object_size
WHERE name = 'DEBUG';

ALTER PACKAGE debug COMPILE DEBUG;
SELECT type, source_size, parsed_size, code_size
FROM user_object_size
WHERE name = 'DEBUG';

在编译调试时请注意
code_size的不同之处。

Observe the differences in the code_size when you compile for debug.

如果使用DEBUG进行编译,请尝试正常编译,以免生成额外的代码,导致错误。

If you're compiling with DEBUG, try to compile in normal so that it does not generate extra code which can generate your error.

这篇关于PLS-00123:程序太大(Diana节点),同时试图编译包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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