Oracle XDK 組件 說明

來源:互聯網
上載者:User

 

一.Oracle XDK 組件 說明

 

在說明之前,我們先用如下SQL查看一下DB中的組件:

SQL> col comp_id for a15

SQL> col version for a15

SQL> col comp_name for a30

SQL> select comp_id,comp_name,versionfrom dba_registry;

 

COMP_ID         COMP_NAME                      VERSION

--------------------------------------------- ---------------

XDB             Oracle XML Database            11.2.0.3.0

AMD             OLAP Catalog                   11.2.0.3.0

EM              Oracle Enterprise Manager      11.2.0.3.0

SDO             Spatial                        11.2.0.3.0

ORDIM           Oracle Multimedia              11.2.0.3.0

CONTEXT         Oracle Text                    11.2.0.3.0

ODM             Oracle Data Mining             11.2.0.3.0

EXF             Oracle Expression Filter       11.2.0.3.0

RUL             Oracle Rules Manager           11.2.0.3.0

OWM             Oracle Workspace Manager       11.2.0.3.0

CATALOG         Oracle Database Catalog Views  11.2.0.3.0

 

COMP_ID         COMP_NAME                      VERSION

--------------------------------------------- ---------------

CATPROC         Oracle Database Packages and T11.2.0.3.0

                ypes

 

JAVAVM          JServer JAVA Virtual Machine   11.2.0.3.0

XML             Oracle XDK                     11.2.0.3.0

CATJAVA         Oracle Database Java Packages  11.2.0.3.0

XOQ             Oracle OLAP API                11.2.0.3.0

APS             OLAP Analytic Workspace        11.2.0.3.0

 

17 rows selected.

 

MOS 說明:

Oracle 8i/9i/10g/11g 組件(Components) 說明

http://blog.csdn.net/tianlesoftware/article/details/5937382

 

Oracle OracleXML Developer's Kit (XDK) is a versatile set of components that enables you tobuild and deploy C, C++, and Java software programs that process XML. You canassemble these components into an XML application that serves your businessneeds. 

--Oracle XDK 組件是一個多功能集合的組件,其可以構建和部署C,C++,Java 程式來處理XML。

 

Oracle XDKprovides the foundation for the Oracle XML solution. The XDK supports OracleXML DB, which is a set of technologies used for storage and processing of XMLin the database. You can use the XDK in conjunction with Oracle XML DB to buildapplications that run in Oracle Database. You can also use the XDKindependently of XML DB. 

--Oracle XDK 為XML的解決方案提供了基礎。 XDK 支援XML DB,XDB是一個技術的集合,其可以用來在DB中儲存和處理XML。 我們可以使用XDK 和XDB來構建應用在DB中運行,也可以單獨使用XDK。

 

OracleXDB 組件 重建 說明

http://blog.csdn.net/tianlesoftware/article/details/7323139

 

The Oracle XDKis fully supported by Oracle Corporation and comes with a commercialredistribution license. The standard installation of Oracle Database includesthe XDK. 

 

注意:

(1)Customersusing Oracle XDK with PL/SQL and migrating from Oracle Database Release 8.1 or9.2 are strongly encouraged to use AL32UTF8 as the database character set.Otherwise, issues can arise during PL/SQL processing of XML data that containsescaped entities. 

--在Oracle 8.1和9.2中強烈建議AL32UTF8字元集。

 

(2)9206 XDKshould be installed in 9204 database, 9207 XDK should be installed in 9205database and 9208 XDK should be installed in 9206 server. That is why in9.2.0.8 installation you will see XDK version 9.2.0.10

 

XDK 使用者:

SYS: In 9.2 XDK should be installed in SYSschema, as 9.2.0.* patchsets upgrade XDK installed in SYS schemaonly.  

       --從Oracle 9.2 開始,XDK 只安裝到SYS 使用者。

 

官網的其他文檔:

 XML DB Developer's Guide,10g Release 2 (10.2) 
