My Oracle Support Banner

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

Last updated on JULY 20, 2021

Applies to:

Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Oracle Database Cloud Service - Version N/A 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.<DOMAIN> 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

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.