Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Newbie: XML Handling in Oracle 9i

Re: Oracle Newbie: XML Handling in Oracle 9i

From: Mark Townsend <markbtownsend_at_attbi.com>
Date: Fri, 31 Jan 2003 03:29:46 GMT
Message-ID: <BA5F2DA9.83D5%markbtownsend@attbi.com>


Larry - I know a bit about XML handling in Oracle, and I'm not sure I understand your question, or it's context.

With XML DB, if you register a schema with the database, and load XML docs into it, then any access to any part of the XML is effectively generating dynamic XML extended SQL under the covers.

But the level of granularity of the SQL varies by the complexity of the XML schema.

So for very complicated documents, SQL may be generated that simply accesses a document from the underlying CLOB storage.

For less complicated documents, SQL may be generated to access the XML information from the underlying object-relational storage.

If the XML document is very simple (or in fact your XML schema actually maps directly to one or more relational tables) then the dynamic SQL will be very familiar.

And in fact, one XML document may actually generate access paths that cobine all three - some parts of the document comes from CLOB storage, some from an object relational representations, some from relational columns, and in fact some from named value paris that are in turn mapped into relational columns.

But I'm not sure this actually answers your question for three reasons

  1. How Oracle actually stores and accesses the XML document (or any part of an XML document) is not really something that you should be too worried about - the storage and access paths are actually up to the database to work out - which is what XML DB does.
  2. You seem to associate a performance impact with this 'dynamic SQL approach' - the reality is that access via this method is faster than just accessing the document (as it would be stored on a file), especially if you only want a specific part of the document
  3. I don't understand the reference to passing documents between stored procedures either - lets say you are performing an action on one part of a XML document, and you want another stored procedure on another part (or even the same one). There is little point in rebuilding the document in CLOB format, just to have to parse it again on the other side of the call. So XML DB simply uses the internal representation for each part - but of course, each stored procedure (and you as the programmer) still 'see' this as the whole document. It's called lazy DOM materialization - you only every access the parts of the document you are actually working on. Sort of like a row reference between stored procedures doesn't imply that Oracle is passing the whole table.

Now XML processing 'outside' of the database - perhaps between the middle tier, and the document - is slightly different. At this stage, in the simplest case - the middle tier asks for the entire document, the database does return the document in it's original format (even though it may not be stored in that format), and of course the middle tier takes over and parses it again or does whatever it wants with it. But it is also possible to just access parts of the XML document, via the Oracle XDK's, or even just SQL
(via XPath and XML extended SQL), from the middle tier, in which case the
database only returns the part that you want.

Anyhow, I'm still not sure this helps - how about having a quick look at the following,

XML Oracle By Example -
http://otn.oracle.com/products/oracle9i/htdocs/9iober2/obe9ir2/default_otn.h tm#

XML DB Overview -
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb01int .htm#1047171

XML Developer Kits Overview -
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96621/adx01bas .htm#1000528

XML Techweb - http://otn.oracle.com/tech/xml/content.html

 and then perhaps re-phrasing your question. If these don't help too much
(or if you have already looked at them), then an idea of what you are trying
to do at a higher level of description would help also. Received on Thu Jan 30 2003 - 21:29:46 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US