oracle 19c修复重新安装JVM
Repairing/Reinstalling JVM To A Multitenant Database (CDB and all PDBs) (Doc ID 2262919.1) 19C
Safe repair/reinstall of the JVM Component in 11.2 and up (Doc ID 2314363.1)11g
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | a. Create script jvm_info.sql to check JVM status. cat << EOF > jvm_info.sql ------------------------- column comp_name format a40 column version format a20 column status format a15 column owner format a30 column object_name format a30 column object_type format a15 column long_name format a75 column role format a40 set pagesize 500 set linesize 150 set trimspool on set serveroutput on set echo on --spool jvm_info.log ------ REGISTRY INFO ------ SELECT comp_name, version, status FROM dba_registry ORDER BY comp_name; SELECT * FROM dba_registry_history ORDER BY action_time DESC ; ------ JAVA OBJECT INFO ------ SELECT owner, object_type, status, COUNT (*) FROM dba_objects WHERE object_type LIKE '%JAVA%' GROUP BY owner, object_type, status ORDER BY owner, object_type, status; SELECT owner, object_name, object_type, status FROM dba_objects WHERE object_name LIKE 'DBMS_JAVA%' OR object_name LIKE '%INITJVMAUX%' ORDER BY owner, object_name, object_type; SELECT owner, NVL(longdbcs,object_name) long_name, object_type, status FROM dba_objects, sys.javasnm$ WHERE object_type LIKE '%JAVA%' AND status <> 'VALID' AND short (+) = object_name ORDER BY owner, long_name, object_type; ------ JAVA ROLE INFO ------ SELECT role FROM dba_roles WHERE role LIKE '%JAVA%' ORDER BY role; ------ MEMORY INFO ------ SELECT * FROM v$sgastat WHERE pool = 'java pool' OR name = 'free memory' ORDER BY pool, name ; ------ DATABASE PARAMETER INFO ------ show parameter pool_size show parameter target show parameter sga ------ TEST JAVAVM USAGE AND CHECK VERSION ------ SELECT dbms_java.get_jdk_version JDK_Version FROM dual; EOF |
Create the REMOVAL scripts: pre_jvm_deinstall.sql, jvm_deinstall.sql, post_jvm_deinstall.sql, and fulljvmrm.sql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | cat << EOF > pre_jvm_deinstall.sql ------------------------------ alter system set "_system_trig_enabled" = false scope=memory; -- to avoid any problems trying to run catnojava.sql, lets force the registry to reflect VALID components execute sys.dbms_registry.loaded( 'JAVAVM' ); execute sys.dbms_registry.loaded( 'CATJAVA' ); execute sys.dbms_registry.valid( 'JAVAVM' ); execute sys.dbms_registry.valid( 'CATJAVA' ); set pagesize 500 set linesize 150 select obj#, name from obj$ where type#=28 or type#=29 or type#=30 or namespace=32; EOF |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | cat << EOF > jvm_deinstall_part_1.sql ------------------------------ set pagesize 500 start ?/rdbms/admin/catnoexf.sql start ?/rdbms/admin/catnojav.sql start ?/xdk/admin/rmxml.sql EOF cat << EOF > jvm_deinstall_part_2.sql ------------------------------ execute rmjvm.run( FALSE ); truncate table java; set pagesize 500 select * from obj$ where obj#=0 and type#=0; delete from obj$ where obj#=0 and type#=0; commit ; EOF cat << EOF > post_jvm_deinstall.sql ------------------------------------ set pagesize 500 set linesize 150 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; EOF cat <<EOF> jvmremoval.sql host $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -l /tmp/jvm -n 1 -b pre_jvm_deinstall_ /tmp/jvm/pre_jvm_deinstall.sql -- Note: Comment out the deinstall_part_1 if you find that you are encountering ORA-7445 or ORA-600 errors preventing them from completing -- since deinstall_part_2 will do a brute force removal of any remaining JVM related objects from SYS anyway. host $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -r -l /tmp/jvm -n 1 -b jvm_deinstall_part_1_ /tmp/jvm/jvm_deinstall_part_1.sql host $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -r -l /tmp/jvm -n 1 -b jvm_deinstall_part_2_ /tmp/jvm/jvm_deinstall_part_2.sql host $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -r -l /tmp/jvm -n 1 -b post_jvm_deinstall_ /tmp/jvm/post_jvm_deinstall.sql EOF<br><br> |
6. Now just cleanup any loose ends
1 2 3 | truncate table java$jvm$status; delete from obj$ where obj#=0 and type#=0; commit ; |
Create the INSTALL scripts: pre_jvm_install.sql, jvm_install.sql, post_jvm_install.sql, and fulljvminstall.sql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | cat << EOF > pre_jvm_install.sql ----------------------- set pagesize 500 set linesize 150 select obj#, name from obj$ where type#=28 or type#=29 or type#=30 or namespace=32; EOF cat << EOF > jvm_install.sql ----------------------- alter system set "_system_trig_enabled" = false scope=memory; start ?/javavm/install/reinitjvm.sql start ?/xdk/admin/initxml.sql start ?/rdbms/admin/catjava.sql EOF cat << EOF > post_jvm_install.sql -------------------------- set pagesize 500 set linesize 150 select obj#, name from obj$ where type#=28 or type#=29 or type#=30 or namespace=32; EOF cat << EOF > fulljvminstall.sql spool full_jvminst.log; set echo on host $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -l /tmp/jvm -n 1 -b pre_jvm_install_ pre_jvm_install.sql host $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -l /tmp/jvm -n 1 -b jvm_install_ jvm_install.sql host $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -l /tmp/jvm -n 1 -b post_jvm_install_ post_jvm_install.sql set echo off spool off EOF |
后边懒得粘了mos看吧
本文来自博客园,作者:蚌壳里夜有多长,转载请注明原文链接:https://www.cnblogs.com/dbahrz/p/17271740.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)