0

通过运行以下查询:

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 凭据。

如何为 Oracle 扩展安装 Java?

预先感谢您的友好合作。

4

1 回答 1

1
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
于 2013-09-11T08:46:47.093 回答