Introduction to Oracle XMLDeveloper's Kit (11gR2)

 

 

二. XDK 卸載

MOS:

Note.317176.1 Howto De-install corrupted pl/sql XDK in 9.2 and Install the right version 

Note.171658.1 HowTo Install and Uninstall the XML Developers Toolkit 

 

1)     Let's check which user owns theXDK. To find out execute this query as SYS

--檢查XDK 使用者:

SQL> select owner,dbms_java.longname(object_name), object_type, status from all_objects where dbms_java.longname(object_name)like  ('%XMLParser%') and object_type like '%JAVA%';

 

Note:- If the packagesshow up as INVALID then XDK is corrupt and you need to follow  re-installsteps

--如果這裡包顯示無效,那麼XDK 就corrupt,需要重建XDK。

 

2) For each user that owns XDK executebelow function to find out the version

--每個XDK使用者執行如下函數,來確認版本資訊:

SQL> CREATE OR REPLACE FUNCTIONXMLVersion RETURN VARCHAR2
  IS LANGUAGE JAVA NAME  'oracle.xml.parser.v2.XMLParser.getReleaseVersion()returns java.lang.String';

 /

SQL> select xmlversion from dual;

3) 9206 XDK should be installed in 9204 database, 9207 XDK should be installedin 9205 database and 9208 XDK should be installed in 9206 server.

IF the XDK isinstalled in only SYS schema and you have right XDK version then no need tocontinue further ....

 

4) In 9.2, the XDK should be installed inthe SYS schema, as 9.2.0.* patchsets upgrade the XDK installed in the SYSschema only.

       --在Oracle 9.2 中,XDK 需要安裝在SYS使用者下。

 

5) If you have XDK installed in any schemaother than SYS, then follow below steps to successfully install the rightversion of XDK in SYS schema

       --如果XDK 已經安裝到了其他目錄,那麼使用如下步驟可以轉移到SYS 使用者。

 

a) If the user owning XDK just has XDKcomponents and no custom code then drop the user owning XDK using cascadeoption

 

b) Now, as SYS, check if any other schemahas XDK installed

SQL> select owner,dbms_java.longname(object_name), object_type, status from all_objects where dbms_java.longname(object_name)like  ('%XMLParser%') and object_type like '%JAVA%';

 

c) If the above query show that SYS hasalready the right version of XDK installed then stop here ..... 

otherwise continue

For both Unix and Windows as SYS executebelow command

   SQL>[ORACLE_HOME]/rdbms/admin/initxml.sql

d) Installation complete and no need tocontinue further ..

 

6) IF current XDK in SYS is corrupted oryou have wrong version of XDK in SYS schema then follow below steps tode-install and install

       --如果XDK 已經正確安裝到了SYS使用者,但是XDK 版本錯誤,那麼需要卸載XDK 然後重新安裝。

 

I) To de-install XDKinstalled from Technet you need to have right version of jar files I.e say you have 9.2.0.6 XDK installed in a 9.2.0.6 database (RightXDK should be 9.2.0.8) then you need to have 9.2.0.6 XDK files to drop thecurrent XDK. With below steps I will assume you have 9.2.0.6 XDK in 9.2.0.6database and we are going to de-install 9.2.0.6 XDK and install 9.2.0.8 XDK

  

a) Download 9.2.0.6 XDK from Technet

http://www.oracle.com/technology/tech/xml/xdk/software/prod/xdk_plsql.html

Install it in some directory on thedatabase box.

 

b) Cd to XDK_HOME/xdk/admin directory

 

c) Log in as SYS and execute below commands

SQL> @xmldrop.sql
 
SQL> drop package dbms_xmlquery;
SQL> drop package dbms_xmlsave;
SQL> drop package xmlgen;
SQL> drop public synonym dbms_xmlquery;
SQL> drop public synonym dbms_xmlsave;
SQL> drop public synonym xmlgen;
SQL> exit

