Friday, September 3, 2010

Reload Oracle JVM Oracle 10g

In order to reload the Oracle JVM in an Oracle Database 10g do the following:

1) shutdown the database

2) create the following script to remove the installed JVM:

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/catnoexf.sql
@?/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


3) create the following script to reinstall JVM
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;
@?/rdbms/admin/catexf.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

4) Compile all invalid objects

@?/rdbms/admin/utlrp.sql

5) Check for the jvm installed

select version, status from dba_registry where comp_id='JAVAVM';

and / or

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

6) If you previously have installed InterMedia (ORDSYS), UltraSearch (WKSYS) Data Mining (DMSYS), Spatial (MDSYS) or (EXFSYS) then create and runt the following script

spool jvm_refresh.log
connect / as sysdba
@?/ord/im/admin/iminst.sql;
connect / as sysdba
@?/dm/admin/dminst1.sql SYSAUX TEMP ;
connect / as sysdba
@?/md/admin/mdinst.sql;
connect / as sysdba
@?/dm/admin/dminst2.sql;
connect / as sysdba
@?/ultrasearch/admin/wk0deinst.sql SYS change_on_install "";
connect / as sysdba
@?/ultrasearch/admin/wk0install.sql SYS change_on_install change_on_install
SYSAUX TEMP "" PORTAL false;
connect / as sysdba
alter user WKSYS account unlock identified by change_on_install;
@?/ultrasearch/admin/wk0config.sql change_on_install
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=)(PORT=1521))
(CONNECT_DATA=(SERVER=DEDICATED)
(SERVICE_NAME=.)))
false " ";
spool off


7) Recompile all invalid objects as in step 4

2 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete