如何安装Oracle Java Extension?

时间:2013-09-10 20:19:32

标签: java oracle

运行以下查询:

SELECT   *
  FROM   XMLTABLE (
                   '
     declare function local:path-to-node( $nodes as node()* )  as xs:string* {
       $nodes/string-join(ancestor-or-self::*/name(.), ''/'')
     };
     for $i in $rdoc//name 
       return <ret><name_path>{local:path-to-node($i)}</name_path>{$i}</ret>
    '
                   PASSING XMLPARSE (
                   CONTENT
                   '
      <users><user><name>user1</name></user>
           <user><name>user2</name></user>
           <group>
              <user><name>user3</name></user>
           </group>
           <user><name>user4</name></user>
      </users>'
                   ) AS "rdoc" COLUMNS name_path varchar2 (4000) PATH
                   '//ret/name_path', name_value varchar2 (4000) PATH
                   '//ret/name')

我收到以下错误:

ORA-19112: error raised during evaluation:  
ORA-06550: line 1, column 13:
PLS-00201: identifier 'SYS.DBMS_XQUERYINT' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

问题是Java尚未安装。虽然在大多数情况下XQuery是通过C执行的,但10.2.0.1.0使用基于Java的XQuery解析器。

请假设我有SYS和SYSTEM凭据。

我如何安装Java for Oracle扩展?

提前感谢您的合作。

1 个答案:

答案 0 :(得分:0)

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