Oracle JAVAVM 组件 Reload 说明

2024-04-04 02:08
文章标签 java oracle 组件 说明 vm reload

本文主要是介绍Oracle JAVAVM 组件 Reload 说明,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

 

一.JAVAVM 组件 说明

 

有关Oracle 所有组件的概述,参考:

Oracle 8i/9i/10g/11g 组件(Components) 说明

http://www.cndba.cn/Dave/article/1445

 

现在我们查看组件的信息:

SQL> col comp_id for a15

SQL> col version for a15

SQL> col comp_name for a30

SQL> select comp_id,comp_name,version from dba_registry ;

 

COMP_ID         COMP_NAME                      VERSION

--------------------------------------------- ---------------

XDB             Oracle XML Database            11.2.0.3.0

AMD             OLAP Catalog                   11.2.0.3.0

EM              Oracle Enterprise Manager      11.2.0.3.0

SDO            Spatial                        11.2.0.3.0

ORDIM           Oracle Multimedia              11.2.0.3.0

CONTEXT         Oracle Text                    11.2.0.3.0

ODM             Oracle Data Mining             11.2.0.3.0

EXF             Oracle Expression Filter       11.2.0.3.0

RUL             Oracle Rules Manager           11.2.0.3.0

OWM             Oracle Workspace Manager       11.2.0.3.0

CATALOG         Oracle Database Catalog Views  11.2.0.3.0

 

COMP_ID         COMP_NAME                      VERSION

--------------------------------------------- ---------------

CATPROC         Oracle Database Packages and T11.2.0.3.0

                ypes

 

JAVAVM          JServer JAVA Virtual Machine   11.2.0.3.0

XML             Oracle XDK                     11.2.0.3.0

CATJAVA         Oracle Database Java Packages  11.2.0.3.0

XOQ             Oracle OLAP API                11.2.0.3.0

APS             OLAP Analytic Workspace        11.2.0.3.0

 

17 rows selected.

 

MOS 对JAVAVM组件的描述:

JVM is aplatform-independent execution environment that converts Java bytecode intomachine language and executes it. Most programming languages compile sourcecode directly into machine code that is designed to run on a specificmicroprocessor architecture or operating system, such as Windows or UNIX.

--JVM 是一个独立的执行环境平台,其可以直接将Java源码编译成机器码,然后在特定的处理器架构或者系统下执行。

 

A JVM -- amachine within a machine -- mimics a real Java processor, enabling Javabytecode to be executed as actions or operating system calls on any processorregardless of the operating system.

--JVM 是机器中的机器,其有执行的Java 进程软件,可以执行Java bytecode。因为其是一个虚拟的machine,因此可以在任何操作系统上安装JVM并执行Java bytecode。

 

For example,establishing a socket connection from a workstation to a remote machineinvolves an operating system call. Since different operating systems handlesockets in different ways, the JVM translates the programming code so that thetwo machines that may be on different platforms are able to connect. 

 

Oracle JServerOption is a Java Virtual Machine (Java VM) which runs within the Oracle databaseserver's address space. Oracle also provides a JServer Accelerator to compileJava code natively. This speeds up the execution of Java code by eliminatinginterpreter overhead. 

--Oracle JServer 是Java VM 一个可选的组件,其运行在Oracle DB 的address space。 Oracle 也提供一个JServerAccelerator 来在本地编译Java Code。

 

NCOMP 说明:

The Javalanguage was designed for a platform-independent,  secure developmentmodel. Translating Java  bytecodes into machine instructions degradesperformance.  To regain some of the performance loss, you may chooseto  natively compile certain classes.

 

For example, youmay decide to natively compile code with CPU intensive classes and thiscan be achived using NCOMP.

 

In 10g one caninstall NCOMP from companion CD if they are really using JAVA intensiveapplication an facing any performance issues because of the reason given above.

 

MOS 文档说明:

How to use JServer Accelerator and theNCOMP Utility [ID 134985.1]

 

JVM 组件使用的用户:

SYS 

 

官方文档对JVM说明:

