Generate XPaths from an XMLType column?
Is it possible to load an XML schema into an XMLType column and then generate a list of all the XPaths in that schema?
If so how can this be done:?
kcuster,
Here is how you could load it. Maybe someone else has some ideas on generating the XPaths.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
SQL> create table testxsd
2 (schema xmltype);
Table created.
/orasw/admin/DDBA/xmltestcase 167$more vehicle.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.test.ch/a" xmlns:abc="http://www.test.ch/
a" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Vehicle" type="abc:VehicleType"/>
<xs:complexType name="VehicleType">
<xs:sequence>
<xs:element name="ID" type="xs:int"/>
<xs:element name="Name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
SQL> insert into testxsd
2 values (xmltype(getmultixml('vehicle.xsd')));
1 row created.
SQL> SQL> set long 3000
SQL> select * from testxsd;
SCHEMA
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.test.ch/a" xmlns:abc="http://www.test.ch/a" xmlns:xs="http://
www.w3.org/2001/XMLSchema">
<xs:element name="Vehicle" type="abc:VehicleType"/>
<xs:complexType name="VehicleType">
<xs:sequence>
<xs:element name="ID" type="xs:int"/>
<xs:element name="Name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
SCHEMA
</xs:schema>
SQL>
Similar Messages
-
Is it possible to remove XMLSchema restriction from an XMLType column?
I have an XMLType column that is validated via some XMLSchema. Now I want to remove this restriction and make it just a generic XMLType column.
I tried bunch of alter table commands but I couldn't figure out the magic combination.
Is this possible?
Here is the actual problem. Unfortunately, we ended up both local and global schemas using the same URL. We have customers
out there with both schemas (early customers) or only global schema (new customers). Most of the tables were created before the global schema
was added. So, they are referencing the local schema. Now we want to evolve our schema, and I am trying to write a sql script to clean-up this mess.
My plan is:
if only global schema exists then (these are late customers)
- do nothing
else if both global and local schema exist then (these are early customers)
- If any table or table.column has dependency on local schema (I can find this out from user_dependencies) I am going to mark those
tables/columns as no schema validated. i.e. remove all references to local schema
- delete and purge the local schema
- modify those tables/columns and make them point to the global schema
end if
- evolve the schema (only global one is left)
Is there a better way/plan? Is there a way to modify a column definition and move its reference from local schema to global schema where
both schemas have the same URL?
Of course the main constraint is that we do not want to loose customer data. By the way, both local and global schemas are identical in terms of xsd.
I guess a more generic question would be, is it possible to change XMLSchema/Element settings of an XMLType column from X to Y, X to null, or null to X? (Of course the assumption is Y is a superset of X.)Couple of Questions ?
Which verson of the database...
Are you using the XML DB repository to provide path based access to the XML Content.
In general
1. You cannot break the associated between a table and it's schema..
So if I understand waht you want to do you will have to do something different..
Copy the data into a non schema based table (Either XMLType Store AS CLOB or XMLType store as SecureFile Binary XML).
YOu probably want to invoke the createNonSchemaBasedXML() operator when inserting the XML non schema based table.
Once all the data is copied, delete and purge the local schema, and all of it's types and tables.
Create a new table based on the Global Schema.
Copy the database back into the new table..
I know two data copies are a PITA, but I can think of no other way of doing this. The Schema Based XML representation contains references that can only be decoded by using the XML Schema that was used to encode the references. This appies to both Schema Based Binary XML and Object Relational Storage. -
How to data from SYS.XMLType column in database.
Using BPEL 10.1.3.1
I have a database adapter to a table in my oracle database that has several columns. One column (named 'xml_content') in the table is the type SYS.XMLTYPE.
When I invoke the database adapter in BPEL the value always returns the following:
<xmlContent>oracle.xml.parser.v2.XMLDocument@18eba9f</xmlContent>
I need help with the steps to actually retrieve the value (either in string format, or xml).
Nothing seems to document working with SYS.XMLTYPE columns in BPEL.
Thanks!
MikeGot it working now. I used the 'extract' function in my select statement, but had to add the .getStringValue() fuction. The extract function, just by itself, returns an XMLDocument type. The call for the column in the SQL statement looked like this.
extract(XML_CONTENT, '/ROOTOBJECT').getStringVal() xml_content
Thanks so much for your help. Problem solved! -
How to retrive relational data from an XMLType column in Oracle 10g R2
Hi
I want how to retrive the data which is in XML document in an XMLColumn in a Table(or an XMLTable which has the XML Document). This XML Document has to be Queried with XQuery as a Relational data(not an XML Document).
If any body has some ideas please share it across ASAP.
please share an example for this because i am new to this XQuery.
Thanks in Expectation,
Selva.Got it working now. I used the 'extract' function in my select statement, but had to add the .getStringValue() fuction. The extract function, just by itself, returns an XMLDocument type. The call for the column in the SQL statement looked like this.
extract(XML_CONTENT, '/ROOTOBJECT').getStringVal() xml_content
Thanks so much for your help. Problem solved! -
Issues with selecting value from XMLType column
I want to retrieve values from my XMLType column. Can anyone tell me why this works
select XMLCAST
XMLQUERY
'declare default element namespace "urn:hl7-org:v3"; (: :)
declare namespace voc = "urn:hl7-org:v3/voc"; (: :)
$doc/ClinicalDocument/recordTarget/patientRole/patient/name/family'
passing CCD_DOC as "doc"
returning content
as VARCHAR2(4000)
from CCDbut this doesn't?
select
ccdid,
extractvalue(CCD_DOC,'/recordTarget/patientRole/patient/name/given') "given",
extractvalue(CCD_DOC,'/recordTarget/patientRole/patient/name/family') "family",
extractvalue(CCD_DOC,'/recordTarget/patientRole/providerOranization/name') "name",
extractvalue(CCD_DOC, 'title') as Title
from CCDwhere ClinicalDocument is the root element?
I don't get any errors from the second one but the three XML-derived columns are null. The values are not retrieved while the values ARE retrieved using the first method.
Thanks!XMLTable..
select x.*
from CCD,
XMLTable
xmlNamespaces
default 'urn:hl7-org:v3',
'urn:hl7-org:v3/voc' as "voc"
'$doc/ClinicalDocument/recordTarget/patientRole'
passing CCD_DOD as "doc"
columns
given varchar2(128) path 'patient/name/given',
family varchar2(128) path 'patient/name/family',
name varchar2(128) path 'providerOranization/name'
) x -
Issue with extractvalue from table with XMLTYPE column.
I'm sure there is a simple answer but I am having problems
retrieving data from an xmltype column type.
I have two tables
descr dab_xmlName
TABLE of XMLTYPE
descr dab_testName
A NUMBER
AB NUMBER
DATA CLOB
DATA2 VARCHAR2(1600)
MYXML XMLTYPE
I have inserted the Oracle example XML purchaseOrder.xml into both dab_xml
and the myxml column in dab_test.
When I run the following:
SELECT extractvalue(OBJECT_VALUE, '/PurchaseOrder/Reference')
FROM dab_xml;
SBELL-2002100912333601PDT is returned
When I run this:
SELECT extractvalue(OBJECT_VALUE, '/PurchaseOrder/Reference')
FROM (select myxml from dab_test);
ERROR at line 1:
ORA-00904: "OBJECT_VALUE": invalid identifier
Why are the two different?
Any help will be appreciated.
Regards,
DavidIn short you want
SELECT extractvalue(myxml, '/PurchaseOrder/Reference')
FROM dab_test;This difference is that for dab_xml, there are no columns defined for the table, therefore you are [OBJECT_VALUE|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/pseudocolumns006.htm#sthref830] as an alias for a non existent column.
With dab_test, you have a column that contains the XML so you need to use that column name instead of OBJECT_VALUE. -
Problem deleting from table with xmltype column
Hi,
Using a standard, simple screen (generated from JHeadstart), I don't seem to be able to delete from a table including an xmltype column. I have tried it even with a very simple mock table with only one column, an xmltype column, and every time I check the "delete" box and click "save", I get the following error:
oracle.jbo.RowInconsistentException: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[33 ].
I have tried this in the JDeveloper application module tester too and the result is the same.
Is it possible to delete a row from a table with an xmltype column? Am I doing something wrong? Is there something special needs done?
As I say, I did this with a one-xmltype-column table using the "Business Components from Tables" wizard, accepting all the defaults.
Thanks,
DarrenIn short you want
SELECT extractvalue(myxml, '/PurchaseOrder/Reference')
FROM dab_test;This difference is that for dab_xml, there are no columns defined for the table, therefore you are [OBJECT_VALUE|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/pseudocolumns006.htm#sthref830] as an alias for a non existent column.
With dab_test, you have a column that contains the XML so you need to use that column name instead of OBJECT_VALUE. -
Read xml-structure from a xml-document stored in a xmltype-column?
Hello,
I have several xml-documents stored in a table with a xmltype-column.
Is it possible to read the structure of one xml-document? I need to know what data are exists in the xml-documents.
I had read some hours here, but I dont find a suitable solution for that.
To make a example, what I need:
I have stored the following xml-document in the table:
<?xml version = '1.0'?>
<ROWSET>
<ROW num="6">
<EMPLOYEE_ID>105</EMPLOYEE_ID>
<FIRST_NAME>David</FIRST_NAME>
<LAST_NAME>Austin</LAST_NAME>
<EMAIL>DAUSTIN</EMAIL>
<PHONE_NUMBER>590.423.4569</PHONE_NUMBER>
<HIRE_DATE>6/25/1997 0:0:0</HIRE_DATE>
<JOB_ID>IT_PROG</JOB_ID>
<SALARY>4800</SALARY>
<MANAGER_ID>103</MANAGER_ID>
<DEPARTMENT_ID>60</DEPARTMENT_ID>
</ROW>
</ROWSET>
I need to return the following:
ROWSET
...ROW
......EMPLOYEE NUMBER
......FIRST_NAME VARCHAR2
......DEPARTMENT_ID NUMBER
Regards,
MarkHi,
I was on a wrong way. The datatype is not stored in xml, this was a mistake from me.
I needed something to printout some values from a xml-file. This xml-file was generated bei MS Excel. The data are in /Workbook/Worksheet/Table/Cell and I didnt know how to access it.
I write for that the following:
DECLARE
v_xml XMLType;
v_doc dbms_xmldom.DOMDocument;
v_node dbms_xmldom.DOMNode;
type t_values is table of varchar2(2000) index by binary_integer;
v_values t_values;
type t_table is table of t_values index by binary_integer;
v_table t_table;
procedure node_output (v_node in out dbms_xmldom.DOMNode)
is
v_nodelist1 DBMS_XMLDOM.DOMNodeList;
v_nodelist2 DBMS_XMLDOM.DOMNodeList;
v_anzahlnodes number;
v_anzahlrows number;
v_node_c dbms_xmldom.DOMNode;
v_xmlmitarbeiterid number;
begin
v_nodelist1 := dbms_xmldom.GETCHILDNODES(v_node);
v_anzahlrows := DBMS_XMLDOM.GETLENGTH(v_nodelist1);
if v_anzahlrows = 0 or DBMS_XMLDOM.GETNODENAME(v_node) = 'Table'
then
if v_anzahlrows > 0
then
for i1 in 0..v_anzahlrows - 1
loop
v_node := dbms_xmldom.Item(v_nodelist1,i1);
v_nodelist2 := dbms_xmldom.GETCHILDNODES(v_node);
v_anzahlnodes := DBMS_XMLDOM.GETLENGTH(v_nodelist2);
for i2 in 0..v_anzahlnodes - 1
loop
v_node := dbms_xmldom.Item(v_nodelist2,i2);
v_node_c := dbms_xmldom.GETFIRSTCHILD(v_node);
v_node_c := dbms_xmldom.GETFIRSTCHILD(v_node_c);
v_values(i2) := DBMS_XMLDOM.GETNODEVALUE(v_node_c);
end loop;
v_table(i1) := v_values;
end loop;
for i1 in 1..v_anzahlrows - 1
loop
select SEQ_XMLMITARBEITER.nextval into v_xmlmitarbeiterid from dual;
for i2 in 1..v_table(i1).count - 1
loop
dbms_output.put_line(v_table(i1)(i2));
end loop;
end loop;
end if;
else
v_node := dbms_xmldom.GETFIRSTCHILD(v_node);
for i in 0..v_anzahlrows - 1
loop
v_node := dbms_xmldom.Item(v_nodelist1,i);
node_output(v_node);
end loop;
end if;
end;
BEGIN
select inhalt into v_xml FROM xmlimport WHERE name = 'F23973/mitarbeiter.xml';
v_doc := dbms_xmldom.newDOMDocument(v_xml);
v_node:= dbms_xmldom.makeNode(dbms_xmldom.getDocumentElement(v_doc));
node_output(v_node);
END;
This gives me all data from a xml-Excel-file. Is there a better way to do that? I have Oracle 10.2.
Regards,
Mark -
ORA-00600 occurs on an extract from a large xmlType column
When running the extract() function where search criteria has been specified (for an existing node), I receive the following error:
ORA-00600: internal error code, arguments: [qmxdMatchingChildren:overflow-1],[], [], [], [], [], [], []
However, if I remove the search criteria, the fragment returns no error.
Both queries have been working successfully on smaller documents.
Example with criteria:
SELECT extract(tab.xml_text,'//item[@val="2.1.2.2"]') ITEM
FROM CUR.ITEMS tab
WHERE item_id =271;
Example without criteria:
SELECT extract(tab.xml_text,'//item') ITEM
FROM CUR.ITEMS tab
WHERE item_id =271;
I'm estimating that the document inside the xmltype column is 4MB.
The database is Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production With the Partitioning, OLAP and Data Mining options.Jennifer,
You may be encountering the following bug:
Bug# 3617191 See Note 3617191.8
OERI[qmxdmatchingchildren:overflow-1] using EXTRACT from large XML document
Fixed: 10.1.0.4, 10.2 -
DirectToXMLTypeMapping "create-tables" not generating XMLTYPE column type
Can someone tell me how to code an XMLTYPE field such that "create-tables" will generate the XMLTYPE column and such that the IntegrityChecker will not throw an error.
I am forced to run these alters after "create-tables" is run.
ALTER TABLE XML_SYS_MSG drop column message;
ALTER TABLE XML_SYS_MSG add (message XMLType);
Snippets:
<persistence...
<property name="eclipselink.ddl-generation" value="create-tables" />
</persistence>
public class XmlMessageCustomizer implements DescriptorCustomizer {
@Override
public void customize(final ClassDescriptor descriptor) throws Exception {
final DirectToXMLTypeMapping mapping = new DirectToXMLTypeMapping();
descriptor.removeMappingForAttributeName("message");
// name of the attribute
mapping.setAttributeName("message");
// IntegrityChecker requires uppercase for oracle
// name of the column
mapping.setFieldName("MESSAGE");
descriptor.addMapping(mapping);
@Entity(name = "XmlMessage")
@Table(name = "XML_MSG")
@Customizer(XmlMessageCustomizer.class)
public class XmlMessage {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
private long id;
// @Column(columnDefinition = "XMLTYPE")
// private String message;
// ALTER TABLE XML_SYS_MSG drop column message;
// ALTER TABLE XML_SYS_MSG add (message XMLType);
private Document message;
public XmlMessage() {
public long getId() {
return id;
public void setId(final long id) {
this.id = id;
public Document getMessage() {
return message;
public void setMessage(final Document message) {
this.message = message;
Secondly if I turn on the IntegrityChecker it will fail
public class EnableIntegrityChecker implements SessionCustomizer {
@Override
public void customize(final Session session) throws Exception {
session.getIntegrityChecker().checkDatabase();
session.getIntegrityChecker().setShouldCatchExceptions(false);
}Adding:
mapping.getField().setColumnDefinition("XMLTYPE");to the customizer should solve the problem.
--Shaun -
Difficulty extracting from XMLTYPE column using XMLTABLE
Hi Folks.
I am currently trying to shred the contents of an XML document that is stored on our schema in a XMLType column. The XMLYTYPE column is pointing to several schemas that are registered within the database.
If I take a subset of the XML from one of the files and create an XMLTYPE column on the fly, I am able to extract data using the XMLTABLE syntax. If I try the same thing on the XMLTYPE column in the table registered to schemas stored in the database I get no joy.
Please see below for an example.
Please note that this is only a small segment of the original XML document which is very large. The XML document has one <RTDRFileHeader> and <ConnectionList> nodes per document but many <Connection> nodes beneath the <ConnectionList>.
My requirement is to RETRIEVE ALL the data contained in the <Connection> elements beneath the <ConnectionList>. How do I achieve this?
CREATE TABLE ag_test2 as
SELECT XMLTYPE(
'<RTDR xmlns:tadig-gen="https://infocentre.gsm.org/TADIG-GEN" xmlns="https://infocentre.gsm.org/TADIG-RTDR">
<RTDRFileHeader>
<Prefix>MRTDR</Prefix>
<Sender>EDSCH</Sender>
<Recipient>NXTMP</Recipient>
<PMN>UKRAS</PMN>
<ReportSeqNo>5</ReportSeqNo>
<TADIGGenSchemaVersion>2.2</TADIGGenSchemaVersion>
<RTDRSchemaVersion>1.1</RTDRSchemaVersion>
<CreationTmstp>2009-09-04T04:04:00.000000+02:00</CreationTmstp>
</RTDRFileHeader>
<ConnectionList xmlns="https://infocentre.gsm.org/TADIG-RTDR">
<Connection xmlns="https://infocentre.gsm.org/TADIG-RTDR">
<VPMN>UKRAS</VPMN>
<HPMN>LIEK9</HPMN>
<FileItemList>
<FileItem>
<FileID>CDUKRASLIEK901274-00005-m</FileID>
<ExchTmstp>2009-08-24T12:07:22.000000+02:00</ExchTmstp>
<FileType>
<InitTAP>
<TAPSeqNo>1274</TAPSeqNo>
<NotifFileInd>true</NotifFileInd>
<ChargeInfo>
<TAPTxCutoffTmstp>2009-08-24T12:52:10.000000+03:00</TAPTxCutoffTmstp>
<TAPAvailTmstp>2009-08-24T11:52:10.000000+02:00</TAPAvailTmstp>
<TAPCurrency>SDR</TAPCurrency>
<TotalNetCharge>0</TotalNetCharge>
<TotalTax>0</TotalTax>
</ChargeInfo>
</InitTAP>
</FileType>
</FileItem>
<FileItem>
<FileID>CDUKRASLIEK901280-00005-m</FileID>
<ExchTmstp>2009-08-30T12:14:39.000000+02:00</ExchTmstp>
<FileType>
<InitTAP>
<TAPSeqNo>1280</TAPSeqNo>
<NotifFileInd>true</NotifFileInd>
<ChargeInfo>
<TAPTxCutoffTmstp>2009-08-30T12:52:34.000000+03:00</TAPTxCutoffTmstp>
<TAPAvailTmstp>2009-08-30T11:52:34.000000+02:00</TAPAvailTmstp>
<TAPCurrency>SDR</TAPCurrency>
<TotalNetCharge>0</TotalNetCharge>
<TotalTax>0</TotalTax>
</ChargeInfo>
</InitTAP>
</FileType>
</FileItem>
</FileItemList>
</Connection>
</ConnectionList>
</RTDR> ') as xml from dual
Question: When I run the following query no rows are returned although the table is populated with XML segment above. Any explanation as to why and how can I resolve this?
SELECT rtd2."VPMN"
,rtd2."Recipient"
,rtd2."ReportSeqNo"
FROM ag_test2 r
,XMLTABLE('/RTDR'
PASSING r.xml
COLUMNS "VPMN" VARCHAR2(5) PATH '/RTDRFileHeader/ConnectionList/Connection/VPMN'
,"Recipient" VARCHAR2(5) PATH '/RTDRFileHeader/Recipient'
,"ReportSeqNo" INTEGER PATH '/RTDRFileHeader/ReportSeqNo'
) rtd2; From my other investigations the following query works OK when the same XML segment is created dynamically by performing an SELECT XMLTYPE ... FROM DUAL compared to the method above. Can anybody provide an explanation?
WITH t as (select XMLTYPE(
'<RTDR>
<RTDRFileHeader>
<Prefix>MRTDR</Prefix>
<Sender>EDSCH</Sender>
<Recipient>NXTMP</Recipient>
<PMN>UKRAS</PMN>
<ReportSeqNo>5</ReportSeqNo>
<TADIGGenSchemaVersion>2.2</TADIGGenSchemaVersion>
<RTDRSchemaVersion>1.1</RTDRSchemaVersion>
<CreationTmstp>2009-09-04T04:04:00.000000+02:00</CreationTmstp>
</RTDRFileHeader>
<ConnectionList>
<Connection>
<VPMN>UKRAS</VPMN>
<HPMN>LIEK9</HPMN>
<FileItemList>
<FileItem>
<FileID>CDUKRASLIEK901274-00005-m</FileID>
<ExchTmstp>2009-08-24T12:07:22.000000+02:00</ExchTmstp>
<FileType>
<InitTAP>
<TAPSeqNo>1274</TAPSeqNo>
<NotifFileInd>true</NotifFileInd>
<ChargeInfo>
<TAPTxCutoffTmstp>2009-08-24T12:52:10.000000+03:00</TAPTxCutoffTmstp>
<TAPAvailTmstp>2009-08-24T11:52:10.000000+02:00</TAPAvailTmstp>
<TAPCurrency>SDR</TAPCurrency>
<TotalNetCharge>0</TotalNetCharge>
<TotalTax>0</TotalTax>
</ChargeInfo>
</InitTAP>
</FileType>
</FileItem>
<FileItem>
<FileID>CDUKRASLIEK901280-00005-m</FileID>
<ExchTmstp>2009-08-30T12:14:39.000000+02:00</ExchTmstp>
<FileType>
<InitTAP>
<TAPSeqNo>1280</TAPSeqNo>
<NotifFileInd>true</NotifFileInd>
<ChargeInfo>
<TAPTxCutoffTmstp>2009-08-30T12:52:34.000000+03:00</TAPTxCutoffTmstp>
<TAPAvailTmstp>2009-08-30T11:52:34.000000+02:00</TAPAvailTmstp>
<TAPCurrency>SDR</TAPCurrency>
<TotalNetCharge>0</TotalNetCharge>
<TotalTax>0</TotalTax>
</ChargeInfo>
</InitTAP>
</FileType>
</FileItem>
</FileItemList>
</Connection>
</ConnectionList>
</RTDR> ') as xml from dual )
SELECT rtd2."VPMN"
,rtd2."HPMN"
FROM t r
,XMLTABLE('/RTDR/ConnectionList'
PASSING r.xml
COLUMNS "VPMN" VARCHAR2(5) PATH '/ConnectionList/Connection/VPMN'
,"HPMN" VARCHAR2(5) PATH '/ConnectionList/Connection/HPMN'
) rtd2;
Any comments, suggestions, pointers gratefully received.
Many thanks
Kind regards
Simon GaddSimon
It appears to work as expected for me in 11.2.0.1.0
C:\xdb\customers\Mapeley>sqlplus /nolog @testcase %CD%
SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 18 14:26:56 2009
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> spool testase.log
SQL> --
SQL> connect / as sysdba
Connected.
SQL> --
SQL> set define on
SQL> set timing on
SQL> --
SQL> define USERNAME = MAPELEY
SQL> --
SQL> def PASSWORD = &USERNAME
SQL> --
SQL> def XMLDIR = &1
SQL> --
SQL> def USER_TABLESPACE = USERS
SQL> --
SQL> def TEMP_TABLESPACE = TEMP
SQL> --
SQL> drop user &USERNAME cascade
2 /
old 1: drop user &USERNAME cascade
new 1: drop user MAPELEY cascade
User dropped.
Elapsed: 00:00:04.57
SQL> grant create any directory, drop any directory, connect, resource, alter se
ssion, create view to &USERNAME identified by &PASSWORD
2 /
old 1: grant create any directory, drop any directory, connect, resource, alte
r session, create view to &USERNAME identified by &PASSWORD
new 1: grant create any directory, drop any directory, connect, resource, alte
r session, create view to MAPELEY identified by MAPELEY
Grant succeeded.
Elapsed: 00:00:00.03
SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespa
ce &TEMP_TABLESPACE
2 /
old 1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tabl
espace &TEMP_TABLESPACE
new 1: alter user MAPELEY default tablespace USERS temporary tablespace TEMP
User altered.
Elapsed: 00:00:00.00
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> create or replace directory XMLDIR as '&XMLDIR'
2 /
old 1: create or replace directory XMLDIR as '&XMLDIR'
new 1: create or replace directory XMLDIR as 'C:\xdb\customers\Mapeley'
Directory created.
Elapsed: 00:00:00.01
SQL> var SCHEMAURL varchar2(256)
SQL> VAR XMLSCHEMA CLOB;
SQL> VAR INSTANCE CLOB;
SQL> VAR DOCPATH VARCHAR2(700)
SQL> --
SQL> set define off
SQL> --
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
Elapsed: 00:00:00.01
SQL> declare
2 XMLSCHEMA XMLTYPE := XMLTYPE(bfilename('XMLDIR','tadig_gen_2.2.xsd'),NLS_
CHARSET_ID('AL32UTF8'));
3 begin
4 :SCHEMAURL:= 'tadig-gen-2.2.xsd';
5 xdb_annotate_schema.disableDefaultTables(XMLSCHEMA);
6 dbms_xmlschema.registerSchema
7 (
8 schemaurl => :SCHEMAURL,
9 schemadoc => XMLSCHEMA,
10 local => TRUE,
11 genTypes => TRUE,
12 genBean => FALSE,
13 genTables => TRUE
14 );
15 end;
16 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.17
SQL> declare
2 XMLSCHEMA XMLTYPE := XMLTYPE(bfilename('XMLDIR','tadig_rtdr.xsd'),NLS_CHA
RSET_ID('AL32UTF8'));
3 begin
4 :SCHEMAURL:= 'tadig_rtdr.xsd';
5 xdb_annotate_schema.addDefaultTable(XMLSCHEMA,'RTDR','RTDR_TABLE');
6 xdb_annotate_schema.disableDefaultTables(XMLSCHEMA);
7 dbms_xmlschema.registerSchema
8 (
9 schemaurl => :SCHEMAURL,
10 schemadoc => XMLSCHEMA,
11 local => TRUE,
12 genTypes => TRUE,
13 genBean => FALSE,
14 genTables => TRUE
15 );
16 end;
17 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:05.66
SQL> select table_name
2 from USER_XML_TABLES
3 /
TABLE_NAME
RTDR_TABLE
Elapsed: 00:00:00.04
SQL> select count(*)
2 from USER_NESTED_TABLES
3 /
COUNT(*)
17
Elapsed: 00:00:00.43
SQL> desc RTDR_TABLE
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "tadig_rtdr.xsd" Element "RTDR") STORAGE Object-r
elational TYPE "RTDR8050_T"
SQL> --
SQL> insert into RTDR_TABLE values (XMLTYPE(bfilename('XMLDIR','MRTDREDSCHNXTMPU
KRAS00001.xml'),NLS_CHARSET_ID('AL32UTF8')))
2 /
1 row created.
Elapsed: 00:00:16.91
SQL> commit
2 /
Commit complete.
Elapsed: 00:00:00.01
SQL> set autotrace on explain lines 256 long 100000 pages 0
SQL> --
SQL> SELECT rtd3."VPMN"
2 ,rtd2."Recipient"
3 ,rtd2."ReportSeqNo"
4 FROM RTDR_TABLE r
5 ,XMLTABLE
6 (
7 xmlnamespaces
8 (
9 default 'https://infocentre.gsm.org/TADIG-RTDR'
10 ),
11 '/RTDR'
12 PASSING r.object_value
13 COLUMNS
14 "ConnectionXML" XMLTYPE PATH 'ConnectionList/Connection'
15 ,"Recipient" VARCHAR2(5) PATH 'RTDRFileHeader/Recipient'
16 ,"ReportSeqNo" INTEGER PATH 'RTDRFileHeader/ReportSeqNo'
17 ) rtd2
18 ,XMLTABLE
19 (
20 xmlnamespaces
21 (
22 default 'https://infocentre.gsm.org/TADIG-RTDR'
23 ),
24 '/Connection'
25 PASSING rt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 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
UKRAS NXTMP 1
641 rows selected.
Elapsed: 00:00:01.15
Execution Plan
Plan hash value: 3612307998
| Id | Operation | Name | Rows | Bytes | Co
st (%CPU)| Time |
| 0 | SELECT STATEMENT | | 641 | 2539K|
9 (12)| 00:00:01 |
|* 1 | HASH JOIN | | 641 | 2539K|
9 (12)| 00:00:01 |
|* 2 | TABLE ACCESS FULL| RTDR_TABLE | 1 | 2045 |
3 (0)| 00:00:01 |
| 3 | TABLE ACCESS FULL| SYS_NTeF0jsoIcQsOueVI+sFGk0g== | 641 | 1259K|
5 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - access("SYS_ALIAS_0"."NESTED_TABLE_ID"="RTDR_TABLE"."SYS_NC0002300024$")
2 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.
w3.org/2001/XMLSchema-insta
nce" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xd
b/dav.xsd"><read-properties
/><read-contents/></privilege>'))=1)
Note
- dynamic sampling used for this statement (level=2)
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64
bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\xdb\customers\Mapeley> -
Getting the system generated column name for xmltype column
Hello,
how i can get the internal column name (p.a. SYS_NC00001$) for a xmltype column? I cannot find a correct dictionary view .
I need that for moving a xmltype lob partition to another tablespace.
Thanks,
MaikRDoes the following help:
http://www.idevelopment.info/data/Oracle/DBA_tips/LOBs/LOBS_2.shtml
http://www.liberidu.com/blog/?p=264 -
Issues with using XMLType indexes against a table with XMLType column
I am attempting to use an XMLIndex with a Structured Component and not having too much luck. Not much data in metalink nor is the documentation very helpful:
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb_indexing.htm#BCGHGIGC
The table DDL is as follows:
CREATE TABLE ECI_SCHEMA.REV_ITEM_EARN_DTL_VIRTUAL(
REV_ITEM_EARN_DTL_ID_NBR NUMBER(16,0) NOT NULL,
UNIQ_MSG_ID_NBR VARCHAR2(50) NOT NULL,
REV_ITEM_BILL_DTL_ID_NBR NUMBER(16,0),
PLAN_RACN_NBR NUMBER(10,0) NOT NULL,
INV_DTL_IMG SYS.XMLType NOT NULL,
NON_INV_DTL_IMG BLOB NOT NULL,
PART_KEY_CD GENERATED ALWAYS AS (MOD(PLAN_RACN_NBR,5)) VIRTUAL,
LAST_UPDT_TMSTP TIMESTAMP(6) NOT NULL,
INV_ID_NBR NUMBER(16,0),
ITEM_STATUS_CD VARCHAR2(1) DEFAULT 'A' NOT NULL
LOB (NON_INV_DTL_IMG) STORE AS NON_IDI_LOB (CHUNK 8192 PCTVERSION 10 CACHE)
TABLESPACE ECI_DATA
PARTITION BY RANGE (PART_KEY_CD)
PARTITION RIED_DAY0_PART
VALUES LESS THAN (1)
TABLESPACE ECI_DATA
PARTITION RIED_DAY1_PART
VALUES LESS THAN (2)
TABLESPACE ECI_DATA
PARTITION RIED_DAY2_PART
VALUES LESS THAN (3)
TABLESPACE ECI_DATA
PARTITION RIED_DAY3_PART
VALUES LESS THAN (4)
TABLESPACE ECI_DATA
PARTITION RIED_MAXVAL_PART
VALUES LESS THAN (MAXVALUE)
TABLESPACE ECI_DATA
XMLTYPE COLUMN "INV_DTL_IMG" STORE AS OBJECT RELATIONAL
XMLSCHEMA "someXdbDocument.xsd"
ELEMENT "revenueInvoice"
According to the documentation, I should be able to create a structured XMLIndex on the XMLType column with the following syntax:
SQL> create index eci_schema.rev_item_earn_dtl_virt_xmlix on eci_schema.rev_item_earn_dtl_virtual
2 (INV_DTL_IMG)
3 INDEXTYPE IS XDB.XMLIndex
4 parameters ('PATH TABLE RIED_PATH_TABLE')
5 local;
When I do this, I get the following error:
create index eci_schema.rev_item_earn_dtl_virt_xmlix on eci_schema.rev_item_earn_dtl_virtual
ERROR at line 1:
ORA-29958: fatal error occurred in the execution of ODCIINDEXCREATE routine
ORA-30959: The indexed column is not stored in CLOB.
What am I doing wrong? Based on the Oracle documentation, I was under the impression that 11.2 XMLIndex would work with Object Relational storage. Is this not the case?CREATE INDEX ECI_SCHEMA.REV_ITEM_EARN_DTL_IX7
ON ECI_SCHEMA.REV_ITEM_EARN_DTL
extractValue(inv_dtl_img, '/revenueInvoice/service/transportation/mstrTrkngNbr')
TABLESPACE ECI_REV_ITEM_EARN_DTL_IX7_ITS
LOGGING
PARALLEL(DEGREE 8 INSTANCES 1)
LOCAL
/Elements that occur at most once in each document can be indexed using extractValue(). Despite the fact that the index appears to be a functional index, when we create the index we automatically re-write the create index into a normal btree index on the column that contains the value for the element identified by the xpath.
Eg in the case of a functional index based on extractValue, defined on XMLType using Object relational storage, with an xpath that identifies a node that occurs at most once in each document is not a functional index, it's re-written into a plain old vanilla btree index. You can actually check this by looking in the system tables
Eg
SQL> connect system/oracle
Connected.
SQL> select table_name, index_name from all_indexes where owner = 'OE' and table_name = 'PURCHASEORDER';
TABLE_NAME INDEX_NAME
PURCHASEORDER LINEITEM_TABLE_MEMBERS
PURCHASEORDER ACTION_TABLE_MEMBERS
PURCHASEORDER SYS_C0011037
SQL> alter session set current_schema = OE
2 /
Session altered.
SQL> create unique index PO_REF_INDEX on PURCHASEORDER (extractValue(object_value,'/PurchaseOrder/Reference'));
Index created.
SQL> set lines 250
SQL> select index_name, index_type from all_indexes where owner = 'OE' and table_name = 'PURCHASEORDER';
INDEX_NAME INDEX_TYPE
PO_REF_INDEX NORMAL
LINEITEM_TABLE_MEMBERS NORMAL
ACTION_TABLE_MEMBERS NORMAL
SYS_C0011037 NORMAL
SQL> select * from dba_ind_expressions where table_name = 'PURCHASEORDER' and index_owner = 'OE'
2 /
no rows selectedFrom the above we can see that the index created on extractValue has been re-written in a plain old vanilla BTREE index, and there is no definition for it in dba_ind_expressions So assuming you were able to create the index and insert the data you should find that your index is not a functional index.
] -
XMLType column based on XML Schema: several questions
Hi,
I've a table on an oracle db version 10.1.0.4 where I stage the xml files containing orders created on a third party's system using BizTalk.
Although the storage I opted for is based on an XML Schema, defined by this third-party, I am facing big perfomance issues with files bigger than a few hundreds of kBs.
For instance, a 32Mb file takes more than 2 hours to be processed.
Now, after reading other threads in this forum and the documentation, my understanding of the problem is that the whole issue is with the correct indexing of the nested tables.
Here is my current XML Schema definition:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xdb:storeVarrayAsTable="true">
<xs:include schemaLocation="private/Types.xsd"/>
<xs:element name="PickData">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="ProdRun">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Nr" type="xs:int"/>
<xs:element name="Date" type="string8"/>
<xs:element name="Final" type="xs:int"/>
<xs:element name="PickWave" maxOccurs="unbounded">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Nr" type="string10"/>
<xs:element name="ProdLine" type="string2"/>
<xs:element name="TourSeq" type="xs:int"/>
<xs:element name="Tour" type="string20"/>
<xs:element name="Customer" maxOccurs="unbounded">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Seq" type="string20"/>
<xs:element name="Cust" type="string10"/>
<xs:element name="Mod" type="string30"/>
<xs:element name="Tod" type="string30"/>
<xs:element name="InvOrder" maxOccurs="unbounded">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Nr" type="string20"/>
<xs:element name="Item" type="string20"/>
<xs:element name="Qty" type="xs:int"/>
<xs:element name="Priority" type="xs:int"/>
<xs:element name="Reordering" type="xs:int"/>
<xs:element name="DelDate" type="string8"/>
<xs:element name="HlOrder" type="string20"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="InvOrderKey">
<xs:selector xpath="InvOrder"/>
<xs:field xpath="Nr"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="CustomerKey">
<xs:selector xpath="Customer"/>
<xs:field xpath="Seq"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="PickWaveKey">
<xs:selector xpath="PickWave"/>
<xs:field xpath="Nr"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="ProdRunKey">
<xs:selector xpath="ProdRun"/>
<xs:field xpath="Nr"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Here is the included sub-schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="string2">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string5">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="5"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string6">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="6"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string8">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string10">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string15">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string20">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="20"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string30">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string40">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="40"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string50">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string250">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="250"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
The statement for creating my table is
CREATE TABLE "XML_ORDERS"
("ID" NUMBER(7,0) NOT NULL ENABLE,
"XMLFILE" "SYS"."XMLTYPE" ,
"INSERTED" DATE DEFAULT sysdate,
CONSTRAINT "XML_ORDERS_PK" PRIMARY KEY ("ID") USING INDEX ENABLE
) XMLTYPE COLUMN XMLFILE STORE AS OBJECT RELATIONAL
XMLSCHEMA "private/PickData.xsd" ELEMENT "PickData"
Here is a simple instance document:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<PickData xsi:noNamespaceSchemaLocation="private/PickData.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ProdRun>
<Nr>5</Nr>
<Date>15112005</Date>
<Final>1</Final>
<PickWave>
<Nr>IPW0000017</Nr>
<ProdLine>01</ProdLine>
<TourSeq>1</TourSeq>
<Tour>00000043_078</Tour>
<Customer>
<Seq>5</Seq>
<Cust>100000006</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000457</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000742</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000459</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000742</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>6</Seq>
<Cust>100000013</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000461</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000743</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000463</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000743</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>2</Seq>
<Cust>100000114</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000465</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000744</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000467</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000744</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>3</Seq>
<Cust>100000140</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000469</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000745</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000471</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000745</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>7</Seq>
<Cust>100000143</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000473</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000746</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000475</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000746</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>8</Seq>
<Cust>100000145</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000477</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000747</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000479</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000747</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>9</Seq>
<Cust>100000146</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000481</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>0</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000748</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000483</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000748</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>4</Seq>
<Cust>100000147</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000485</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>0</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000750</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000487</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000750</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>10</Seq>
<Cust>100000148</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000489</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>0</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000751</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000491</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000751</HlOrder>
</InvOrder>
</Customer>
</PickWave>
</ProdRun>
</PickData>
When I registered the XMLSchema, the following types and tables were automatically created and you can see the hierarchy below:
(by the way, I could not find any xdb_utilities.printNestedTables mentioned elsewhere)
XML_ORDERS
|_PickData381_T
|___ProdRun382_T
|_____PickWave388_COLL
|_______PickWave383_T
|_________Customer387_COLL
|___________Customer384_T
|_____________InvOrder386_COLL
These objects are then used in the following nested tables:
TABLE_NAME TABLE_TYPE_NAME PARENT_TABLE_NAME PARENT_TABLE_COLUMN
SYS_NTaK/5zar5S0WitSsgu6OKPQ== PickWave388_COLL PickData389_TAB "XMLDATA"."ProdRun"."PickWave"
SYS_NTf6QvwVm8SFKz+K/YYWq+WQ== Item408_COLL ProdData409_TAB "XMLDATA"."Item"
SYS_NTtu05ilrRQqmuEN4k+07VDA== Customer402_COLL OutboundParty403_TAB "XMLDATA"."Customer"
SYS_NTK6fhWq5uTJ+vKcgBpNm1Fg== InvOrder386_COLL SYS_NTIIzv7bkXQSSS43igtfi5eg== InvOrder
SYS_NTIIzv7bkXQSSS43igtfi5eg== Customer387_COLL SYS_NTaK/5zar5S0WitSsgu6OKPQ== Customer
I enabled sql tracing and I got the following TKPROF output
INSERT INTO IMP_ORDERS (PICK_INVORDERNR, PICK_ITEM, PICK_QTY, PICK_PRIORITY,
PICK_REORDERING, PICK_HLORDER, PICK_DELDATE, PICK_CUST, PICK_MOD, PICK_TOD,
PICK_SEQ, PICK_PICKWAVENR, PICK_PICKWAVEPRODLINE, PICK_PICKWAVETOUR,
PICK_PICKWAVETOURSEQ, PICK_ORDKEY, PICK_RUNKEY) SELECT INVORDERNR, ITEM,
QTY, PRIORITY, REORDERING, HLORDER, DELDATE, CUST, MOD, TOD, SEQ,
PICKWAVENR, PICKWAVEPRODLINE, PICKWAVETOUR, PICKWAVETOURSEQ, ROWNUM AS
PICK_ORDKEY, PRODRUNID FROM (SELECT /*+ cardinality(g 15)*/
EXTRACTVALUE(VALUE(G), '/InvOrder/Nr') AS INVORDERNR, EXTRACTVALUE(VALUE(G),
'/InvOrder/Item') AS ITEM, EXTRACTVALUE(VALUE(G), '/InvOrder/Qty') AS QTY,
EXTRACTVALUE(VALUE(G), '/InvOrder/Priority') AS PRIORITY,
EXTRACTVALUE(VALUE(G), '/InvOrder/Reordering') AS REORDERING,
EXTRACTVALUE(VALUE(G), '/InvOrder/HlOrder') AS HLORDER,
TO_DATE(EXTRACTVALUE(VALUE(G), '/InvOrder/DelDate'),'DDMMYYYY') AS DELDATE,
F.CUST, F.MOD, F.TOD, F.SEQ, F.PICKWAVENR, F.PICKWAVEPRODLINE,
F.PICKWAVETOUR, F.PICKWAVETOURSEQ, F.PRODRUNNR, F.PRODRUNDATE,
F.PRODRUNFINAL, F.PRODRUNID FROM (SELECT /*+ cardinality(e 60)*/VALUE(E) AS
CUSTOMERNODE, EXTRACTVALUE(VALUE(E), '/Customer/Cust') AS CUST,
EXTRACTVALUE(VALUE(E), '/Customer/Mod') AS MOD, EXTRACTVALUE(VALUE(E),
'/Customer/Tod') AS TOD, TO_NUMBER(EXTRACTVALUE(VALUE(E), '/Customer/Seq'))
AS SEQ, D.PICKWAVENR, D.PICKWAVEPRODLINE, D.PICKWAVETOUR, D.PICKWAVETOURSEQ,
D.PRODRUNNR, D.PRODRUNDATE, D.PRODRUNFINAL, D.PRODRUNID FROM (SELECT /*+
cardinality(c 100)*/VALUE(C) AS PICKWAVENODE, EXTRACTVALUE(VALUE(C),
'/PickWave/Nr') AS PICKWAVENR, TO_NUMBER(EXTRACTVALUE(VALUE(C),
'/PickWave/ProdLine')) AS PICKWAVEPRODLINE, EXTRACTVALUE(VALUE(C),
'/PickWave/Tour') AS PICKWAVETOUR, TO_NUMBER(EXTRACTVALUE(VALUE(C),
'/PickWave/TourSeq')) AS PICKWAVETOURSEQ, A.PRODRUNNR, A.PRODRUNDATE,
A.PRODRUNFINAL, A.PRODRUNID FROM (SELECT /*+ cardinality(b 1)*/VALUE(B) AS
PRODRUNNODE, EXTRACTVALUE(VALUE(B), '/ProdRun/Nr') AS PRODRUNNR,
TO_DATE(EXTRACTVALUE(VALUE(B), '/ProdRun/Date'),'DDMMYYYY') AS PRODRUNDATE,
EXTRACTVALUE(VALUE(B), '/ProdRun/Final') AS PRODRUNFINAL, X.ID PRODRUNID
FROM XML_ORDERS X, TABLE(XMLSEQUENCE(EXTRACT(X.XMLFILE,'/PickData/ProdRun'))
) B WHERE X.ID = :B1 ) A, TABLE(XMLSEQUENCE(EXTRACT(A.PRODRUNNODE,
'/ProdRun/PickWave'))) C ) D, TABLE(XMLSEQUENCE(EXTRACT(D.PICKWAVENODE,
'/PickWave/Customer'))) E ) F, TABLE(XMLSEQUENCE(EXTRACT(F.CUSTOMERNODE,
'/Customer/InvOrder'))) G ORDER BY PICKWAVEPRODLINE, PICKWAVETOURSEQ,
PICKWAVENR, SEQ )
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 4324.09 9994.65 0 57193 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 2 4324.09 9994.65 0 57193 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 68 (recursive depth: 1)
Rows Row Source Operation
0 COUNT (cr=0 pr=0 pw=0 time=180 us)
0 VIEW (cr=0 pr=0 pw=0 time=166 us)
0 SORT ORDER BY (cr=0 pr=0 pw=0 time=152 us)
40866 NESTED LOOPS (cr=54973 pr=0 pw=0 time=31065606 us)
1363 NESTED LOOPS (cr=54937 pr=0 pw=0 time=11037183 us)
1 NESTED LOOPS (cr=54889 pr=0 pw=0 time=10145883 us)
1 NESTED LOOPS (cr=54841 pr=0 pw=0 time=9799012 us)
1 TABLE ACCESS BY INDEX ROWID XML_ORDERS (cr=2 pr=0 pw=0 time=222 us)
1 INDEX UNIQUE SCAN XML_ORDERS_PK (cr=1 pr=0 pw=0 time=126 us)(object id 58551)
1 COLLECTION ITERATOR PICKLER FETCH (cr=54839 pr=0 pw=0 time=9798748 us)
1 COLLECTION ITERATOR PICKLER FETCH (cr=48 pr=0 pw=0 time=346818 us)
1363 COLLECTION ITERATOR PICKLER FETCH (cr=48 pr=0 pw=0 time=870830 us)
40866 COLLECTION ITERATOR PICKLER FETCH (cr=36 pr=0 pw=0 time=18739302 us)
Note that I cancelled this operation before it was over so I imagine that these figures refer to the statistics as of the time when the operation was interrupted.
So, here are finally my questions.
In order to create the constraints on the nested tables as shown in other threads, do I need to drop the existing xml_orders table and ancillary object types and recreate them or is there a way to add such constraints using the existing system generated object names?
Secondly, the xml_orders table may contain severale documents, not just one and his current primary key is the column ID. So, in order to uniquely identify the deepest element in the xml document, I need first to select the relevant document by means of the id column.
Would it be better to create the indexes containing this id column together with the nested_table_id and array_index?
Thanks for you help.
Flavio
PS: I wrote a 10 lines xsl transformation that I passed on to Saxon together with the 32Mb file. It took less than 1 minute to produce a flat file that was loaded almost instantly by SQL*Loader. So, what I am looking for is a procedure loading this stuff in less than 2 minutes or possibly less.Does the following help
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:53 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool registerSchema_&4..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> declare
2 result boolean;
3 begin
4 result := dbms_xdb.createResource('/home/&1/xsd/&4',
5 bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
6 end;
7 /
old 4: result := dbms_xdb.createResource('/home/&1/xsd/&4',
new 4: result := dbms_xdb.createResource('/home/OTNTEST/xsd/GetaxTypes.xsd',
old 5: bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
new 5: bfilename(USER,'GetaxTypes.xsd'),nls_charset_id('AL32UTF8'));
PL/SQL procedure successfully completed.
SQL> commit
2 /
Commit complete.
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 schemaURL => '&3',
5 schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
6 local => TRUE,
7 genTypes => TRUE,
8 genBean => FALSE,
9 genTables => &5
10 );
11 end;
12 /
old 4: schemaURL => '&3',
new 4: schemaURL => 'private/GetaxTypes.xsd',
old 5: schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
new 5: schemaDoc => xdbURIType('/home/OTNTEST/xsd/GetaxTypes.xsd').getClob(),
old 9: genTables => &5
new 9: genTables => TRUE
PL/SQL procedure successfully completed.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:55 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool registerSchema_&4..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> declare
2 result boolean;
3 begin
4 result := dbms_xdb.createResource('/home/&1/xsd/&4',
5 bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
6 end;
7 /
old 4: result := dbms_xdb.createResource('/home/&1/xsd/&4',
new 4: result := dbms_xdb.createResource('/home/OTNTEST/xsd/PickData.xsd',
old 5: bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
new 5: bfilename(USER,'PickData.xsd'),nls_charset_id('AL32UTF8'));
PL/SQL procedure successfully completed.
SQL> commit
2 /
Commit complete.
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 schemaURL => '&3',
5 schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
6 local => TRUE,
7 genTypes => TRUE,
8 genBean => FALSE,
9 genTables => &5
10 );
11 end;
12 /
old 4: schemaURL => '&3',
new 4: schemaURL => 'private/PickData.xsd',
old 5: schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
new 5: schemaDoc => xdbURIType('/home/OTNTEST/xsd/PickData.xsd').getClob(),
old 9: genTables => &5
new 9: genTables => TRUE
PL/SQL procedure successfully completed.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:58 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool createTable.log
SQL> --
SQL> connect &1/&2
Connected.
SQL> --
SQL> CREATE TABLE "XML_ORDERS"
2 ("ID" NUMBER(7,0) NOT NULL ENABLE,
3 "XMLFILE" "SYS"."XMLTYPE" ,
4 "INSERTED" DATE DEFAULT sysdate,
5 CONSTRAINT "XML_ORDERS_PK" PRIMARY KEY ("ID") USING INDEX ENABLE
6 ) XMLTYPE COLUMN XMLFILE STORE AS OBJECT RELATIONAL
7 XMLSCHEMA "private/PickData.xsd"
8 ELEMENT "PickData"
9 VARRAY XMLFILE."XMLDATA"."ProdRun"."PickWave" STORE AS TABLE PickWave_TAB
10 (
11 ( primary key (nested_table_id, array_index)
12 ) organization index overflow
13 VARRAY "Customer" STORE AS TABLE Customer_TAB
14 (
15 (primary key (nested_table_id, array_index)
16 ) organization index overflow
17 VARRAY "InvOrder" STORE AS TABLE InvOrder_TAB
18 (
19 (primary key (nested_table_id, array_index)
20 ) organization index overflow
21 )
22 )
23 )
24 /
Table created.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:59 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool insertFile_&3..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> set timing on
SQL> set long 10000
SQL> --
SQL> insert into XML_ORDERS (ID, XMLFILE) values (&4, xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
2 /
old 1: insert into XML_ORDERS (ID, XMLFILE) values (&4, xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
new 1: insert into XML_ORDERS (ID, XMLFILE) values (10, xmltype(bfilename(USER,'testcase.xml'),nls_charset_id('AL32UT
8')))
1 row created.
Elapsed: 00:00:00.11
SQL> commit
2 /
Commit complete.
Elapsed: 00:00:00.01
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:59 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool testcase.log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> set timing on
SQL> set long 10000
SQL> set pages 0 lines 140
SQL> --
SQL> -- Testcase code here
SQL> --
SQL> set autotrace on explain
SQL> --
SQL> create or replace view PROD_RUN_VIEW
2 (
3 PRODRUNNODE,
4 PRODRUNNR,
5 PRODRUNDATE,
6 PRODRUNID,
7 PRODRUNFINAL
8 )
9 as
10 select EXTRACT(XMLFILE,'/PickData/ProdRun'),
11 EXTRACTVALUE(XMLFILE , '/PickData/ProdRun/Nr'),
12 TO_DATE(EXTRACTVALUE(XMLFILE, '/PickData/ProdRun/Date'),'DDMMYYYY'),
13 ID,
14 EXTRACTVALUE(XMLFILE,'/PickData/ProdRun/Final')
15 from XML_ORDERS
16 /
View created.
Elapsed: 00:00:00.09
SQL> create or replace view PICK_WAVE_VIEW
2 (
3 PICKWAVENODE,
4 PICKWAVENR,
5 PICKWAVEPRODLINE,
6 PICKWAVETOUR,
7 PICKWAVETOURSEQ,
8 PRODRUNNR,
9 PRODRUNDATE,
10 PRODRUNID,
11 PRODRUNFINAL
12 )
13 as
14 select value(PW),
15 extractValue(value(PW),'/PickWave/Nr'),
16 TO_NUMBER(EXTRACTVALUE(value(PW),'/PickWave/ProdLine')),
17 extractValue(value(PW),'/PickWave/Tour'),
18 TO_NUMBER(extractValue(value(PW),'/PickWave/TourSeq')),
19 PRODRUNNR,
20 PRODRUNDATE,
21 PRODRUNID,
22 PRODRUNFINAL
23 FROM PROD_RUN_VIEW, table(xmlsequence(extract(PRODRUNNODE,'/ProdRun/PickWave'))) PW
24 /
View created.
Elapsed: 00:00:00.09
SQL> create or replace view CUSTOMER_VIEW
2 (
3 CUSTOMERNODE,
4 CUST,
5 MOD,
6 TOD,
7 SEQ,
8 PICKWAVENR,
9 PICKWAVEPRODLINE,
10 PICKWAVETOUR,
11 PICKWAVETOURSEQ,
12 PRODRUNNR,
13 PRODRUNDATE,
14 PRODRUNFINAL,
15 PRODRUNID
16 )
17 as
18 select value(CUST),
19 EXTRACTVALUE(VALUE(CUST), '/Customer/Cust'),
20 EXTRACTVALUE(VALUE(CUST), '/Customer/Mod'),
21 EXTRACTVALUE(VALUE(CUST), '/Customer/Tod'),
22 TO_NUMBER(EXTRACTVALUE(VALUE(CUST), '/Customer/Seq')),
23 PICKWAVENR,
24 PICKWAVEPRODLINE,
25 PICKWAVETOUR,
26 PICKWAVETOURSEQ,
27 PRODRUNNR,
28 PRODRUNDATE,
29 PRODRUNFINAL,
30 PRODRUNID
31 from PICK_WAVE_VIEW, table(xmlsequence(extract(PICKWAVENODE,'/PickWave/Customer'))) CUST
32 /
View created.
Elapsed: 00:00:00.10
SQL>
SQL> create or replace view INVOICE_ORDER_VIEW
2 (
3 INVORDERNR,
4 ITEM,
5 QTY,
6 PRIORITY,
7 REORDERING,
8 HLORDER,
9 DELDATE,
10 CUST,
11 MOD,
12 TOD,
13 SEQ,
14 PICKWAVENR,
15 PICKWAVEPRODLINE,
16 PICKWAVETOUR,
17 PICKWAVETOURSEQ,
18 PRODRUNNR,
19 PRODRUNDATE,
20 PRODRUNFINAL,
21 PRODRUNID
22 )
23 as
24 SELECT EXTRACTVALUE(VALUE(INV), '/InvOrder/Nr'),
25 EXTRACTVALUE(VALUE(INV), '/InvOrder/Item'),
26 EXTRACTVALUE(VALUE(INV), '/InvOrder/Qty'),
27 EXTRACTVALUE(VALUE(INV), '/InvOrder/Priority'),
28 EXTRACTVALUE(VALUE(INV), '/InvOrder/Reordering'),
29 EXTRACTVALUE(VALUE(INV), '/InvOrder/HlOrder'),
30 TO_DATE(EXTRACTVALUE(VALUE(INV), '/InvOrder/DelDate'),'DDMMYYYY'),
31 CUST,
32 MOD,
33 TOD,
34 SEQ,
35 PICKWAVENR,
36 PICKWAVEPRODLINE,
37 PICKWAVETOUR,
38 PICKWAVETOURSEQ,
39 PRODRUNNR,
40 PRODRUNDATE,
41 PRODRUNFINAL,
42 PRODRUNID
43 FROM CUSTOMER_VIEW, table(xmlsequence(extract(CUSTOMERNODE,'Customer/InvOrder'))) INV
44 /
View created.
Elapsed: 00:00:00.13
SQL> select * from INVOICE_ORDER_VIEW
2 /
IIO0000461 100000036 20 1 0 CSO000743 15-NOV-05 100000013
FO DDU 6 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000463 100000045 20 1 0 CSO000743 15-NOV-05 100000013
FO DDU 6 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000473 100000036 20 1 0 CSO000746 15-NOV-05 100000143
FO DDU 7 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000475 100000045 20 1 0 CSO000746 15-NOV-05 100000143
FO DDU 7 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000469 100000036 20 1 0 CSO000745 15-NOV-05 100000140
FO DDU 3 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000471 100000045 20 1 0 CSO000745 15-NOV-05 100000140
FO DDU 3 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000489 100000036 20 0 0 CSO000751 15-NOV-05 100000148
FO DDU 10 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000491 100000045 20 1 0 CSO000751 15-NOV-05 100000148
FO DDU 10 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000481 100000036 20 0 0 CSO000748 15-NOV-05 100000146
FO DDU 9 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000483 100000045 20 1 0 CSO000748 15-NOV-05 100000146
FO DDU 9 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000485 100000036 20 0 0 CSO000750 15-NOV-05 100000147
FO DDU 4 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000487 100000045 20 1 0 CSO000750 15-NOV-05 100000147
FO DDU 4 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000457 100000036 20 1 0 CSO000742 15-NOV-05 100000006
FO DDU 5 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000459 100000045 20 1 0 CSO000742 15-NOV-05 100000006
FO DDU 5 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000477 100000036 20 1 0 CSO000747 15-NOV-05 100000145
FO DDU 8 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000479 100000045 20 1 0 CSO000747 15-NOV-05 100000145
FO DDU 8 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000465 100000036 20 1 0 CSO000744 15-NOV-05 100000114
FO DDU 2 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000467 100000045 20 1 0 CSO000744 15-NOV-05 100000114
FO DDU 2 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
18 rows selected.
Elapsed: 00:00:00.22
Execution Plan
Plan hash value: 1730223965
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 18 | 10278 | 877 (0)| 00:00:11 |
| 1 | NESTED LOOPS | | 18 | 10278 | 877 (0)| 00:00:11 |
| 2 | NESTED LOOPS | | 18 | 8424 | 841 (0)| 00:00:11 |
| 3 | MERGE JOIN CARTESIAN | | 18 | 4680 | 805 (0)| 00:00:10 |
| 4 | TABLE ACCESS FULL | XML_ORDERS | 1 | 67 | 3 (0)| 00:00:01 |
| 5 | BUFFER SORT | | 18 | 3474 | 802 (0)| 00:00:10 |
| 6 | INDEX FAST FULL SCAN| SYS_IOT_TOP_64187 | 18 | 3474 | 802 (0)| 00:00:10 |
|* 7 | INDEX UNIQUE SCAN | SYS_IOT_TOP_64185 | 1 | 208 | 2 (0)| 00:00:01 |
|* 8 | INDEX RANGE SCAN | SYS_C008783 | 1 | | 0 (0)| 00:00:01 |
|* 9 | INDEX UNIQUE SCAN | SYS_IOT_TOP_64183 | 1 | 103 | 2 (0)| 00:00:01 |
|* 10 | INDEX RANGE SCAN | SYS_C008785 | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
7 - access("NESTED_TABLE_ID"="CUSTOMER_TAB"."SYS_NC0000800009$")
8 - access("NESTED_TABLE_ID"="CUSTOMER_TAB"."SYS_NC0000800009$")
9 - access("NESTED_TABLE_ID"="PICKWAVE_TAB"."SYS_NC0000800009$")
filter("NESTED_TABLE_ID"="XML_ORDERS"."SYS_NC0001000011$")
10 - access("NESTED_TABLE_ID"="PICKWAVE_TAB"."SYS_NC0000800009$")
Note
- dynamic sampling used for this statement
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
C:\oracle\xdb\otn\347125>You were sequencing the ProdRun node, which is a mistake. Only nodes which occur multiple times should be sequenced... -
Help on how to query 11g table with XMLType column
To all,
We have this table:
DESC MESSAGE
Name Null Type
MESSAGE_ID NOT NULL NUMBER(38)
REQUEST_UU_ID NOT NULL VARCHAR2(50)
MESSAGE_TYPE_CD NOT NULL CHAR(3 CHAR)
EMPLOYEE_NUM NOT NULL VARCHAR2(8)
SEQUENCE_NUM VARCHAR2(20)
REVERSAL_SEQUENCE_NUM VARCHAR2(20)
TRANSACTION_TS TIMESTAMP(6)
MESSAGE_CONTENT_TXT NOT NULL XMLTYPE()
CREATE_BY_NM NOT NULL VARCHAR2(50 CHAR)
CREATE_BY_TS NOT NULL TIMESTAMP(6)
LAST_UPDATE_BY_NM NOT NULL VARCHAR2(50 CHAR)
LAST_UPDATE_BY_TS NOT NULL TIMESTAMP(6)
Given we have multiple columns and one is XMLType how do I query to find rows in the db that match this XPath
Here is a fragment of XML that is held in MESSAGE_CONTENT_TXT XMLType column:
<?xml version="1.0" encoding="UTF-8"?>
<cfg-env:Envelope xmlns="http://www.co.com/schemas/CFX/" xmlns:cfg-env="http://www.co.com/schemas/cfg-env/" xmlns:cfg-hdr="http://www.co.com/schemas/cfg-hdr/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.co.com/schemas/cfg-env/" >
<cfg-env:Header>
<cfg-hdr:MessageHeader xmlns:cfg-hdr="http://www.co.com/schemas/cfg-hdr/" xmlns:cfg-env="http://www.co.com/schemas/cfg-env/" xmlns="http://www.co.com/schemas/CFX/">
<cfg-hdr:Service>
<cfg-hdr:ServiceName>process</cfg-hdr:ServiceName>
<cfg-hdr:MessageType>Request</cfg-hdr:MessageType>
<cfg-hdr:ServiceVersion>1</cfg-hdr:ServiceVersion>
</cfg-hdr:Service>
<cfg-hdr:From>
<cfg-hdr:PartyId>13-175-8724</cfg-hdr:PartyId>
<cfg-hdr:CostCenter>2009065</cfg-hdr:CostCenter>
<cfg-hdr:System>
<cfg-hdr:Application>[email protected]</cfg-hdr:Application>
<cfg-hdr:Version>1.0</cfg-hdr:Version>
<cfg-hdr:Channel>TLR</cfg-hdr:Channel>
</cfg-hdr:System>
<cfg-hdr:OrigReplyToQMgr>QMBKRD01</cfg-hdr:OrigReplyToQMgr>
<cfg-hdr:OrigReplyToQ>Q1</cfg-hdr:OrigReplyToQ>
</cfg-hdr:From>
<cfg-hdr:UserSession>
<cfg-hdr:SignonRole>User</cfg-hdr:SignonRole>
<cfg-hdr:LogonId>R099999</cfg-hdr:LogonId>
I'm trying to find rows in the database that are /Envelope/Header/MessageHeader/UserSession/LogonId/R099999.
Thanks for the assistance. I'm new to XML DB. I appreciate the help.
EricHi Eric,
You can use XMLExists, like this :
select *
from message t
where xmlexists(
'declare namespace env = "http://www.co.com/schemas/cfg-env/"; (: :)
declare namespace hdr = "http://www.co.com/schemas/cfg-hdr/"; (: :)
/env:Envelope/env:Header/hdr:MessageHeader/hdr:UserSession[hdr:LogonId=$id]'
passing t.message_content_txt
, 'R099999' as "id"
);
Maybe you are looking for
-
After auto update to Widows 8.1, my office 2013 is not working.
FOLLOWING ERROR IS SHOWN ON OPENING OF ANY EXCEL OR WORD FILE. "THE UPDATE PACKAGE COULD NOT BE OPENED. VERIFY THAT THE UPDATE PACKAGE EXISTS AND THAT YOU CAN ACCESS IT, OR CONTACT THE APPLICATION VENDOR TO VERIFY THAT THIS IS A VALID WINDOWS INSTALL
-
How to delete a date in the calendar
I received a request and added to my calendar. Now I need to delete it and can't find the way to do it
-
Garbage collection of objects created inside a method
I have method and inside the method I create new Objects I mean I instantiate objects using new and call some methods on these objects. once the method execution is completed and control goes to caller of the method will all the object created inside
-
Descripe the functionalities of Java server Page,URL Scrapper and RSS Provider.
And also define each one of the above providers
-
Annoying error message: ieee80211 phy0: invalid plcp cck rate (0)
Greetings Fellow Forumers! I have an annoying issue caused by (I think) the firmware (carl9170) necessary to allow my USB NIC to work. The issue itself is that this message will pop up on my console and TTY: ieee80211 phy0: invalid plcp cck rate (0)