测试环境,创建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
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.
This document expects and assumes the following:
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
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