d) Cd to XDK_HOME/lib and issue a dropjava command for each of the followingjava archives
  
   ./xdk/lib/xschema.jar
   ./xdk/lib/xsu12.jar 
   ./xdk/lib/classgen.jar
   ./xdk/lib/xmlparserv2.jar
   ./xdk/lib/xmlplsql.jar

   eg.  dropjava -v -uuser/password xdk/lib/xschema.jar

 

e) Deinstall is complete. Now you can loginand check if any version of XDK is installed

 

f) To install XDK as SYS executebelow command

   SQL> [ORACLE_HOME]/rdbms/admin/initxml.sql


II) To de-install corrupt 9.2 XDK that is installedfrom $OH follow below steps

a) Cd to $OH

b) Log in as SYS and execute below commands

SQL> @rdbms/admin/rmxml.sql
 
SQL> drop package dbms_xmlquery;
SQL> drop package dbms_xmlsave;
SQL> drop package xmlgen;
SQL> drop public synonym dbms_xmlquery;
SQL> drop public synonym dbms_xmlsave;
SQL> drop public synonym xmlgen;
SQL> exit

d) Cd to $OH and issue a dropjava command for each of the following javaarchives
  
   ./lib/xschema.jar
   ./lib/xsu12.jar 
   ./lib/classgen.jar
   ./lib/xmlparserv2.jar
   ./rdbms/jlib/xdb.jar
   ./rdbms/jlib/servlet.jar
   ./lib/xmlplsql.jar

   eg.  dropjava -v -uuser/password ./lib/xschema.jar

 

e) Deinstall is complete. Now you can loginand check if any version of XDK is installed

 

f) To install XDK as SYS executebelow command

   SQL>[ORACLE_HOME]/rdbms/admin/initxml.sql

注意事項:

In 9iR2, the xdkfor pl/sql written in java has been deprecated and in 10i it is no longersupported

Starting with9.2 Oracle introduced XDK for pl/sql written in C/C++ which is referred asXDB/XMLTYPE. The packages XMLDOM, XMLPARSER and XSLPROCESSOR have been replacedby the new names as DBMS_XMLDOM, DBMS_XMLPARSER and DBMS_XSLPROCESSOR.

The new packageshave the same methods and functionality and support the same interfaces using Cinstead of Java.  In 10i there will be synonyms created to the oldpackages to provide backward compatibility.

In 9.2 you havethe option to either use pl/sql XDK written in C or Java.

In order toinstall XDB refer to Note 1292089.1

 

 

三. XDK 組件安裝

Note.435999.1 HowTo Install XDK 10.2.0.x ? 
Note.277152.1 Howto install XDK 9.2.0.x in an 8.1.7 Database Cleanly 
Note.453050.1 Howto Verify the XDK Installation
Installing the XDK (11gR2) 

There is no needto install XDK Java in 10g database as it comes with XDB schema. In 10g, muchabout XDK has been included in Oracle XML Database (XDB). 

--從Oracle10g 開始,不需要安裝XDK組件,其已經包含在XDB組件中。

 

So, to install the XDK Java, XDB should beinstalled first . 

--所以如果要安裝XDK,XDB 需要先安裝。

 

關於XDB安裝,參考:

OracleXDB 組件 重建 說明

http://blog.csdn.net/tianlesoftware/article/details/7323139

 

 If theJServer is installed correctly but the XDK component is not, for example it isinvalid, (which can be shown by the following SQL statement):

--如果JServer 安裝正確,但是XDK 無效,可以通過如下SQL 查詢:

COLUMN comp_name format a30
COLUMN version format a20
COLUMN status format a20

select comp_name,version,status from dba_registry where comp_name='Oracle XDK';

註:這裡的Jserver 是JVM組件的一個子集。

 

Then execute the following scripts tore-install the XDK component.

