System Info
>
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 18 06:21:00 2012
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
>
Background
In a previous issue (
10468396 it was suggested that I move to an Object-Relational storage model for my XML data to alleviate an XVM Stack Overflow (memory) issue.
Problem
I have a table with an XML column which is stored OR:
SQL> desc nads_x;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER
OWNING_ORI NOT NULL VARCHAR2(9)
DATA_INTERNAL NOT NULL SYS.XMLTYPE(XMLSchema "http:
//fbi.gov/cjis/N-DEx/nsidm/1
.1" Element "DataItem") STOR
AGE Object-relational TYPE "
DataItemType1922_T"
I have successfully loaded records into this new structure; however, I have found records which load but appear to be corrupted as a subsequent query returns the following error:
SQL> SELECT DATA_INTERNAL FROM NADS_X WHERE ID=5942955;
Errors in file :
OCI-21500: internal error code, arguments: [qmxiAddToXob3], [], [], [], [], [], [], []
????????????????ERROR:
OCI-21500: internal error code, arguments: [qmxiAddToXob3], [], [], [], [], [],
[], []
I have extracted the XML instance from the record above (from a binary instance I had previous to importing into the OR structure) and found that there is an empty element (<Narrative/>) which appears to be causing the problem. If I remove this empty element and load the XML instance anew I can query the XML instance as expected.
The <Narrative/> element is defined as follows in my schema:
<xsd:element name="Narrative" type="narrativeType" minOccurs="0" maxOccurs="unbounded"/>
...
<xsd:simpleType name="narrativeType" xdb:SQLType="CLOB" >
<xsd:restriction base="clobType" />
</xsd:simpleType>
<xsd:simpleType name="clobType" xdb:SQLType="CLOB">
<xsd:restriction base="xsd:string"></xsd:restriction>
</xsd:simpleType>
...
and generated within the database as:
SQL> desc "DataItemType1922_T"
"DataItemType1922_T" is NOT FINAL
Name Null? Type
----------------------------------------- -------- ----------------------------
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
guid VARCHAR2(4000 CHAR)
...
Narrative CLOB
...
Can anyone explain to me if this is 1) correct behavior (e.g. are empty elements not allowed/supported with OR structure) or 2) is there something wrong with how I've defined my OR structure?
Edited by: drad on Aug 9, 2012 7:29 AM