Compile the Invalid JAVA component in Oracle Database
During patching activity, i got my java component invalid.
So i tried to utlrp.sql alone but it doesn’t help.
col comp_id for a10
col version for a11
col status for a10
col comp_name for a37
select comp_id,comp_name,version,status from dba_registry;
COMP_ID COMP_NAME VERSION STATUS ---------- ------------------------------------- ----------- ---------- CATALOG Oracle Database Catalog Views 18.0.0.0.0 VALID CATPROC Oracle Database Packages and Types 18.0.0.0.0 VALID RAC Oracle Real Application Clusters 18.0.0.0.0 OPTION OFF JAVAVM JServer JAVA Virtual Machine 18.0.0.0.0 INVALID XML Oracle XDK 18.0.0.0.0 VALID CATJAVA Oracle Database Java Packages 18.0.0.0.0 INVALID APS OLAP Analytic Workspace 18.0.0.0.0 VALID XDB Oracle XML Database 18.0.0.0.0 VALID OWM Oracle Workspace Manager 18.0.0.0.0 VALID CONTEXT Oracle Text 18.0.0.0.0 VALID ORDIM Oracle Multimedia 18.0.0.0.0 VALID SDO Spatial 18.0.0.0.0 VALID XOQ Oracle OLAP API 18.0.0.0.0 VALID OLS Oracle Label Security 18.0.0.0.0 VALID DV Oracle Database Vault 18.0.0.0.0 VALID
Following are the steps for compiling java components:
1. Check the current value of hidden parameter “_system_trig_enabled”.
col name for a20
col value for a5
col description for a27
select x.ksppinm name,
y.ksppstvl value,
ksppdesc description
from x$ksppi x,
x$ksppcv y
where x.inst_id = userenv('Instance')
and y.inst_id = userenv('Instance')
and x.indx = y.indx
and x.ksppinm = '_system_trig_enabled';
NAME VALUE DESCRIPTION -------------------- ----- --------------------------- _system_trig_enabled TRUE are system triggers enabled
2. Note down the current value of java_jit_enabled parameter.
show parameter java_jit_enabled
NAME TYPE VALUE ------------------ -------- ------ java_jit_enabled boolean TRUE
3. Check the value of JOB_QUEUE_PROCESSES.
select * from v$parameter where name='JOB_QUEUE_PROCESSES';
no rows selected
-- And
Show parameter job_queue_processes
NAME TYPE VALUE --------------------- --------- ------- job_queue_processes integer 4000
4. Change the value of these parameter as sysdba user.
alter system set "_system_trig_enabled" = false scope=memory;
alter system set java_jit_enabled=false;
alter system set JOB_QUEUE_PROCESSES=0;
5. Execute the java system command which compile java components.
create or replace java system
/
6. Rollback the changed parameter in steps 4 to upper value.
--Revert the value of _system_trig_enabled, JOB_QUEUE_PROCESSES and java_jit_enabled.
alter system set "_system_trig_enabled" = TRUE scope=memory;
alter system set java_jit_enabled=TRUE;
alter system set JOB_QUEUE_PROCESSES=4000;
7. Run utlrp.sql to validate any invalid Java objects.
@?/rdbms/admin/utlrp.sql
8. Check the Java version that everything seems good if it executed successfully.
SELECT dbms_java.get_ojvm_property(PROPSTRING=>'java.version') FROM dual;
9. Check the Java components in registry that all become valid.
col comp_id for a10
col version for a11
col status for a10
col comp_name for a37
select comp_id,comp_name,version,status from dba_registry;