--可以執行如下指令碼重建XDK 組件:

Connected as SYSDBA.

$ORACLE_HOME/xdk/admin/rmxml.sql
$ORACLE_HOME/xdk/admin/initxml.sql

 

 

But afterrunning initxml.sql, if following error is encountered , then theJavaVM  is not installed correctly :

--如果執行initxml.sql,遇到如下錯誤,可能JavaVM組件沒有正確安裝。

BEGIN dbms_java.loadjava('-v -r -grantPUBLIC -s rdbms/jlib/servlet.jar'); END; 


ERROR at line 1: 
ORA-29532: Java call terminated by uncaught Java exception: 
java.lang.NullPointerException 
ORA-06512: at "SYS.DBMS_JAVA", line 222 
ORA-06512: at line 1 

BEGIN dbms_java.loadjava('-v -r -install -grant PUBLIC -s lib/xmlparserv2.jar 
rdbms/jlib/xdb.jar'); END; 


ERROR at line 1: 
ORA-29532: Java call terminated by uncaught Java exception: 
java.lang.NullPointerException 
ORA-06512: at "SYS.DBMS_JAVA", line 222 
ORA-06512: at line 1 

BEGIN dbms_java.loadjava('-v -r -grant PUBLIC -s lib/xsu12.jar'); END; 


ERROR at line 1: 
ORA-29532: Java call terminated by uncaught Java exception: 
java.lang.NullPointerException 
ORA-06512: at "SYS.DBMS_JAVA", line 222 
ORA-06512: at line 1 

 

重裝JavaVM組件即可,具體參考:

OracleJAVAVM 組件Reload 說明

http://blog.csdn.net/tianlesoftware/article/details/7334414

 

 

四.驗證XDK 安裝

 

1. Verify there are no invalid Java classesthat start with name "oracle/xml"  by querying the ALL_OBJECTSview. 
SQL> Select substr(dbms_java.longname(object_name),1, 30) as class, statusfrom all_objects where object_type = 'JAVA CLASS' and status = 'INVALID'; 

2. Verify installation of the Oracle XML Parser for JAVA (i.e xmlparserv2.jar) 
SQL> select substr(dbms_java.longname(object_name),1, 30) as class, statusfrom all_objects where object_type = 'JAVA CLASS' and object_name =dbms_java.shortname('oracle/xml/parser/v2/DOMParser'); 

You should see the following result: 

CLASS Status 
-------------------------------- --------- 
oracle/xml/parser/v2/DOMParser Valid 

3. Verify the PL/SQL wrapper packages are created for the Oracle XML Parser 
for PL/SQL 

DESC XMLPARSER; 
or 
DESC XMLDOM; 

4. Verify the PL/SQL wrapper packages are created for the Oracle XML SQLUtility 

DESC DBMS_XMLQUERY; 
or 
DESC DBMS_XMLSAVE; 

 

 

XML 與XDK 的常見問題參考:

Note 250288.1 XDK For PL/SQL API Has Been Deprecated from 9.2 Database
Note.103871.1 XML Parser for PL/SQL FAQs 
Note.103872.1 XML Parser for Java Version 2 - Frequently Asked Questions 

 

 

 

-------------------------------------------------------------------------------------------------------

著作權,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!

Skype: tianlesoftware

Email:   tianlesoftware@gmail.com

Blog:     http://www.tianlesoftware.com

Weibo: http://weibo.com/tianlesoftware

Twitter: http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

Linkedin: http://cn.linkedin.com/in/tianlesoftware

 

-------加群需要在備忘說明Oracle資料表空間和資料檔案的關係,否則拒絕申請----

DBA1 群:62697716(滿);   DBA2 群:62697977(滿)  DBA3 群:62697850(滿)  

DBA 超級群:63306533(滿);  DBA4 群:83829929   DBA5群: 142216823

DBA6 群:158654907    DBA7 群:172855474   DBA總群:104207940

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.