Oracle INITJVMAUX
Version 21c

General Information
Library Note Morgan's Library Page Header
ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling complimentary technical Workshops on Database Security for the first 30 Oracle Database customers located anywhere in North America, EMEA, LATAM, or APAC that send an email to asra_us@oracle.com. Request a Workshop for your organization today.
Purpose Support package for conditional execution when executing JVM scripts.

Examining undocumented packages is always tricky but they often lead to a better understanding of how things work and where to look when triaging things that don't. This package provides many indications that it has been deprecated for decades.
AUTHID CURRENT_USER
Dependencies
DBA_FREE_SPACE IDL_UB1$ V$INSTANCE
DBA_REGISTRY JAVA$JVM$STATUS V$MEMORY_DYNAMIC_COMPONENTS
DBA_ROLLBACK_SEGS JAVA$JVM$STEPS$DONE V$MYSTAT
DBMS_ASSERT JAVASNM$ V$PARAMETER
DBMS_JAVA_TEST JAVAVM_SYS V$PARAMETER2
DBMS_LOCK OBJ$ V$SESSION
DBMS_OUTPUT RMJVMD V$SGASTAT
DBMS_REGISTRY USER$ X$JOXFT
DBMS_STANDARD    
Documented No
First Available Not known
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admininitjvma,sql
Subprograms
 
ABORT_MESSAGE
The code says "DBMS_OUPUT a highlighted message" but the description seems misleading

It would be easy enough to write your own with the input as an array indexed by binary integer to handle n messages
initjvmaux.abort_message(
msg1 IN VARCHAR2,
msg2 IN VARCHAR2 DEFAULT NULL);
exec initjvmaux.abort_message('Why?', 'Why Not?');
.
###
### Why?
### Why Not?
###
.

PL/SQL procedure successfully completed.
 
ALTER_IF_NOT_PRESENT
Alter an object only if the alteration isn't already there initjvmaux.alter_if_not_present(command IN VARCHAR2);
CREATE TABLE t (
testcol NUMBER(3));

exec initjvmaux.alter_if_not_present('ALTER TABLE t ADD(regdate DATE)');
ALTER TABLE t ADD(regdate DATE)

PL/SQL procedure successfully completed.


SQL> desc t
Name               Null? Type
------------------ -------- -------------
TESTCOL                     NUMBER(3)
REGDATE                     DATE
 
CHECK_SIZES_FOR_CJS
Verify that pool sizes and tablespace are large enough for create java system initjvmaux.check_sizes_for_cjs(
required_shared_pool          IN NUMBER := 24000000,
required_shared_pool_if_10049 IN NUMBER := 70000000,
required_java_pool            IN NUMBER := 12000000,
required_tablespace           IN NUMBER := 70000000);
exec initjvmaux.check_sizes_for_cjs;

PL/SQL procedure successfully completed.
 
COMPARE_RELEASES
Returns an indication of whether the first argument is older than the second initjvmaux.compare_releases(
first  IN VARCHAR2,
second IN VARCHAR2)
RETURN VARCHAR2;
TBD
 
CREATE_IF_NOT_PRESENT
Create an object only if it does not already exist initjvmaux.create_if_not_present(command IN VARCHAR2);
CREATE TABLE zzyzx (
testcol DATE);

Table created.

exec initjvmaux.create_if_not_present('CREATE TABLE zzyzx (testcol DATE)');
CREATE TABLE zzyzx (testcol DATE)

PL/SQL procedure successfully completed.


DROP TABLE zzyzx;

Table dropped.

exec initjvmaux.create_if_not_present('CREATE TABLE zzyzx (testcol DATE)');
CREATE TABLE zzyzx (testcol DATE)

PL/SQL procedure successfully completed.


desc zzyzx
Name       Null?    Type
---------- -------- ------------------
TESTCOL             DATE
 
CREATE_PROPERTY_DEFS_TABLE
Create the infrastructure for persistent System.properties: Can only be run as SYS

Output, at right, formatted for clarity
The "missing" semicolons" are not in the procedure's output
initjvmaux.create_property_defs_table;
exec initjvmaux.create_property_defs_table;
create table SYS.java$jvm$system$property$defs(
user_name      varchar2(128),
property_name  varchar2(4000),
property_value varchar2(4000))

create or replace view java_system_property_settings as
select *
from sys.java$jvm$system$property$defs
where user_name=SYS_CONTEXT('userenv','CURRENT_USER') with check option

grant update,select,delete,insert on SYS.java_system_property_settings to public

create or replace public synonym java_system_property_settings
for SYS.java_system_property_settings

begin
  dbms_java.reset_property_defs_table_flag;
end;
 
CURRENTEXECID
Return the unique id for the current session that is used to indicate what session last did startaction initjvmaux.currentExecId RETURN VARCHAR2;
SELECT initjvmaux.currentExecId
FROM dual;

CURRENTEXECID
--------------
151-18482
 
CURRENT_RELEASE_VERSION
Returns the version value from v$instance initjvmaux.current_release_version RETURN VARCHAR2;
SELECT initjvmaux.current_release_version
FROM dual;

CURRENT_RELEASE_VERSION
------------------------
21.0.0.0.0
 
DEBUG_OUTPUT
Input a debug output line initjvmaux.debug_output(line IN VARCHAR2);
TBD
 
DROP_INVALID_SROS
Drop invalid SROS during upgrade or downgrade initjvmaux.drop_invalid_sros;
exec initjvmaux.drop_invalid_sros;

PL/SQL procedure successfully completed.
 
DROP_SROS
Drop SROS during upgrade or downgrade initjvmaux.drop_sros;
exec initjvmaux.drop_sros;

PL/SQL procedure successfully completed.
 
DROP_SYS_CLASS
Drop the (long)named class from SYS, along with any public synonym and MD5 table entry

Code at right reformatted for clarity.
initjvmaux.drop_sys_class(name IN VARCHAR2);
-- found i $ORACLE_HOME/rdbms/admin/javdbmig.sql

DELCARE
 droplist dbms_sql.varchar2_table;
 l_buf varchar2(4000);
BEGIN
  droplist(1) := 'oracle/jms/AQjmsReflect$AQjmsClassReflect';
  droplist(2) := 'oracle/jms/AQjmsReflect$AQjmsThreadReflect';
  droplist(3) := 'oracle/jms/AQjmsReflect';
  droplist(4) := 'oracle/jms/ASCII_CharStream';
  droplist(5) := 'oracle/jms/JJAQjmsParserCalls';
  droplist(6) := 'oracle/jms/AQjmsMessages_ca';
  droplist(7) := 'oracle/jms/AQjmsHttpRcv';
  droplist(8) := 'oracle/jms/AQjmsEventListener';
  droplist(9) := '/6381387c_AQjmsEventListenerPo';
  droplist(10) := '/1e1edbae_AQjmsEventListenerPo';
  droplist(11) := '/5d83c9b7_AQjmsEventListenerCo';
  droplist(12) := '/9d925bfe_AQjmsEventListenerCo';
  droplist(13) := 'oracle/ODCI/ODCIArgDesc$_Ctx';
  droplist(14) := 'oracle/ODCI/ODCIColInfo$_Ctx';
  droplist(15) := 'oracle/ODCI/ODCICost$_Ctx';
  droplist(16) := 'oracle/ODCI/ODCIFuncInfo$_Ctx';
  droplist(17) := 'oracle/ODCI/ODCIIndexCtx$_Ctx';
  droplist(18) := 'oracle/ODCI/ODCIIndexInfo$_Ctx';
  droplist(19) := 'oracle/ODCI/ODCIObject$_Ctx';
  droplist(20) := 'oracle/ODCI/ODCIPredInfo$_Ctx';
  droplist(21) := 'oracle/ODCI/ODCIQueryInfo$_Ctx';
  droplist(22) := 'oracle/ODCI/ODCIStatsOptions$_Ctx';

  FOR i IN droplist.FIRST .. droplist.LAST LOOP
    dbms_output.put_line(droplist(i));
    BEGIN
      dbms_output.put_line(droplist(i));
      initjvmaux.drop_sys_class(droplist(i));
    END;
  END LOOP;
END;
/
 
DROP_SYS_RESOURCE
Drop the (long)named resource from SYS, along with any MD5 table entry initjvmaux.drop_sys_resource(name IN VARCHAR2);
TBD
 
DRP
EXEC but ignores ORA-4080, -1418, -1919, -942, -1432, -4043, -1918, -2289, -6550, -1598, -1534, and -1434

Compare the demo, at right, to the demo for EXEC
initjvmaux.drp(x IN VARCHAR2);
BEGIN
  EXECUTE IMMEDIATE 'DROP TABLE zzyzx';
END;
/
BEGIN
*
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at line 2


exec initjvmaux.drp('DROP TABLE zzyzx');
DROP TABLE zzyzx

PL/SQL procedure successfully completed.
 
ENDACTION
Convenience wrapper for endaction_outarg that ignores the return value initjvmaux.endAction;
exec initjvmaux.endAction;

PL/SQL procedure successfully completed.
 
ENDACTION_ASLOAD
endaction and if not punting, set last action to 'LOAD' initjvmaux.endAction_asLoad;
exec initjvmaux.endAction_asLoad;

PL/SQL procedure successfully completed.
 
ENDACTION_OUTARG
Declares the end of current action and  returns (in the OUT arg) current action if not punting else 'PUNT' initjvmaux.endaction_outArg(action OUT VARCHAR2);
TBD
 
ENDSTEP
Indicate the current step completed successfully initjvmaux.endStep;
exec initjvmaux.endStep;

PL/SQL procedure successfully completed.

-- also see the startStep demo below
 
EXEC
Wrapper for EXECUTE IMMEDIATE but only executes if the user is SYS

