ORA-29558: JAccelerator (NCOMP) not installed报错分析

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:954


1 问题描述
当给已创建好的数据库安装oracle10.2.0.4或oracle10.2.0.5补丁,运行catupgrd.sql脚本时会出现 ORA-29558: JAccelerator (NCOMP) not installed报错。
select dbms_java.full_ncomp_enabled from dual
ERROR at line 1:
ORA-29558: JAccelerator (NCOMP) not installed. Refer to Install Guide for
ORA-06512: at "SYS.DBMS_JAVA", line 236
[@more@]2 处理过程
2.1 查询资料
1) 补丁readme文档给出的解释
If any of the databases use Java Virtual Machine or Oracle interMedia, then install the Oracle Database 10g Products installation type from the Oracle Database 10g Companion CD before installing the patch set. For information about installing the Oracle Database 10g Products installation type from the Companion CD, see the Oracle Database Companion CD Installation Guide for the platform. This installation type includes the Natively Compiled Java Library files to improve Java performance. If you do not install the Natively Compiled Java Library files, the ORA-29558: JAccelerator (NCOMP) not installed error occurs when a database that uses Java Virtual Machine is upgraded to the patch release.
See Also:
My Oracle Support (formerly OracleMetaLink) document 293658.1 for more information about the ORA-29558:JAccelerator (NCOMP) not installed error
2) metalink文档293658.1给出的解释
The Oracle Companion CD was either not installed or specifically the Natively Compiled Java Libraries (NCOMP) were not installed.
The Installation documentation is not explicit; however, the NCOMPs are optional and the error, ORA-29558 is informational not an actual error. NCOMPs do not have to be installed and the error can be ignored. The drawback is the potential of slower performance due to javabyte code having to be translated into machine code when used, but has no effect on an upgrade or migration. The Database Upgrade Assistant (DBUA) and the utility script utlu102i.sql will show that the NCOMPs are not installed but it will not affect the upgrade or migration.
Also, for clarification purposes, an Oracle Application Server 10g, version Metadata Repository installation, JAccelerator (NCOMP) is not used for the Oracle Applicaton Server.
2.2 分析
当我们没有使用Native PL/SQL compilation时,可以忽略这个报错。Metalink 文档394422.1对Native PL/SQL compilation的解释如下。
1) What is Native PL/SQL compilation ?
Native compilation is a way of speeding up PL/SQL procedures by compiling them into native code residing shared libraries. The procedures are translated into C code and then compiled with an by Oracle certified C-compiler and linked into the Oracle process.
Procedures compiled this way will work in all server environments as dedicated connections, shared connections (formerly known as MTS) and starting with 10g even within a Real Application Cluster (RAC) environment.
2) When to use native compilation with PL/SQL ?
Native compilation is a way of speeding up operations like loops, calculations, recursion etc. If the PL/SQL code is mainly based on SQL statement adding native compilation will not add any great advantages since SQL statements themselves will not perform any faster.
However instructions like loops, branches, recursive calls and calculations will benefit allot from native compilation.
Since native compilation is taking longer time then interpretated compilation it is recommended to not use native compilation in the middle, or during the busiest part of a development cycle where PL/SQL code is often recompiled. Either use a specific test environment for performance tests or wait until the end of the development cycle.
解决思路2:下载并安装Oracle Companion CD,该Companion CD包含了Natively Compiled Java Libraries (NCOMP)。安装Oracle Companion CD后,再重新安装patchset补丁文件和运行catupgrd.sql脚本。
2.3 处理步骤(安装Oracle Companion CD,并重装补丁)
1. 在http://www.oracle.com/]www.oracle.com网站下载相应平台的Oracle Companion CD
2. 安装Oracle Companion CD
3. 重新安装patchset
4. 重新运行catupgrd.sql脚本
3 总结
当oracle10g数据库已安装了Java Virtual Machine 或者 Oracle interMedia选项,打补丁运行catupgrd.sql脚本时会出现这个报错,如果数据库的PL/SQL脚本中没有使用Native PL/SQL compilation时,这个报错可以忽略,当然这个报错也可以通过安装Oracle Companion CD并重装补丁来解决。
plsql_ccflags string
plsql_code_type string INTERPRETED
plsql_compiler_flags string INTERPRETED, NON_DEBUG
plsql_debug boolean FALSE
plsql_native_library_dir string
plsql_native_library_subdir_count integer 0
plsql_optimize_level integer 2
plsql_v2_compatibility boolean FALSE
plsql_warnings string DISABLE:ALL
默认情况下,plsql_code_type = 'INTERPRETED',如果想使用Native PL/SQL compilation,则修改plsql_code_type = 'NATIVE',这是一个动态参数,可以在session级别调整:
alter session set plsql_code_type = 'NATIVE';

alter session set plsql_code_type = 'INTERPRETED';