如何重新编译已使用 Oracle 10g 的 Wrap 实用程序加密的无效 PLSQL 包?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7874615/
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
How to recompile invalid PLSQL packages that have been encrypted using Oracle 10g's Wrap utility?
提问by TrojanName
So I've taken an export (using Data Pump) from an Oracle 10g schema where all the PLSQL packages were encrypted using Oracle's Wraputility. The problem is when I do an import of this into a new schema, all my packages are invalid, and trying a manual compile doesn't work.
因此,我从 Oracle 10g 模式中导出(使用数据泵),其中所有 PLSQL 包都使用 Oracle 的Wrap实用程序加密。问题是当我将其导入新模式时,我所有的包都无效,并且尝试手动编译不起作用。
SQL> ALTER PACKAGE mypackage compile;
Warning: Package altered with compilation errors.
SQL> show errors
Errors for PACKAGE MYPACKAGE:
LINE/COL ERROR
-------- -----------------------------------------------------------------
36/2 PLS-00103: Encountered the symbol "2"
So what's the solution to recompiling all these invalid packages?
那么重新编译所有这些无效包的解决方案是什么?
采纳答案by TrojanName
So it appears there is no "fix" for this issue, only workarounds, none of which are ideal.
所以看起来这个问题没有“修复”,只有变通方法,没有一个是理想的。
- Redo the export and import using the old exp and imp programs (instead of data pump)
- If you have .SQL files containing the package definitions, you can manually compile them in SQL*Plus (might be thousands of files making this a big job).
- You can patch the database (see Metalink article 460267.1)
- 使用旧的 exp 和 imp 程序(而不是数据泵)重做导出和导入
- 如果您有包含包定义的 .SQL 文件,您可以在 SQL*Plus 中手动编译它们(可能有数千个文件,这使得这项工作非常重要)。
- 您可以修补数据库(参见Metalink 文章460267.1)
回答by Wolf
Try using the system DBMS_UTILITY.COMPILE_SCHEMA
procedure to compile your schema objects. This procedure will determine the order in which to compile your objects and even handles circular dependencies. After a scripted schema build it's a good procedure to call for clean up.
尝试使用系统DBMS_UTILITY.COMPILE_SCHEMA
过程来编译您的模式对象。此过程将确定编译对象的顺序,甚至处理循环依赖关系。在脚本模式构建之后,调用清理是一个很好的过程。
BEGIN
DBMS_UTILITY.COMPILE_SCHEMA('MYSCHEMA');
END;
/
I'd be curious to know how well it handles wrapped objects.
我很想知道它处理包裹物体的效果如何。