Tuesday, June 8, 2010

Script to Check the Status of the JVM within the Database

The following script can be used to determine whether the Oracle JVM is installed completely and is valid also check  How to Check if the Oracle JVM is Installed Correctly in the Database
sqlplus  '/ as sysdba'
set serveroutput on

set echo on
set pagesize500
set linesize 100
column comp_name format a40

select comp_name, version, status from dba_registry;


select owner, status, count(*) from dba_objects  where object_type like '%JAVA%' group by owner, status;

select owner, object_type, count(*) from dba_objects  where object_type like '%JAVA%' and status <> 'VALID' group by owner, object_type;

select owner, status, object_type, object_name from dba_objects

where object_name like'%DBMS_JAVA%';

select owner, status, object_type, object_name from dba_objects

where object_name like'%INITJVMAUX%';

select * from v$sgastat where POOL = 'java pool' or NAME = 'free memory';


show parameter pool_size

show parameter sga

select owner, object_type, status, dbms_java.longname(object_name) from dba_objects

where object_type like '%JAVA%' and status <> 'VALID';


Related  topics:
How to Check if the Oracle JVM is Installed Correctly in the Database
Is the Oracle JVM actively used in the database

Is the Oracle JVM actively used in the database

Check  If the Oracle JVM is installed in the database  from  "How to Check if the Oracle JVM is Installed Correctly in the Database " articale  .If  it is installed then
There is no way to confirm if Oracle JVM is not actively used in the database. However, what can be said is
  1. If there are non-Oracle schemas that contain java objects, then 3rd party products or user defined java programs could be actively using the Oracle JVM.
  2. If there are Oracle schemas, other than SYS, that contain java objects, then other Oracle products or Oracle Applications could be actively using the Oracle JVM. (For example, ORDSYS schema for Oracle Intermedia and APPS schema for Oracle Applications).
  3. Even if all java objects are owned by SYS schema, there might still be user defined java objects in the SYS schema.
Related  Topics:
How to Check if the Oracle JVM is Installed Correctly in the Database
Script to Check the Status of the JVM within the Database

Monday, June 7, 2010

How to Check if the Oracle JVM is Installed Correctly in the Database

  1. For 9i and above, query the dba_registry view to determine if Oracle JVM has been installed. If Oracle JVM is installed, there will be a row in the registry similar to this

    SQL>select comp_name, version, status from dba_registry WHERE comp_name like '%JAVA%';
    COMP_NAME                                       VERSION                    STATUS
    -------------------------------------------------- ------------------------------ -----------
    JServer JAVA Virtual Machine              10.2.0.4.0                     VALID
  2. Check  the  number of objects  in the database  with the  following  query For a minimal installation of Oracle JVM in the database (after only running initjvm.sql), the total number of valid java objects owned by SYS should look something like this

     
    SQL> select owner, status, count(*) from all_objects where object_type like '%JAVA%' group by owner, status;

    SYS                     21223   --For Oracle 11.1.x  for 11.2.0.1 may be slightly higher count
    SYS                     14113   --For Oracle 10.2.x release
    SYS                     13866   --For Oracle 10.1.x release
    SYS                        8585  --For Oracle 9.2.x release
    SYS                        6787  --For Oracle 8.1.7.4.x release

    If the total number of java objects owned by SYS is considerably lower than the totals shown above, then Oracle JVM is not correctly installed in the database

  3. Query the roles associated with JVM.

    SQL> select role from dba_roles where role like '%JAVA%';



    There should be either 4 or 6 roles returned depending on what version you are running. If no roles are returned then JVM is not correctly installed
Related  Topics:
Script to Check the Status of the JVM within the Database
Is the Oracle JVM actively used in the database