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

相关文章

Spring常见错误之Web嵌套对象校验失效解决办法

《Spring常见错误之Web嵌套对象校验失效解决办法》:本文主要介绍Spring常见错误之Web嵌套对象校验失效解决的相关资料,通过在Phone对象上添加@Valid注解,问题得以解决,需要的朋... 目录问题复现案例解析问题修正总结  问题复现当开发一个学籍管理系统时,我们会提供了一个 API 接口去

Java操作ElasticSearch的实例详解

《Java操作ElasticSearch的实例详解》Elasticsearch是一个分布式的搜索和分析引擎,广泛用于全文搜索、日志分析等场景,本文将介绍如何在Java应用中使用Elastics... 目录简介环境准备1. 安装 Elasticsearch2. 添加依赖连接 Elasticsearch1. 创

解决systemctl reload nginx重启Nginx服务报错:Job for nginx.service invalid问题

《解决systemctlreloadnginx重启Nginx服务报错:Jobfornginx.serviceinvalid问题》文章描述了通过`systemctlstatusnginx.se... 目录systemctl reload nginx重启Nginx服务报错:Job for nginx.javas

Spring核心思想之浅谈IoC容器与依赖倒置(DI)

《Spring核心思想之浅谈IoC容器与依赖倒置(DI)》文章介绍了Spring的IoC和DI机制,以及MyBatis的动态代理,通过注解和反射,Spring能够自动管理对象的创建和依赖注入,而MyB... 目录一、控制反转 IoC二、依赖倒置 DI1. 详细概念2. Spring 中 DI 的实现原理三、

Oracle数据库使用 listagg去重删除重复数据的方法汇总

《Oracle数据库使用listagg去重删除重复数据的方法汇总》文章介绍了在Oracle数据库中使用LISTAGG和XMLAGG函数进行字符串聚合并去重的方法,包括去重聚合、使用XML解析和CLO... 目录案例表第一种:使用wm_concat() + distinct去重聚合第二种:使用listagg,

SpringBoot 整合 Grizzly的过程

《SpringBoot整合Grizzly的过程》Grizzly是一个高性能的、异步的、非阻塞的HTTP服务器框架,它可以与SpringBoot一起提供比传统的Tomcat或Jet... 目录为什么选择 Grizzly?Spring Boot + Grizzly 整合的优势添加依赖自定义 Grizzly 作为

Java后端接口中提取请求头中的Cookie和Token的方法

《Java后端接口中提取请求头中的Cookie和Token的方法》在现代Web开发中,HTTP请求头(Header)是客户端与服务器之间传递信息的重要方式之一,本文将详细介绍如何在Java后端(以Sp... 目录引言1. 背景1.1 什么是 HTTP 请求头?1.2 为什么需要提取请求头?2. 使用 Spr

Java如何通过反射机制获取数据类对象的属性及方法

《Java如何通过反射机制获取数据类对象的属性及方法》文章介绍了如何使用Java反射机制获取类对象的所有属性及其对应的get、set方法,以及如何通过反射机制实现类对象的实例化,感兴趣的朋友跟随小编一... 目录一、通过反射机制获取类对象的所有属性以及相应的get、set方法1.遍历类对象的所有属性2.获取

Java中的Opencv简介与开发环境部署方法

《Java中的Opencv简介与开发环境部署方法》OpenCV是一个开源的计算机视觉和图像处理库,提供了丰富的图像处理算法和工具,它支持多种图像处理和计算机视觉算法,可以用于物体识别与跟踪、图像分割与... 目录1.Opencv简介Opencv的应用2.Java使用OpenCV进行图像操作opencv安装j

java Stream操作转换方法

《javaStream操作转换方法》文章总结了Java8中流(Stream)API的多种常用方法,包括创建流、过滤、遍历、分组、排序、去重、查找、匹配、转换、归约、打印日志、最大最小值、统计、连接、... 目录流创建1、list 转 map2、filter()过滤3、foreach遍历4、groupingB