Overviewof the Java Virtual Machine (JVM)

Master Note for Oracle JVM [ID 1098505.1]

 

 

二.JVM 重建

MOS 相关文档:

Note.153271.1 Howto manually install JVM into 8i database 
Note.126029.1 Howto Remove the Jserver (JVM) in versions 8.1.5 and 8.1.6 of the rdbms 
Note.175472.1 Howto Reload the JVM in 8.1.7.X 
Note.202914.1 Howto Reload the JVM in 9.0.1.X 
Note.209870.1 Howto Reload the JVM in 9.2.0.X 
Note.276554.1 Howto Reload the JVM in 10.1.0.X and 10.2.0.X 
Note.457279.1 Howto Reload the JVM in 11.1.0.x 
Note.1112983.1 Howto Reload the JVM in 11.2.0.x

 

2.1 Oracle 10g Reload

(1) Verify that the ORACLE_HOMEand ORACLE_SID environment variables are set correctly in the environment, andthat the following system requirements are available: 

--验证ORACLE_HOME,ORACLE_SID等环境变量,及如下的要求:

      The SharedPool has at least 50Mb of free space. 
      The Java Pool has at least 20Mb of free space 
      The SYSTEM tablespace has at least 70Mb of freespace 
      The SYSTEM RBS has at least 100Mb of free space 

 

The initjvm.sqlscript in 10g will check these resources are available when it is run, and ifthey aren't available the execution of the script will terminate with an errorindicating which resource needs to be increased.

--在Oracle 10g中,initjvm.sql 会检查这些要求,只有符合才能继续。

 

(2).  Verify that theJAccelerator (NCOMP) is installed in the Oracle home.  The JAccelerator(NCOMP) is a recommended installation component in 10g when using the JVM asspecified in the patchset release notes.  Failure to install theJAccelerator (NCOMP) will result in an ORA-29558 error being signaled duringthe JVM installation and dramatically reduced performance when executing Javacode, see Note:293658.1. 

       --验证JAccelerator(NCOMP)安装。 JAccelerator 是推荐安装的。如果没有安装JAccelerator,那么在JVM安装时会触发ORA-29558错误。

 

(3).  Shutdown the instance andthen create and run the following sql script from a new sqlplus session:

--shutdown 实例,然后执行如下脚本:

-- Start of File full_rmjvm.sql 
 spool full_rmjvm.log 
 set echo on 
 connect / as sysdba 
 startup mount 
 alter system set "_system_trig_enabled" = false scope=memory; 
 alter system enable restricted session; 
 alter database open; 
 @?/rdbms/admin/catnoexf.sql 
 @?/rdbms/admin/catnojav.sql 
 @?/xdk/admin/rmxml.sql 
 @?/javavm/install/rmjvm.sql 


 truncate table java$jvm$status; 
 select * from obj$ where obj#=0 and type#=0; 
 delete from obj$ where obj#=0 and type#=0; 
 commit; 
 select owner, count(*) from all_objects 
   where object_type like '%JAVA%' group by owner; 
 select obj#, name from obj$ 
   where type#=28 or type#=29 or type#=30 or namespace=32; 
 select o1.name from obj$ o1,obj$ o2 
   where o1.type#=5 and o1.owner#=1 and o1.name=o2.name ando2.type#=29; 
 shutdown immediate 
 set echo off 
 spool off 
 exit 
-- End of File full_rmjvm.sql 

 

The actions above are required to resolvesome known issues, such as bug:1365707. 

 

IMPORTANT NOTES 

注意事项:

a)  TheSHUTDOWN command is needed here to ensure that the database is synchronized todisk after running rmjvm.sql.  Failure to perform this action can resultin spurious errors such as:

ORA-29549: class%s.%s has changed, Java session state cleared 
when running initjvm.sql. 

b)  The EXIT command is needed here to ensure that the sqlplus sessionresynchronizes its cache with the database, again to prevent spurious errorsoccurring when running the JVM initialization scripts. 

 

(4).  Check that the previousscript completed ok.  You can ignore object doesn't exist type errors heresuch as: 

