After DBMS_XMLSCHEMA.copyEvolve the resources in the Repository become NULL (Doc ID 1438438.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Server - Enterprise Edition - Version: 11.2.0.2 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms


After DBMS_XMLSCHEMA.copyEvolve the resources in the Repository become NULL:

sqlplus ovid/ovid
SELECT XDBURIType('/000000006250.xml').getXML() as journal_xml FROM DUAL;

JOURNAL_XML
--------------------------------------------------------------------------------


Description:

Having a table of XMLType conforming to an XML Schema and updating xdbconfig.xml adding the root element so the new xml files posted into the Repository also go into this table:


Steps:

1. Register XSDs and Create the table

(Register XSDs)

CREATE TABLE JOURNAL OF XMLType
XMLTYPE STORE AS BINARY XML
XMLSCHEMA "http://ssr.ovid.com/schemas/journal/WKH_JOURNAL.xsd"
ELEMENT "journal";

2. Add the root element to the xddconfig.xml so the xml files posted into the repository go into the table

<schemaLocation-mappings>
<schemaLocation-mapping>
<namespace/>
<element>article</element>
<schemaURL>http://ssr.ovid.com/schemas/article/WKH_ARTICLE.xsd</schemaURL>
</schemaLocation-mapping>
<schemaLocation-mapping>
<namespace/>
<element>index</element>
<schemaURL>http://ssr.ovid.com/schemas/index/WKH_INDEX.xsd</schemaURL>
</schemaLocation-mapping>
<schemaLocation-mapping>
<namespace/>
<element>toc</element>
<schemaURL>http://ssr.ovid.com/schemas/toc/WKH_TOC.xsd</schemaURL>
</schemaLocation-mapping>
<schemaLocation-mapping>
<namespace/>
<element>journal</element>
<schemaURL>http://ssr.ovid.com/schemas/journal/WKH_JOURNAL.xsd</schemaURL>
</schemaLocation-mapping>
</schemaLocation-mappings>

Load the new modified xdbconfig.xml to XDB Repository


3. Load to the repository also the new XSDs for Evolution

ftp -n
open machine.us.oracle.com 2100
user ovid ovid
put WKH_JOURNAL1.2.1.xsd

4. Run the copyEvolve

sqlplus ovid/ovid

ALTER SESSION SET XML_DB_EVENTS = DISABLE;
ALTER SESSION SET RECYCLEBIN = OFF;

BEGIN
DBMS_XMLSCHEMA.copyEvolve(
xdb$string_list_t('http://ssr.ovid.com/schemas/journal/WKH_JOURNAL.xsd'),
XMLSequenceType(XDBURIType('/WKH_JOURNAL1.2.1.xsd').getXML()),
NULL,
TRUE,
'JOURNAL_BACKUP11712',
FALSE,
FALSE,
xdb$string_list_t('OVID'),
10,
DBMS_XMLSCHEMA.COPYEVOLVE_BINARY_XML
);
END;
/

-- Completed successfully

5. The content of the xml files posted into the repository is gone:

sqlplus ovid/ovid
SELECT XDBURIType('/000000006250.xml').getXML() as journal_xml FROM DUAL;

JOURNAL_XML
--------------------------------------------------------------------------------

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms