Oracle XDK 组件 说明

2024-04-04 02:08
文章标签 oracle 组件 说明 xdk

本文主要是介绍Oracle XDK 组件 说明,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

 

一.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://www.cndba.cn/Dave/article/1445

 

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://www.cndba.cn/Dave/article/1324

 

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://www.cndba.cn/Dave/article/1328

 

 

四.验证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 

 

 

 

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

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

QQ:492913789

Email:ahdba@qq.com

Blog:  http://www.cndba.cn/dave

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

这篇关于Oracle XDK 组件 说明的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/874546

相关文章

Redis中哨兵机制和集群的区别及说明

《Redis中哨兵机制和集群的区别及说明》Redis哨兵通过主从复制实现高可用,适用于中小规模数据;集群采用分布式分片,支持动态扩展,适合大规模数据,哨兵管理简单但扩展性弱,集群性能更强但架构复杂,根... 目录一、架构设计与节点角色1. 哨兵机制(Sentinel)2. 集群(Cluster)二、数据分片

Springboot项目构建时各种依赖详细介绍与依赖关系说明详解

《Springboot项目构建时各种依赖详细介绍与依赖关系说明详解》SpringBoot通过spring-boot-dependencies统一依赖版本管理,spring-boot-starter-w... 目录一、spring-boot-dependencies1.简介2. 内容概览3.核心内容结构4.

redis和redission分布式锁原理及区别说明

《redis和redission分布式锁原理及区别说明》文章对比了synchronized、乐观锁、Redis分布式锁及Redission锁的原理与区别,指出在集群环境下synchronized失效,... 目录Redis和redission分布式锁原理及区别1、有的同伴想到了synchronized关键字

MySQL 临时表创建与使用详细说明

《MySQL临时表创建与使用详细说明》MySQL临时表是存储在内存或磁盘的临时数据表,会话结束时自动销毁,适合存储中间计算结果或临时数据集,其名称以#开头(如#TempTable),本文给大家介绍M... 目录mysql 临时表详细说明1.定义2.核心特性3.创建与使用4.典型应用场景5.生命周期管理6.注

Java中数组与栈和堆之间的关系说明

《Java中数组与栈和堆之间的关系说明》文章讲解了Java数组的初始化方式、内存存储机制、引用传递特性及遍历、排序、拷贝技巧,强调引用数据类型方法调用时形参可能修改实参,但需注意引用指向单一对象的特性... 目录Java中数组与栈和堆的关系遍历数组接下来是一些编程小技巧总结Java中数组与栈和堆的关系关于

Oracle迁移PostgreSQL隐式类型转换配置指南

《Oracle迁移PostgreSQL隐式类型转换配置指南》Oracle迁移PostgreSQL时因类型差异易引发错误,需通过显式/隐式类型转换、转换关系管理及冲突处理解决,并配合验证测试确保数据一致... 目录一、问题背景二、解决方案1. 显式类型转换2. 隐式转换配置三、维护操作1. 转换关系管理2.

Oracle查询表结构建表语句索引等方式

《Oracle查询表结构建表语句索引等方式》使用USER_TAB_COLUMNS查询表结构可避免系统隐藏字段(如LISTUSER的CLOB与VARCHAR2同名字段),这些字段可能为dbms_lob.... 目录oracle查询表结构建表语句索引1.用“USER_TAB_COLUMNS”查询表结构2.用“a

Oracle数据库定时备份脚本方式(Linux)

《Oracle数据库定时备份脚本方式(Linux)》文章介绍Oracle数据库自动备份方案,包含主机备份传输与备机解压导入流程,强调需提前全量删除原库数据避免报错,并需配置无密传输、定时任务及验证脚本... 目录说明主机脚本备机上自动导库脚本整个自动备份oracle数据库的过程(建议全程用root用户)总结

mybatis-plus QueryWrapper中or,and的使用及说明

《mybatis-plusQueryWrapper中or,and的使用及说明》使用MyBatisPlusQueryWrapper时,因同时添加角色权限固定条件和多字段模糊查询导致数据异常展示,排查发... 目录QueryWrapper中or,and使用列表中还要同时模糊查询多个字段经过排查这就导致只要whe

Olingo分析和实践之OData框架核心组件初始化(关键步骤)

《Olingo分析和实践之OData框架核心组件初始化(关键步骤)》ODataSpringBootService通过初始化OData实例和服务元数据,构建框架核心能力与数据模型结构,实现序列化、URI... 目录概述第一步:OData实例创建1.1 OData.newInstance() 详细分析1.1.1