--确认之前的脚本执行完毕,可以忽略类似如下的错误:

ORA-04043: object XMLGEN does not exist 
ORA-01432: public synonym to be dropped does not exist 


raised when running rmxml.sql.  Also, ORA-39705 errors from the executionof catnoexf.sql, e.g.:
ORA-39705: component 'EXF' not found in registry


can be ignored, as these are expected.

 

The last threeselect statements should show no java objects remaining, and that theSYS.JAVA$CLASS$MD5$TABLE was removed successfully before proceeding. 

 

In some cases you may see some rowsreturned by the last but one query, e.g:

SQL> select obj#, name fromobj$ where type#=28 or type#=29 or type#=30 or namespace=32;

OBJ# NAME 
---------- ------------------------------ 
44909 JAVA$POLICY$SHARED$00000001 
44910 JAVA$POLICY$SHARED$00000002 
2 rows selected. 

 

These can besafely ignored if they only reference object names of the form'JAVA$POLICY$SHARED$<sequence number>', providing they no longer appearonce the instance is restarted.  If any other rows are returned, or if youhave any doubts, stop at this point and contact Oracle Support supplying thelog file generated above.

If you encounteran OCI-21500 "internal error code, arguments: [koxsihread1]" error,then please see Note:350972.1 toresolve that error.

 

If you encounter an ORA-20000 "JServer is not operational in the database; JServer isrequired to remove CATJAVA from the database" error, then please see Note:757771.1 toresolve that error. 

If the abovecommands completed successfully, then create and run the following sql script,ensuring that you disable any password verification scripts you have enabled,otherwise you may encounter ORA-28003/ORA-20001 errors when executing the catexf.sqlscript which uses a hard coded password for the EXFSYS user:

-- Start of Filefull_jvminst.sql 
 spool full_jvminst.log; 
 set echo on 
 connect / as sysdba 
 startup mount 
 alter system set "_system_trig_enabled" = false scope=memory; 
 alter database open; 
 select obj#, name from obj$ 
   where type#=28 or type#=29 or type#=30 or namespace=32; 
 @?/javavm/install/initjvm.sql 
 select count(*), object_type from all_objects 
   where object_type like '%JAVA%' group by object_type; 
 @?/xdk/admin/initxml.sql 
 select count(*), object_type from all_objects 
   where object_type like '%JAVA%' group by object_type; 
 @?/xdk/admin/xmlja.sql 
 select count(*), object_type from all_objects 
   where object_type like '%JAVA%' group by object_type; 
 @?/rdbms/admin/catjava.sql 
 select count(*), object_type from all_objects 
   where object_type like '%JAVA%' group by object_type; 
 @?/rdbms/admin/catexf.sql 
 select count(*), object_type from all_objects 
   where object_type like '%JAVA%' group by object_type; 
 shutdown immediate 
 set echo off 
 spool off 
 exit 
-- End of File full_jvminst.sql 

 

If you encounter an OCI-21500"internal error code, arguments: [koxsihread1]" error, then pleasesee Note:350972.1 toresolve that error.

(5).  Once the database has beenrestarted, resolve any invalid objects by running the utlrp.sql script e.g.:TheJVM should now be fully installed (including the XDK & XSU).  The countof Java objects returned above should be around 14987 (on NT) for the SYSuser. 

In a full JVMinstallation depending upon the platform and products installed, the objectscan be broken down by owner as follows:

  @?/rdbms/admin/utlrp.sql 

 

The JVM shouldnow be fully installed (including the XDK & XSU). The count of Java objectsreturned above should be around 14987 (on NT) for the SYS user.  In a fullJVM installation depending upon the platform and products installed, theobjects can be broken down by owner as follows:

SQL> select owner, count(*) fromall_objects where object_type like '%JAVA%' group by owner; 

OWNER COUNT(*) 
------------------------------ ---------- 
DMSYS 467 
EXFSYS 40 
MDSYS 117 
ORDSYS 1354 
SYS 14987 
WKSYS 20 

