近期部署项目数据库,编译包时遇到错误:
PACKAGE CTG.CTG_CSB_COMMON 编译错误
错误:PLS-00201: identifier ‘XMLDOM‘ must be declared
行:124
文本:function getValueByXpath(inNode In xmldom.domnode, inXpath in Varchar2)
错误:PL/SQL: Declaration ignored
行:124
文本:function getValueByXpath(inNode In xmldom.domnode, inXpath in Varchar2)
原因:缺少 oracle XML Database 组件
验证XML DB是否安装,可以通过 dba_registry 视图
select comp_name "Component" from dba_registry;
结果:
Component
------------------------------------------
Oracle Database Catalog Views
Oracle Database Packages and Types
解决:调用 catqm.sql 脚本,导入此组件
此脚本将创建xdb用户
建议为 XML DB 新建表空间
create tablespace xmldb_ts
datafile ‘d:\oracle\databases\ora10\xmldb_ts.dbf‘ size 10M autoextend on maxsize unlimited
extent management local uniform size 1M;
当然也可以使用sysaux表空间。
同时 ,pool size最好也应该设置足够大
alter system set shared_pool_size = 80M scope=spfile;
如果shared pool size重置了额,数据库必须重启。
运行脚本。注意:此脚本仅能被sys用户运行。
调用脚本时,需给予以下参数:
catqm.sql <XDB_PASSWD> <TABLESPACE> <TEMP_TABLESPACE>
@?/rdbms/admin/catqm xml_password xmldb_ts temp;
验证创建是否成功:
select comp_name "Component" from dba_registry;
结果:
Component
------------------------------------------
Oracle Database Catalog Views
Oracle Database Packages and Types
Oracle XML Database
如果想卸载XML DB:
SQL> @?/rdbms/admin/catnoqm
SQL> alter tablespace XMLDB_TS offline;
SQL> drop tablespace XMLDB_TS including contents;
转:http://blog.csdn.net/vvqboy/article/details/8169344