A principio, precisamos registrar o xml em um banco oracle, para que possamos executar as funcionalidades do xml no oracle. Existem varias funcoes que possamos retornar e trabalhar com os dados xml, e armazenar os arquivos xml diretamente no banco oracle. Vamos entao verificar se o banco corrente contem a opcao de xml instalada.

select comp_name “Component” from dba_registry;

Se nesta saida nao retornar:

Oracle XML Database

Entao, execute os comandos:
sqlplus / as sysdba

create tablespace xmldb_ts
datafile /u01/xmldb_ts.dbf’ size 10M autoextend on maxsize unlimited
extent management local uniform size 1M;

Altere o shared pool para nova realidade.

SQL> alter system set shared_pool_size = 80M scope=spfile;

Instale a opcao do XML.

SQL> set feedback off
SQL> @?/rdbms/admin/catqm.sql senha_xml xmldb_ts temp

Confirme se esta OK:

select comp_name “Component” from dba_registry;
Component
——————————————
Oracle Database Catalog Views
Oracle Database Packages and Types
Oracle XML Database

Se ocorrer problemas, reinstale.

SQL> @?/rdbms/admin/catnoqm
SQL> alter tablespace XMLDB_TS offline;
SQL> drop tablespace XMLDB_TS including contents;

#############

O script catqm, cria:

As can be seen, XML DB is not installed. XML DB can be installed with the database configuration assistant (dbca) or by calling the catqm.sql script. catqm stands for catalog script for sQl xMl management.

the user xdb
the user anonymous (at least in 10gR1)
the role xdbadmin,
and some tables in the xdb schema
xml db related static views.
dbms_xmldom
dbms_xmlparser
dbms_xmlschema
dbms_regxdb
dbms_xdb
dbms_xdbutil_int
dbms_xdbz
dbms_xdbz0
dbms_version
The dbms_xmldom_lib library
The xmlschema_lib library
Various XDB$* types
The xml-extension-type28_T type
The XDB$XMLTYPE_REF_LIST_T type