NOTE: These count totals may be slightly higher on 10gR2 than on 10g R1. 

 

If you previously had the InterMedia (ORDSYS), UltraSearch (WKSYS) Data Mining(DMSYS), Spatial (MDSYS) or (EXFSYS) options installed, then these will need tobe re-installed to reload their java dependencies. 

 

This can be achieved by executing thefollowing commands:

 spool jvm_refresh.log 
 connect / as sysdba 
 @?/ord/im/admin/iminst.sql; 
 connect / as sysdba 
 @?/dm/admin/dminst1.sql SYSAUX TEMP <Your $ORACLE_HOME/dm/admindirectory>; 
 connect / as sysdba 
 @?/md/admin/mdinst.sql; 
 connect / as sysdba 
 @?/dm/admin/dminst2.sql; 
 connect / as sysdba 
 @?/ultrasearch/admin/wk0deinst.sql SYS change_on_install ""; 
 connect / as sysdba 
 @?/ultrasearch/admin/wk0install.sql SYS change_on_installchange_on_install 
 SYSAUX TEMP "" PORTAL false; 
 connect / as sysdba 
 alter user WKSYS account unlock identified by change_on_install; 
 @?/ultrasearch/admin/wk0config.sql change_on_install 
   (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) 
   (HOST=<Your hostname>)(PORT=1521)) 
   (CONNECT_DATA=(SERVER=DEDICATED) 
   (SERVICE_NAME=<Your SID NAME>.<Your Domain Name>))) 
   false " "; 
 spool off 

 

2.2 Oracle 11gR2 Reload

 

(1). Verify the following systemrequirements are available: 

The Shared Pool has at least 96Mb of freespace. 
The Java Pool has at least 50Mb of free space 
The SYSTEM tablespace has at least 70Mb of free space 
The SYSTEM RBS has at least 100Mb of free space 

The initjvm.sqlscript in 11g will check these resources are available when it is run, and ifthey aren't available the execution of the script will terminate with an errorindicating which resource needs to be increased. 

 

(2). Shutdown the instance and thencreate and run the following sql script from a new sqlplus session: 

 

-- Start of File full_rmjvm.sql
spool full_rmjvm.log
set echo on
connect / as sysdba
startup mount
alter system set "_system_trig_enabled" = false scope=memory;
alter system enable restricted session;
alter database open;
@?/rdbms/admin/catnoexf.sql
@?/rdbms/admin/catnojav.sql
@?/xdk/admin/rmxml.sql
@?/javavm/install/rmjvm.sql
truncate table java$jvm$status;
select * from obj$ where obj#=0 and type#=0;
delete from obj$ where obj#=0 and type#=0;
commit;
select owner, count(*) from all_objects
where object_type like '%JAVA%' group by owner;
select obj#, name from obj$
where type#=28 or type#=29 or type#=30 or namespace=32;
select o1.name from obj$ o1,obj$ o2
where o1.type#=5 and o1.owner#=1 and o1.name=o2.name and o2.type#=29;
shutdown immediate
set echo off
spool off
exit
-- End of File full_rmjvm.sql

 

The actions above are required to resolvesome known issues, such as: 

Bug1365707 ORA-955 ON CREATE OR REPLACE JAVA SYSTEM (INITJVM) AFTER FULLREMOVAL 

Unpublished Bug 1744593 TRYING TO INSTALLJVM IN SAME SESSION AS IT WAS REMOVED FROM GENERATES ORA-29549 

 

IMPORTANT NOTES 

注意事项:

=============== 
a) The SHUTDOWN command is needed here to ensure that the database issynchronized to disk after running rmjvm.sql. Failure to perform this actioncan result in spurious errors when running initjvm.sql such as: 
ORA-29549: class %s.%s has changed, Java session state cleared 

 

b) The EXIT command is needed here toensure that the sqlplus session resynchronizes its cache with the database,again to prevent spurious errors occurring when running the JVM initializationscripts. 

