Sunday, March 17, 2024

Oracle Database 11.2 -- Manually Install Java Component in an Oracle Database

Problem

You want to manually install the Java Component in a Oracle Database version 11.2 and up

Solution

Note. The solution is application only for the first-time installation. If the Java component was previously installed, then this procedure is not applicable for repair/re-install. 

1) Optionally, cleanly stop the database, create a guaranteed restore point, enable restricted session:

shutdown immediate;
startup mount;
alter database archivelog;
alter system enable restricted session;
alter database open;
alter system switch logfile;
create restore point before_java guarantee flashback database;

2) Install Java component:

alter system set "_system_trig_enabled" = false scope=memory;
alter system set "java_jit_enabled" = false scope=memory;
spool /tmp/full_jvminst.log;
@?/javavm/install/initjvm.sql
@?/xdk/admin/initxml.sql
@?/xdk/admin/xmlja.sql
11g only @?/rdbms/admin/catexf.sql
@?/rdbms/admin/utlrp.sql
alter system set java_jit_enabled = true scope=memory;
alter system set "_system_trig_enabled"=true scope=memory;
spool off

3) In case of any of the actions of Step 1) was performed, perform the reverse actions:

drop restore point before_java;
shutdown immediate;
startup mount;
alter database noarchivelog;
alter database open;

Reference:

  • Safe repair/reinstall of the JVM Component in 11.2 and up (Doc ID 2314363.1)
  • Script to Check the Status or State of the JVM within the Database (Doc ID 456949.1) 
 

No comments: