Detecting Java Status
To
determine Java status for the database we can query v$option dynamic view:
SQL > Select * from v$option;
PARAMETER VALUE
-------------------------------------------------------------- ------
Partitioning TRUE
Objects TRUE
Parallel Server FALSE
Advanced replication TRUE
Bit-mapped indexes TRUE
Connection multiplexing TRUE
Connection pooling TRUE
Database queuing TRUE
Incremental backup and recovery TRUE
Instead-of triggers TRUE
Parallel backup and recovery TRUE
Parallel execution TRUE
Parallel load TRUE
Point-in-time tablespace recovery TRUE
Fine-grained access control TRUE
N-Tier authentication/authorization TRUE
Function-based indexes TRUE
Plan Stability TRUE
Online Index Build TRUE
Coalesce Index TRUE
Managed Standby TRUE
Materialized view rewrite TRUE
Materialized view warehouse refresh TRUE
Database resource manager TRUE
Spatial TRUE
Visual Information Retrieval TRUE
Export transportable tablespaces TRUE
Transparent Application Failover TRUE
Fast-Start Fault Recovery TRUE
Sample Scan TRUE
Duplexed backups TRUE
Java FALSE
OLAP Window Functions TRUE
Information
from the view (Java=False) for the database version 8.1.5 - 8.1.7 inaccurately
reports a situation with the JVM, that Java VM is not installed. This is not
necessarily accurate.
To
find out the real Java status we will make two select statements:
a.) count java
objects
SQL> SELECT count(*) FROM dba_objects WHERE object_type LIKE '%JAVA%';
COUNT(*)
----------
10401
We have 10401 Java objects, indicating
that Java has been installed. If the JVM had not been installed the count for
the Java objects would be 0:
SQL> SELECT count(*) FROM dba_objects WHERE object_type LIKE '%JAVA%';
COUNT(*)
----------
0
The
total number of Java objects is platform dependent.
An
overview of the expected count for Java objects for different Oracle versions
follows:
- Version 8.1.5 - 4000 Java objects
- Version 8.1.6 - 8000 Java objects
- Version 8.1.7 - 10,300 Java objects
- Version 9.2 - 10,452 Java objects
When the Java object count is less than
given version/count, Java is only partially installed. For example, a full Java installation on 9.2 will give us following list, broken
down by owner:
SQL> select count(*), owner from all_objects where object_type like '%JAVA%' group by owner;
COUNT(*) OWNER
---------- ------------------------------
247 ODM -> Data Mining
1 ORDPLUGINS -> Intermedia
903 ORDSYS -> Intermedia
9261 SYS -> Java Basic
40 WKSYS -> Ultrasearch
b.) Check for description of all database DBMS_JAVA PL/SQL procedures and
functions
SQL> Describe DBMS_JAVA
PROCEDURE AURORA_SHUTDOWN
PROCEDURE DELETE_EP
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
HOST VARCHAR2 IN
PORT NUMBER IN
PRESENTATION VARCHAR2 IN
PROCEDURE DELETE_PERMISSION
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
KEY NUMBER IN
PROCEDURE DEPLOY_CLOSE
. . .
If the Java option is not installed, an
attempt to describe DBMS_JAVA PL/SQL procedures and functions will return the
following error:
SQL> Describe DBMS_JAVA
ERROR:
ORA-04043: object DBMS_JAVA does not exist