Document 276554.1

2024-04-17Oracle / RAC / RMAN

— ## Applies to:

Oracle Database – Enterprise Edition – Version 10.1.0.2 to 10.2.0.5 [Release 10.1 to 10.2] Information in this document applies to any platform.

Purpose

This article details how to completely de-install and then re-install the JVM in Oracle10g Release 1 (10.1) and Release 2 (10.2).

Scope

The actions detailed in this article are highly destructive and so should not be attempted by novice users. Additionally, the actions performed in this article make direct changes to the underlying data dictionary tables which should not be attempted unless under the guidance of Oracle Support Services. As with all destructive actions, Oracle Corporation strongly advises taking a FULL COLD BACKUP of the database before these actions are performed. In addition, as removing the JVM removes ALL user owned JAVA objects also, such as APPS schema objects, an export dump of all user schema's containing JAVA objects should be taken if required, so that these objects can be reloaded once the JVM has been re-installed (see Document 183825.1). Oracle Applications customers should contact Oracle Support rather than attempt the actions in this article, see Note:191123.1 for the procedure to follow here. Oracle Real Application Cluster (RAC) customers should ensure that all nodes of the cluster are shutdown except the master node, and perform these actions on the master node only. <u>NOTE</u> It is not necessary to install the XML Developers Kit (XDK) or the XML SQL Utility (XSU) into user schema's in 10.1.0.x, unless specifically required by your application, as these products are included in the JVM in 10.1.0.x.

Details

1756814632108-8c90ab9e-780e-4132-ac73-40b283ce2681.png

The above link will play a video to show you the steps you need to follow.

Alternatively, please follow the steps below.

The following steps need to be executed precisely as listed below to ensure that they complete successfully: 1. Verify that the ORACLE_HOME and ORACLE_SID environment variables are set correctly in the environment, and that the following system requirements are available: The Shared Pool 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 free space The SYSTEM RBS has at least 100Mb of free space The initjvm.sql script in 10g will check these resources are available when it is run, and if they aren't available the execution of the script will terminate with an error indicating which resource needs to be increased. 2. Verify that the JAccelerator (NCOMP) is installed in the Oracle home. The JAccelerator (NCOMP) is a recommended installation component in 10g when using the JVM as specified in the patchset release notes. Failure to install the JAccelerator (NCOMP) will result in an ORA-29558 error being signaled during the JVM installation and dramatically reduced performance when executing Java code, see Note:293658.1. 3. Shutdown the instance and then create 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
Purpose
Scope
Details
References

The actions above are required to resolve some known issues, such as BUG:1365707.

IMPORTANT NOTES

a) The SHUTDOWN command is needed here to ensure that the database is synchronized to disk after running rmjvm.sql. Failure to perform this action can result in 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 session resynchronizes its cache with the database, again to prevent spurious errors occurring when running the JVM initialization scripts.

4. Check that the previous script completed ok. You can ignore object doesn't exist type errors 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. Also, ORA-39705 errors from the execution of catnoexf.sql, e.g.:

ORA-39705: component 'EXF' not found in registry

can be ignored, as these are expected.

The last three select statements should show no java objects remaining, and that the SYS.JAVA$CLASS$MD5$TABLE was removed successfully before proceeding. In some cases you may see some rows returned by the last but one query, e.g:

SQL> select obj#, name from obj$ 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 be safely ignored if they only reference object names of the form 'JAVA$POLICY$SHARED$<sequence number>', providing they no longer appear once the instance is restarted. If any other rows are returned, or if you have any doubts, stop at this point and contact Oracle Support supplying the log file generated above.

If you encounter an OCI-21500 "internal error code, arguments: [koxsihread1]" error, then please see Note:350972.1 to resolve that error.

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

If the above commands 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.sql script which uses a hard coded password for the EXFSYS user:

— 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 you encounter an OCI-21500 "internal error code, arguments: [koxsihread1]" error, then please see Note:350972.1 to resolve that error.

@?/rdbms/admin/utlrp.sql

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

SQL> select owner, count(*) from all_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 10g R2 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 to be re-installed to reload their java dependencies. This can be achieved by executing the following commands:

In 10.1 execute:

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/admin directory>; 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_install change_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

In 10.2 execute:

spool jvm_refresh.log connect / as sysdba @?/rdbms/admin/dminst.sql SYSAUX TEMP; connect / as sysdba @?/ord/admin/ordinst.sql SYSAUX SYSAUX; connect / as sysdba @?/ord/im/admin/iminst.sql connect / as sysdba @?/md/admin/mdinst.sql connect / as sysdba @?/ultrasearch/admin/wk0install.sql SYS <Your SYS paaaword> change_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

References

NOTE:350972.1 – OCI-21500 [Koxsihread1] During Manual Upgrade To Oracle10gR2 (10.2) NOTE:457279.1 – How to Reload the JVM in 11.1.0.x NOTE:757771.1 – The Catnojav.sql Script Fails With Ora-20000 Error Indicating JServer Is Not Operational NOTE:202914.1 – How to Reload the JVM in 9.0.1.X NOTE:204935.1 – How to Check the System Requirements for a JVM Installation NOTE:209870.1 – How to Reload the JVM in 9.2.0.X NOTE:276457.1 – How to Resolve ORA-955 Errors When Running initjvm.sql NOTE:293658.1 – 10.1 or 10.2 Patchset Install Getting ORA-29558 JAccelerator (NCOMP) And ORA-06512 [VIDEO] NOTE:778.1 – Troubleshooting Video Issues in MOS BUG:1365707 – ORA-955 ON CREATE OR REPLACE JAVA SYSTEM AFTER FULL REMOVAL

NOTE:149393.1 – What scripts are needed to manually install Oracle9i JVM(9.0.1) NOTE:175472.1 – How to Reload the JVM in 8.1.7.X NOTE:183825.1 – How to Backup and Restore Java Classes and Privileges only NOTE:191123.1 – Process for Performing a Non-Default JVM Reinstallation (Troubleshooting the JVM in an Oracle Applications environment) NOTE:197506.1 – TNS listener dies shortly after startup after running jisdr.sql