DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Tuesday, June 28, 2016

Step to Reload JVM in 12c

1. Verify that the following System Requirements are available

     The Shared Pool has at least 96 MB of free space.
     The Java Pool has at least 50 MB of free space
     The SYSTEM tablespace has at least 70 MB of free space
     The SYSTEM RBS has at least 100 MB of free space


2. Remove the JVM

Shutdown the database instance
Create the following REMOVAL script, full_rmjvm.sql
Run it from a new SQL*Plus session

-- Start of File full_rmjvm.sql
spool full_rmjvm.log
set echo on
connect / as sysdba
startup mount
alter system set "_system_trig_enabled" = false scope=memory;
alter system enable restricted session;
alter database open;
@?/rdbms/admin/catnojav.sql
@?/xdk/admin/rmxml.sql
@?/javavm/install/rmjvm.sql
truncate table java$jvm$status;
select * from obj$ where obj#=0 and type#=0;
delete from obj$ where obj#=0 and type#=0;
commit;
select owner, count(*) from all_objects
where object_type like '%JAVA%' group by owner;
select obj#, name from obj$
where type#=28 or type#=29 or type#=30 or namespace=32;
select o1.name from obj$ o1,obj$ o2
where o1.type#=5 and o1.owner#=1 and o1.name=o2.name and o2.type#=29;
shutdown immediate
set echo off
spool off
exit
-- End of File full_rmjvm.sql

3. Review the log file FULL_RMJVM.LOG

The full_rmjvm.sql script creates the log file full_rmjvm.log.  Review the log file and check to see if any unexpected errors were raised.

You can ignore "object XXX does not exist" errors, for example:

ORA-04043: object XMLGEN does not exist
ORA-01432: public synonym to be dropped does not exist

NOTE: These errors may be raised when running rmxml.sql.

The last three SELECT statements in the script should show no java objects remaining except in the case of the following query:
 
SQL> select obj#, name from obj$
  2  where type#=28 or type#=29 or type#=30 or namespace=32;

OBJ#       NAME
---------- ------------------------------
44909      JAVA$POLICY$SHARED$00000001
44910      JAVA$POLICY$SHARED$00000002



4. Install the JVM

Be sure the REMOVAL script, full_rmjvm.sql, completed successfully
Create the following INSTALL script, full_jvminst.sql
Run it from a new SQL*Plus session

-- Start of File full_jvminst.sql
spool full_jvminst.log;
set echo on
connect / as sysdba
startup mount
alter system set "_system_trig_enabled" = false scope=memory;
alter database open;
select obj#, name from obj$
where type#=28 or type#=29 or type#=30 or namespace=32;
@?/javavm/install/initjvm.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/xdk/admin/initxml.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/xdk/admin/xmlja.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/rdbms/admin/catjava.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
shutdown immediate
set echo off
spool off
exit
-- End of File full_jvminst.sql

5. Review the log file FULL_JVMINST.LOG

The full_jvminst.sql script creates the log file full_jvminst.log.  Review the log file and check to see if any unexpected errors were raised.


6. Resolve Invalid Objects

Be sure the INSTALL script, full_jvminst.sql, completed successfully
Start the database instance
Once the database has been started, resolve any invalid objects by running the utlrp.sql script:

SQL> @?/rdbms/admin/utlrp.sql


7. Validate the Install

The JVM should now be fully installed.

Execute the following validation queries to retrieve the final count of SYS Java Objects inside the database:

column owner format A30
-- Validation Query 1
select count(*), object_type
from all_objects
where object_type like '%JAVA%'
and owner = 'SYS'
group by object_type;

-- Validation Query 2
select owner, count(*)
from all_objects
where object_type like '%JAVA%'
and owner = 'SYS'group by owner;

-- Validation Query 3
select owner, object_type, count(*)
from all_objects
where object_type like '%JAVA%'
and status <> 'VALID'
and owner = 'SYS'
group by owner, object_type;



Limitation:

 If you previously had any of the following database options installed:
Oracle Multimedia (ORDSYS, ORDIM)
Oracle Spatial (MDSYS)
Oracle Warehouse Builder (OWBSYS)
OLAP
These options will need to be re-installed to reload their java dependencies.  This can be achieved by contacting the respective support teams for each product by logging a new Service Request.

No comments: