Friday, March 3, 2023

JVM version in an Oracle database

Two ways can be used to check/confirm the JVM (Java Virtual Machine) version in a 19c database.

1. Set env for database 

$ echo $ORACLE_HOME
/u01/app/oracle/product/19.0.0.0/db_ebsdev
$ opatch lsinventory|grep "Patch description"
Patch description:  "INCREASE _LM_RES_HASH_BUCKET AND BACK OUT CHANGES FROM THE BUG 29416368 FIX"
Patch description:  "ORA-600 [KTSL_ALLOCATE_DISP KCBZ_OBJDCHK] ORA-600 [KCBZIB_6] SECUREFILE DOUBLE ALLOCATION"
Patch description:  "MERGE ON DATABASE RU 19.15.0.0.0 OF 28318139 28357349 28555193 28771564 29276889"
Patch description:  "DBMS_STATS.IMPORT_DATABASE_STATS FAILING WITH ERROR OPERATION NOT ALLOWED FROM WITHIN A PLUGGABLE DATABASE"
Patch description:  "IMPDP TAKES LONG TIME WHEN IMPORTING BASELINES"
Patch description:  "OJVM RELEASE UPDATE: 19.15.0.0.220419 (33808367)"
Patch description:  "Database Release Update : 19.15.0.0.220419 (33806152)"
Patch description:  "OCW RELEASE UPDATE 19.9.0.0.0 (31772784)"
$
$ opatch lspatches
29780459;INCREASE _LM_RES_HASH_BUCKET AND BACK OUT CHANGES FROM THE BUG 29416368 FIX
32455516;ORA-600 [KTSL_ALLOCATE_DISP KCBZ_OBJDCHK] ORA-600 [KCBZIB_6] SECUREFILE DOUBLE ALLOCATION
33956157;MERGE ON DATABASE RU 19.15.0.0.0 OF 28318139 28357349 28555193 28771564 29276889
33405295;DBMS_STATS.IMPORT_DATABASE_STATS FAILING WITH ERROR OPERATION NOT ALLOWED FROM WITHIN A PLUGGABLE DATABASE
31665107;IMPDP TAKES LONG TIME WHEN IMPORTING BASELINES
33808367;OJVM RELEASE UPDATE: 19.15.0.0.220419 (33808367)
33806152;Database Release Update : 19.15.0.0.220419 (33806152)
31772784;OCW RELEASE UPDATE 19.9.0.0.0 (31772784)

OPatch succeeded.

2.  Login to database and run below 

SET PAGESIZE 60
SET LINESIZE 300
SET VERIFY OFF
COL comp_name FOR a44 HEA 'Component'
COL version FOR a17 HEA 'Version'
COL VERSION_FULL FOR a17 HEA 'VERSION_FULL'
COL status FOR a17 HEA 'Status'
SELECT comp_name, version,VERSION_FULL, status FROM dba_registry;

Component                                 Version           VERSION_FULL   Status
-------------------------------------------- ----------------- ----------------- -----------------
JServer JAVA Virtual Machine    19.0.0.0.0       9.15.0.0.0            VALID
... ...

UPDATE in Dec 2024:
Now, Oracle provides patch EJCPUC to check Java versions related to database when CPU patches are applied.  For example, EJCPUC Output:

oracle@ebsdb1d$ bash ejcpuc.sh
#############################################################
## Checking DB tier Java for CPU 2024.10 on Platform IBM_AIX
## 2024-11-25 16:45:39 EST  on  aebsw1d
#############################################################

## Check Database Version
#############################################################
Your database version is 19.25.0.0.0
         ORACLE_HOME     $ORACLE_HOME
         ORACLE_SID          ARPGRND
         ORACLE_UNQNAME

## Check Java Version of OJVM, Database JDK and EBS's appsutil JRE
#############################################################
 Latest Version  action  Your Version  bitness Java Location
 -------------- -------- ------------  ------- ---------------
 1.8.0_431   o)    _.__.101034000  64-bit   OJVM In database
 1.8.0_411         1.8.0_421             64-bit   $ORACLE_HOME/jdk/bin/java
 1.8.0_411   u)   1.8.0_271            64-bit   $ORACLE_HOME/appsutil/jre/bin/java

o) Apply the Database Release Update (DBRU) recommended by ETCC which will update the DB OJVM version to the latest
u) When the DB JDK version is updated to the latest - then follow section 3 of 1530033.1 to update this JRE
#############################################################