c) There is a known unpublished bug 9711406 that causes ORA-600[17037] whenrunning the rmxml.sql portion of the removal scripts above. 
This can be fixed by applying patch for unpublished Base Bug 8940094 to any11.2.0.1 installations. This is fixed in 11.2.0.2. 
These errors will not prevent a successful removal/reinstall though so stepscan still be carried out without patch applied. 


(3). Check that the previous scriptcompleted successfully. 

 

You can ignore object doesn't exist typeerrors here such as: 
ORA-04043: object XMLGEN does not exist 
ORA-01432: public synonym to be dropped does not exist 

raised when running rmxml.sql. The lastthree select statements should show no java objects remaining. 

 

In some cases you may see some rows returnedby the last but one query, e.g: 

SQL> select obj#, name from obj$ 
2> where type#=28 or type#=29 or type#=30 or namespace=32; 

OBJ# NAME 
---------- ------------------------------ 
44909 JAVA$POLICY$SHARED$00000001 
44910 JAVA$POLICY$SHARED$00000002 

These objectscan be safely ignored if they only reference object names in the form ofJAVA$POLICY$SHARED$<sequence number>', providing they no longer appearonce the instance is restarted. If any other rows are returned, or if you haveany doubts, stop at this point and contact Oracle Support Services (OSS)supplying the log file generated above. 

If the above commands completed successfully, then create and run the following sqlscript: 

 

-- Start of File full_jvminst.sql
spool full_jvminst.log;
set echo on
connect / as sysdba
startup mount
alter system set "_system_trig_enabled" = false scope=memory;
alter database open;
select obj#, name from obj$
where type#=28 or type#=29 or type#=30 or namespace=32;
@?/javavm/install/initjvm.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/xdk/admin/initxml.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/xdk/admin/xmlja.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/rdbms/admin/catjava.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/rdbms/admin/catexf.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
shutdown immediate
set echo off
spool off
exit
-- End of File full_jvminst.sql


If theinitjvm.sql script errors with an ORA-955 error executing the "create orreplace java system" command, then see the following note on Metalink fordetails on how to resolve this. 

Note276457.1 How to Resolve ORA-955 Errors When Running initjvm.sql 


(4). Once the database has beenrestarted, resolve any invalid objects. 

 

This can be performed by running theutlrp.sql script e.g.: 
@?/rdbms/admin/utlrp.sql 

The JVM shouldnow be fully installed. The count of Java objects returned above should bearound 21223 (on Windows XP) for the SYS user. 

In a full JVM installation the following default objects should exist. 

SQL> select owner, count(*) from all_objects 
2 where object_type like '%JAVA%' group by owner; 

OWNER COUNT(*) 
------------------------------ ---------- 

SYS 21313 

EXFSYS 48 

 

NOTE: Theseobject counts can vary by a few hundred on different Operating Systems anddifferent flavors of Operating Systems. As a general rule if the object countfor SYS is in the region of 21000 with no invalid SYS objects then this wouldbe considered a full JVM installation. 

If youpreviously had the InterMedia (ORDSYS), UltraSearch (WKSYS) Data Mining(DMSYS), Spatial (MDSYS) or (EXFSYS) options installed, then these will need tobe re-installed to reload their java dependencies. This can be achieved bycontacting the respective support teams for each product by logging a newService Request. 

 

 

三.常见问题参考

HOW DOES ORACLE STORE JAVA CLASSES INTODATABASE [ID 156439.1]

How To Find The Java Source Of A Java StoredProcedure [ID 265293.1]
How to Check Oracle JVM is Installed in the Database [ID 397770.1]

Simple Java Stored Procedure to Check thatthe Oracle JVM is Operating Correctly [ID 471867.1]

 

 

 

 

 

 

-------------------------------------------------------------------------------------------------------

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

QQ:492913789

Email:ahdba@qq.com

Blog:  http://www.cndba.cn/dave

Weibo: http://weibo.com/tianlesoftware

Twitter: http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

Linkedin: http://cn.linkedin.com/in/tianlesoftware

 


-------加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请----

DBA1 群:62697716(满);   DBA2 群:62697977(满)  DBA3 群:62697850(满)  

DBA 超级群:63306533(满);  DBA4 群:83829929   DBA5群: 142216823

DBA6 群:158654907    DBA7 群:172855474   DBA总群:104207940

这篇关于Oracle JAVAVM 组件 Reload 说明的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/874542

相关文章

Java实现检查多个时间段是否有重合

《Java实现检查多个时间段是否有重合》这篇文章主要为大家详细介绍了如何使用Java实现检查多个时间段是否有重合,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录流程概述步骤详解China编程步骤1:定义时间段类步骤2:添加时间段步骤3:检查时间段是否有重合步骤4:输出结果示例代码结语作

Java中String字符串使用避坑指南

《Java中String字符串使用避坑指南》Java中的String字符串是我们日常编程中用得最多的类之一,看似简单的String使用,却隐藏着不少“坑”,如果不注意,可能会导致性能问题、意外的错误容... 目录8个避坑点如下:1. 字符串的不可变性:每次修改都创建新对象2. 使用 == 比较字符串,陷阱满

Java判断多个时间段是否重合的方法小结

《Java判断多个时间段是否重合的方法小结》这篇文章主要为大家详细介绍了Java中判断多个时间段是否重合的方法,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录判断多个时间段是否有间隔判断时间段集合是否与某时间段重合判断多个时间段是否有间隔实体类内容public class D

IDEA编译报错“java: 常量字符串过长”的原因及解决方法

《IDEA编译报错“java:常量字符串过长”的原因及解决方法》今天在开发过程中,由于尝试将一个文件的Base64字符串设置为常量,结果导致IDEA编译的时候出现了如下报错java:常量字符串过长,... 目录一、问题描述二、问题原因2.1 理论角度2.2 源码角度三、解决方案解决方案①:StringBui

Java覆盖第三方jar包中的某一个类的实现方法

《Java覆盖第三方jar包中的某一个类的实现方法》在我们日常的开发中,经常需要使用第三方的jar包,有时候我们会发现第三方的jar包中的某一个类有问题,或者我们需要定制化修改其中的逻辑,那么应该如何... 目录一、需求描述二、示例描述三、操作步骤四、验证结果五、实现原理一、需求描述需求描述如下:需要在

Java中ArrayList和LinkedList有什么区别举例详解

《Java中ArrayList和LinkedList有什么区别举例详解》:本文主要介绍Java中ArrayList和LinkedList区别的相关资料,包括数据结构特性、核心操作性能、内存与GC影... 目录一、底层数据结构二、核心操作性能对比三、内存与 GC 影响四、扩容机制五、线程安全与并发方案六、工程

JavaScript中的reduce方法执行过程、使用场景及进阶用法

《JavaScript中的reduce方法执行过程、使用场景及进阶用法》:本文主要介绍JavaScript中的reduce方法执行过程、使用场景及进阶用法的相关资料,reduce是JavaScri... 目录1. 什么是reduce2. reduce语法2.1 语法2.2 参数说明3. reduce执行过程

如何使用Java实现请求deepseek

《如何使用Java实现请求deepseek》这篇文章主要为大家详细介绍了如何使用Java实现请求deepseek功能,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1.deepseek的api创建2.Java实现请求deepseek2.1 pom文件2.2 json转化文件2.2

Java调用DeepSeek API的最佳实践及详细代码示例

《Java调用DeepSeekAPI的最佳实践及详细代码示例》:本文主要介绍如何使用Java调用DeepSeekAPI,包括获取API密钥、添加HTTP客户端依赖、创建HTTP请求、处理响应、... 目录1. 获取API密钥2. 添加HTTP客户端依赖3. 创建HTTP请求4. 处理响应5. 错误处理6.

Spring AI集成DeepSeek的详细步骤

《SpringAI集成DeepSeek的详细步骤》DeepSeek作为一款卓越的国产AI模型,越来越多的公司考虑在自己的应用中集成,对于Java应用来说,我们可以借助SpringAI集成DeepSe... 目录DeepSeek 介绍Spring AI 是什么?1、环境准备2、构建项目2.1、pom依赖2.2