Compare the demo, at right, to the demo for DRP
initjvmaux.exec(x IN VARCHAR2);
exec initjvmaux.exec('DROP TABLE zzyzx');
DROP TABLE zzyzx
BEGIN initjvmaux.exec('DROP TABLE zzyzx'); END;
*
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at "SYS.INITJVMAUX", line 28
ORA-06512: at line 1
 
JVMUSCRIPT
Returns the jvmuxxx script name if it is appropriate else jvmempty.sql initjvmaux.jvmuScript(patchset IN VARCHAR2) RETURN VARCHAR2;
TBD
 
JVMVERSION
Returns the version value for JAVAVM from dba_registry initjvmaux.jvmVersion RETURN VARCHAR2;
SELECT initjvmaux.jvmVersion
FROM dual;

JVMVERSION
-----------
21.0.0.0.0
 
REGISTRYSTATUS
Get the value of status from dba_registry for JAVAVM initjvmaux.registryStatus RETURN VARCHAR2;
SELECT initjvmaux.registryStatus
FROM dual;

REGISTRYSTATUS
---------------
LOADED
 
ROLLBACKCLEANUP
Deallocate any rollback segment allocated by rollbacksetup initjvmaux.rollbackCleanup;
exec initjvmaux.rollbackCleanup;

PL/SQL procedure successfully completed.
 
ROLLBACKSET
Make the rollback segment determined by rollbacksetup, if any, be in use for the current transaction initjvmaux.rollbackSet;
exec initjvmaux.rollbackSet;

PL/SQL procedure successfully completed.
 
ROLLBACKSETUP
If possible ensure that there is a large enough rollback segment available and where appropriate make it so that rollbackset will make that segment be in use for the current transaction initjvmaux.rollbackSetup;
exec initjvmaux.rollbackSetup;

PL/SQL procedure successfully completed.
 
SETLOADED
Make a dbms_registry entry for status loaded ... takes several seconds to execute initjvmaux.setLoaded;
exec initjvmaux.setLoaded;

PL/SQL procedure successfully completed.
 
SETLOADING
Make a dbms_registry entry for status loading ... takes several seconds to execute initjvmaux.setLoading;
exec initjvmaux.setLoading;

PL/SQL procedure successfully completed.
 
SET_ALT_TABLESPACE_LIMIT
Undocumented initjvmaux.set_alt_tablespace_limit(l IN NUMBER);
exec initjvmaux.set_alt_tablespace_limit(1);

PL/SQL procedure successfully completed.
 
SET_DEBUG_OUTPUT_OFF
Disables debug output initjvmaux.set_debug_output_off;
exec initjvmaux.set_debug_output_off;

PL/SQL procedure successfully completed.
 
SET_DEBUG_OUTPUT_ON
Enables debug output initjvmaux.set_debug_output_on;
exec initjvmaux.set_debug_output_on;

PL/SQL procedure successfully completed.
 
STARTACTION
Convenience wrapper for startaction_outarg which ignores return value and is callable with a literal string initjvmaux.startAction(newaction IN VARCHAR2);
TBD
 
STARTACTION_OUTARG
Declare intention to start a given action returns requested action, if allowed, else conflicting pending action initjvmaux.startAction_outRrg(newaction IN OUT VARCHAR2);
TBD
 
STARTSTEP
Indicate start of a script step, returns TRUE if step should be attempted initjvmaux.startStep(newstep IN VARCHAR2) RETURN BOOLEAN;
-- found in $ORACLE_HOME/rdbms/admin/inijvm5.sql

-- Preload these properties as SYS resources, see README in
-- javavm/lib/logging.properties for details
begin
  if initjvmaux.startstep('LOAD_PROPS_AS_SYS_RESOURCES') then
    dbms_java.loadjava('-grant PUBLIC javavm/lib/logging.properties');
    dbms_java.loadjava('-grant PUBLIC javavm/lib/calendars.properties');
    dbms_java.loadjava('-grant PUBLIC javavm/lib/hijrah-config-umalqura.properties');
    initjvmaux.endstep;
end if; end;
/
 
STARTUP_PENDING_P
See if the startup_required bit is set in registry the registry for JAVAVM initjvmaux.startup_pending_p RETURN BOOLEAN;
BEGIN
  IF initjvmaux.startup_pending_p THEN
    dbms_output.put_line('T');
  ELSE
    dbms_output.put_line('F');
  END IF;
END;
/
F

PL/SQL procedure successfully completed.
 
VALIDATE_JAVAVM
Validation procedure for dbms_registry initjvmaux.validate_javavm;
exec initjvmaux.validate_javavm;

PL/SQL procedure successfully completed.

Related Topics
Built-in Functions
Built-in Packages
Database Security
DBMS_JAVA
DBMS_JAVA_DEV
DBMS_JAVA_DUMP
DBMS_JAVA_MISC
DBMS_JAVA_TEST
DBMS_MLE
DBMS_SYS_MLE
JAVAVM_SYS
What's New In 21c
What's New In 23c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2023 Daniel A. Morgan All Rights Reserved
  DBSecWorx