Oracle XML DB and XQuery: Storage, Parsing, and Processing, Slides of Database Management Systems (DBMS)

An overview of oracle xml db and xquery, focusing on xml type abstraction, storage options (shredded or lob), publishing methods (xml views of relational tables), sql/xml functions and constructs, xquery evaluation and processing, and xquery hybrid evaluation. It also covers input & data representation, sql structures with xml operators, and various input tools.

Typology: Slides

2012/2013

Uploaded on 04/27/2013

dhanapati
dhanapati 🇮🇳

4.1

(24)

123 documents

1 / 37

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Oracle XML DB and XQuery
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25

Partial preview of the text

Download Oracle XML DB and XQuery: Storage, Parsing, and Processing and more Slides Database Management Systems (DBMS) in PDF only on Docsity!

Oracle XML DB and XQuery

Introduction

  • XML Type abstraction
  • Storage
    • Shredded or LOB
  • Publishing
    • XML Views of relational tables
  • SQL / XML functions and constructs
    • XMLQuery, XMLTable, and more...
    • XML Updates
  • XQuery evaluation and processing

XML View

  • Create virtual XML version of object-relational

data

  • Allows XQuery to access relational data
  • Uses XML Publishing
  • ora:view()

SQL/XML Functions

  • SQL/XML querying function and construct
    • XMLQuery, XMLTable
  • SQL/XML functions for creating XML from SQL
    • XMLElement(), XMLConcat(), XMLAttributes(), XMLForest()

XQuery Hybrid Evaluation

  • Transform XMLTable into XMLQuery
  • Static analysis and type checking
  • If possible, compiles into native SQL data

structures

  • If not possible, XMLQuery is left as is for

processing by XMLQuery processor

XQuery Hybrid Evaluation

SQL query containing XMLQuery/XMLTable

SQL query containing XMLQuery

SQL structures with XML operators

XQuery evaluated natively

SQL structures containing XMLQuery

Co-processor evaluates XMLQuery expressions

Transform XMLTable to XMLQuery

Native compilation of XMLQuery

Input & Data Representation

  • Each data row in separate DB row, column of XMLType

XMLType

XMLType

XMLType

Input & Data Representation

  • Each data row in separate DB row, contents in separate columns

VARCHAR

John Doe Adjuster Michael Smith Investigator Sam Adams Engineer

VARCHAR

VARCHAR VARCHAR

row

row

row

VARCHAR VARCHAR

Storage in Database

  • XMLType CLOB
    • File preserved as complete text (whitespace, comments, etc) [textual fidelity]
    • Can still be validated against a schema
    • Data internally is not “typed”
    • Slow querying
    • Fastest storage and retrieval

Storage in Database

  • XMLType View
    • Create a virtual XML document on top of relational tables
    • Fast querying, manipulation using pure SQL
    • Deeply nested views are slow
    • Updating/inserting requires triggers
    • Lose strict order guarantee, no textual fidelity
    • Supports multiple XML schemas on top of one relational schema

Structured Storage Detail

  • Annotate XML schema to control nested

collections storage, as:

– CLOB

  • Array of serialized SQL objects
  • Nested table of serialized SQL objects
  • Array of XMLType

Working with XML Schema

  • Registering schema

begin dbms_xmlschema. registerSchema ( ‘ http://namespace ', xdbURIType(' schema.xsd ').getClob(), TRUE,TRUE,FALSE,TRUE); end;

  • Creating table w/ schema

CREATE TABLE TableName of XMLType XMLSCHEMA "http://namespace"

XQuery database support

  • Production in Oracle Database 10gr
  • Supports XMLQuery and XMLTable construct
  • Native compilation into SQL /XML structures
  • Returns XMLType(Content)
  • Can query over relational, O-R, XMLType data
  • fn:doc - Maps to XDB Repository on server
  • SQLPlus provides xquery command to execute XQuery
  • XSL-T will also get compiled to XQuery

Architecture

XQuery XSL-T Parser

Compiler

XQuery Type check

XQ UE RY

SQL Metadata XMLSchema Repository

XML Indexes, Text Indexes

XQuery F&O

Rewrite to SQLX

SQLX rewrite

Relational Optimizer

Execution engine

Normalization XQueryX

Compiled XQuery Tree

Type checked^ Statically Tree Normalized Tree (casts, treat )

SQL/XML Operand Tree

SQL Operand Tree

Execution Structures

S Q L