Oracle 11g 安装JVM

测试环境,创建user的时候,遇到错误如下:

SQL> grant javasyspriv to XXXX
      *
ERROR at line 1:
ORA-01919: role 'JAVASYSPRIV' does not exist


SQL>

 

原来是因为安装的时候,用silent模式,执行sql的时候,少了一些。

当前信息:

SQL> SELECT comp_name || ' : '||version|| ' : '|| status FROM dba_registry;

COMP_NAME||':'||VERSION||':'||STATUS
--------------------------------------------------------------------------------
Oracle Database Catalog Views : 11.2.0.3.0 : VALID
Oracle Database Packages and Types : 11.2.0.3.0 : VALID

SQL>

 

按照文档执行安装(就是两个sql)。

cd $ORACLE_HOME

SQL> @?/javavm/install/initjvm.sql

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

 

然后验证一下:

SQL> SELECT comp_name || ' : '||version|| ' : '|| status FROM dba_registry;

COMP_NAME||':'||VERSION||':'||STATUS
--------------------------------------------------------------------------------
Oracle Database Catalog Views : 11.2.0.3.0 : VALID
Oracle Database Packages and Types : 11.2.0.3.0 : VALID
JServer JAVA Virtual Machine : 11.2.0.3.0 : VALID
Oracle Database Java Packages : 11.2.0.3.0 : VALID

SQL> grant javasyspriv to XXXXX;

Grant succeeded.

SQL>

 

参考了URL如下:

http://abcdba.com/abcdbaserverinstallguideshowtoinstalloraclejvm

 

How To Install Oracle JVM

BACKGROUND & OVERVIEW

Oracle Java Virtual Machine (JVM) is a feature of the Oracle Database. It provides the ability to run java code from within the database.

This document explains the full set of steps that need to be taken in order to perform a complete and working installation.

ASSUMPTIONS & PRE-REQUISITES

This document expects and assumes the following:

  • The instructions are carried out by a qualified DBA, fully conversant with Oracle.
  • A fully working database without JVM exists.
  • All references to SID should be replaced with correct database name as derived using the database naming standard.

STEP-BY-STEP GUIDE

  1. As SYS, confirm the JVM is not already installed.
    • SELECT comp_id, comp_name FROM dba_registry; should not list JAVAM or CATJAVA.
  2. As SYS, perform the JVM installation.
    • @?/javavm/install/initjvm.sql
    • @?/rdbms/admin/catjava.sql
  3. As SYS, confirm the JVM is now fully installed:
SELECT comp_id, comp_name FROM dba_registry;

COMP_ID    COMP_NAME
---------  --------------------------------------------
EM         Oracle Enterprise Manager
CATALOG    Oracle Database Catalog Views
CATPROC    Oracle Database Packages and Types
JAVAVM     JServer JAVA Virtual Machine
CATJAVA    Oracle Database Java Packages

HEALTHCHECK

  • In addition, the following healthcheck can be performed to confirm the stability of the installed JVM, further details can be found in Metalink Article 456949.1:
connect / as sysdba 
 
spool jvm_stats.log 
 
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 all_objects 
where object_type like '%JAVA%' group by owner, status; 
 
select owner, object_type, count(*) from all_objects 
where object_type like '%JAVA%' and status <> 'VALID' group by owner, object_type; 
 
select owner, status, object_type, object_name from all_objects 
where object_name like'%DBMS_JAVA%'; 
 
select owner, status, object_type, object_name from all_objects 
where object_name like'%INITJVMAUX%';      
 
select role from dba_roles where role like '%JAVA%';
 
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 all_objects 
where object_type like '%JAVA%' and status <> 'VALID'; 
 
spool off

 

 

你可能感兴趣的:(Oracle 11g 安装JVM)