SlideShare a Scribd company logo
Oracle XML DatabaseOracle Database 11g Release 2 New FeaturesMarco Gralike – AMIS – OOW 2009
Started as DBA with Oracle 7 on Windows NT 3.1 (1994)Experienced with Oracle 7.x / 8.x / 9.x / 10.x and 11.1Oracle 11g Beta tester for Oracle XMLDBActive Oracle OTN XMLDB Forum MemberOracle ACE Award for XMLDB Community ContributionsOakTable Network memberWho Am I
Other ImprovementsXDB RepositoryDBMS_METADATARAC SupportStructured XMLIndexaka: XMLIndex Structured ComponentObject Relational Partitioning (V 11.1.0.7.0)Equi-Partitioning by ReferenceBinary XML PartitioningRange, List, HashNew Features
extract, extractValue, existsNode XQueryXMLSequence XQueryora:instanceof XQueryora:instanceof-only 					  XQuerygetNamespace()	 				 	  XQuerygetRootElement() 					  XQuerygetStringVal(), getCLOBVal(), and getBLOBVal()								     XMLSerializeFunction-based indexes on XMLType                                                         Structured XMLIndexDeprecated Features…
“Small Fry” First
XDB RepositorySpeed Improvement Now Securefile based were possibleDBMS_METADATANow supports Object Relational XMLType StructuresDBMS_METADATA.GET_DDLRACProtocol Server SupportOther Improvements
Bigger Fish
XML Data StructureStructured XMLSemi- StructuredUnstructured XMLSearching / Handling XML ContentDocument DrivenContent / Data DrivenBefore we start  Some definitions…
Structured / Semi – Structured ContentStructuredSemiStructured
Unstructured Content
Document  <>  Data Driven
11gR1 XMLIndex Unstructured Component
XML Index OptionsBTree IndexBTree IndexBTree IndexbookstoreOracle Text IndexSecondary Oracle Text IndexFunction based Index (XPath)bookwhitepaperUnstructuredXMLIndextitleauthorauthorchaptertitleauthoridparagraphcontentcontent
XMLIndex UsageBinary XML(Schema based)Binary XML, CLOB(Schema less, Schema based)XMLIndex Structured ComponentXMLIndex Structured Component
Simple: Unstructured XMLIndexSQL> 	CREATEINDEXxmlindex_idx		ON  “XMLTYPE_COLUMN"(xdata) INDEXTYPEISXDB.XMLINDEX;Index created.SQL> 	CREATEINDEXxmlindex_idx		ON  “XMLTYPE_TABLE"(object_value) INDEXTYPEISXDB.XMLINDEX;Index created.
XMLIndex Unstructured Component“Unstructured XMLIndex”
Path Table
Use Path Subsetting
Full Blown XMLIndex can be BIG
Token Tables (XDB.X$......)
Query re-write on Tokens
Fuzzy Searches, //
Optimizer Statistics
Can be maintained Manually
Recorded inPending Table
Secondairy indexes possibleUnstructuredXMLIndexf (x)Path Table
PATH TABLEPATH TABLEPATH INDEX(PATHID, RID), BTREEORDER INDEX(RID, ORDER_KEY), BTREEVALUE INDEX(SUBSTRB("VALUE",1,1599))
FUNCTION BASEDSECONDAIRY INDEXESUnstructuredXMLIndexf (x)Path Table
Unstructured XMLIndexCREATEINDEXXMLIDX ON 		   XMLBINARY_TAB (object_value) INDEXTYPEISXDB.XMLIndexPARAMETERS	('PATHS (INCLUDE (/ROOT/ID /ROOT/INFO/INFO_ID ) NAMESPACEMAPPING(xmlns="http://localhost/xmlschema_bin.xsd") ) PATH TABLE 	            path_table(TABLESPACE XML_DATA)PATH ID INDEX          pathid_idx        (TABLESPACE XML_INDX)ORDER KEY INDEX   orderkey_idx    (TABLESPACE XML_INDX)VALUE INDEX           value_idx          (TABLESPACE XML_INDX)ASYNC (SYNC ALWAYS) STALE (FALSE) ') PARALLEL LOGGING;
11gR2XMLIndexStructured Component
With highly Structured XML dataLikely candidates: ComplexTypesStructured Islands of DataCan be nested, but only one levelThey deliver Relational Performance…!Usage
Index Options – 11g Release 2BTree IndexBTree IndexBTree IndexbookstoreSecondary Oracle Text IndexFunction based Index (XPath)bookwhitepaperStructuredXMLIndexUn-structuredXMLIndextitleauthorauthorchaptertitleauthoridparagraphcontentcontentHighly StructuredIslands of Data
Simpe: Structured XMLIndexSQL> CREATE INDEX xmlindex_sxi           on xmldata_table (doc) indextype is xdb.xmlindex           parameters               ('GROUP elementinfo_group                XMLTABLE xml_cnt_tab_elementinfo                ' '/root/element' '                 COLUMNS infocol VARCHAR2(4000) PATH ' 'info' '              '); Be aware' '
XMLIndex Structured Component“Structured XMLIndex”Content Table(s)BasedonXMLTABLE syntaxXMLTable construct canbenestedbut:Only ONE XMLType column allowedVIRTUAL column is passedCanbemaintainedManuallySecondairyindexespossibleStructuredXMLIndexf (x)ContentTables
Structured XMLIndex (Partitioned)SQL> CREATE INDEX xmlindex_sxi           on xmldata_table (doc) indextype is xdb.xmlindexLOCAL           parameters               ('GROUP elementinfo_group                XMLTABLE xml_cnt_tab_elementinfo                ' '/root/element' '                 COLUMNS infocol VARCHAR2(4000) PATH ' 'info' '              '); LOCAL
CONTENT TABLE(s)CONTENT TABLE(s)KEY INDEX(KEY)
Unique BTREE Index
PrimaryKeyRID INDEX(RID)
NON Unique BTREE IndexYour ColumnsYourdefinedsecondairyindexesRIDrowidYOURcolumnsXKeyRAWNot nullRIDrowidKeyRAWNot nullYOURcolumnsXYOURcolumnsXRIDrowidKeyRAWNot null
Adding Structured IndexesSQL> ALTER INDEX xmlindex_sxiparameters		('ADD_GROUP		GROUP new_group		XMLTABLE xml_cnt_tab_added		 ' '/root/extra' '                 COLUMNS extracol VARCHAR2(4000) PATH ' 'new_element' '  ');
Combining XML Index OptionsUnstructuredXMLIndexbookstoreSecondary IndexbookStructuredXMLIndexwhitepaperStructuredXMLIndextitleauthorauthorparagraphtitleauthoridchaptercontentcontent
Mixed XMLIndex structuresCREATE INDEX xmlindex on TEST_RANGE_XML (doc) indextype is xdb.xmlindex	PARAMETERS 	(' PATH TABLE path_table PATHS (EXCLUDE(/root)) '); BEGIN DBMS_XMLINDEX.registerParameter	('StructuredXML',  'ADD_GROUP    	GROUP ElementInfo	XMLTABLE xml_content_table_info ' '/root/ElementInfo' ' 	COLUMNS  ValueInfo VARCHAR2(4000) PATH ' 'ValueInfo' '); END; /ALTER INDEX xmlindex PARAMETERS('PARAM StructuredXML');
XMLIndex MaintenanceALTER INDEXXMLIndex Parameter ChangesDBMS_XMLINDEX.DROPPARAMETERDBMS_XMLINDEX.MODIFYPARAMETERDBMS_XMLINDEX.REGISTERPARAMETERManual Synchronizing an XMLIndexDBMS_XMLINDEX.SYNCINDEX DBMS_XMLINDEX.SYNCINDEX(user, ‘TAB', REINDEX=>TRUE);
Oracle11g Release 2XML Partitioning
New XML Partitioning OptionsObject Relational PartitioningEqui-Partitioning since version Oracle 11.1.0.7.0Binary XML PartitioningRangeListHashLocal partitioned XMLIndexLOCAL keyword in XMLIndex create syntaxXMLIndex is not supported for HASH partitioning
XML Partitioning – Object RelationalStorageGeneratevia DBMS_XMLSCHEMAXML Schema BasedXDB Annotationsxdb:defaultTablexdb:tablePropsJDeveloper orXMLSpyManualCreationDBMS_METADATA.GET_DDLEVENT setting [alter session set events='31098 trace name context forever'; ]For Data centric XML Data  +  XML Schema
An Example (V9.2-10.2)<xs:schema version="1.0"    xmlns:xs="http://www.w3.org/2001/XMLSchema"     xmlns:xdb="http://xmlns.oracle.com/xdb">  <xs:element name="TestElement" type="TestElementType"       xdb:defaultTable="TESTELEMENT"       xdb:tableProps="PARTITION BY RANGE (XMLDATA.IDENTIFIER)         (PARTITION P01 VALUES LESS THAN (10) TABLESPACE users,          PARTITION P02 VALUES LESS THAN (20) TABLESPACE users,          PARTITION P03 VALUES LESS THAN (MAXVALUE) TABLESPACE users)"/>  <xs:complexType name="TestElementType">    <xs:sequence>      <xs:element name="Identifier" type="xs:int"                   xdb:SQLName="IDENTIFIER"/>      <xs:element name="Person" type="xs:string"/>      <xs:element name="Street" type="xs:string"/>      <xs:element name="City" type="xs:string"/>      <xs:element name="State" type="xs:string"/>      <xs:element name="Zipcode" type="xs:string"/>    </xs:sequence>   </xs:complexType></xs:schema>

More Related Content

PPTX
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...
PPTX
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...
PPTX
Miracle Open World 2011 - XML Index Strategies
PPTX
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...
PPTX
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
PPTX
Design Concepts For Xml Applications That Will Perform
PDF
UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
PPTX
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...
Miracle Open World 2011 - XML Index Strategies
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
Design Concepts For Xml Applications That Will Perform
UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server

What's hot (20)

PPTX
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 2
PPTX
BGOUG 2012 - XML Index Strategies
PPTX
Starting with JSON Path Expressions in Oracle 12.1.0.2
PPTX
Hotsos 2013 - Creating Structure in Unstructured Data
PPTX
ODTUG Webcast - Thinking Clearly about XML
PPT
XML Amsterdam - Creating structure in unstructured data
PPTX
XFILES, The APEX 4 version - The truth is in there
PPTX
BGOUG 2012 - Design concepts for xml applications that will perform
PDF
UKOUG Tech14 - Getting Started With JSON in the Database
PPT
XML In The Real World - Use Cases For Oracle XMLDB
PDF
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
PPT
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
PPT
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
PPTX
Oracle Database - JSON and the In-Memory Database
PPTX
JSON in der Oracle Datenbank
PPT
Xml parsers
PDF
Cloudera Impala, updated for v1.0
PPT
Jdbc 4.0 New Features And Enhancements
PDF
Parsing XML Data
PDF
Ch23 xml processing_with_java
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 2
BGOUG 2012 - XML Index Strategies
Starting with JSON Path Expressions in Oracle 12.1.0.2
Hotsos 2013 - Creating Structure in Unstructured Data
ODTUG Webcast - Thinking Clearly about XML
XML Amsterdam - Creating structure in unstructured data
XFILES, The APEX 4 version - The truth is in there
BGOUG 2012 - Design concepts for xml applications that will perform
UKOUG Tech14 - Getting Started With JSON in the Database
XML In The Real World - Use Cases For Oracle XMLDB
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
Oracle Database - JSON and the In-Memory Database
JSON in der Oracle Datenbank
Xml parsers
Cloudera Impala, updated for v1.0
Jdbc 4.0 New Features And Enhancements
Parsing XML Data
Ch23 xml processing_with_java
Ad

Similar to Oracle Database 11g Release 2 - XMLDB New Features (20)

PDF
XML Tools for Perl
PDF
Ch23
PPT
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
PPT
Sql Summit Clr, Service Broker And Xml
PPTX
AWS Hadoop and PIG and overview
PDF
Import web resources using R Studio
PDF
NyaruDBにゃるものを使ってみた話 (+Realm比較)
PPT
Working With XML in IDS Applications
PPTX
eXtensible Markup Language (XML)
PPT
What's New for Developers in SQL Server 2008?
PPT
SQL Server 2008 Overview
PPT
Xml Java
PPT
DB2 Native XML
PDF
Using Ruby on Rails with legacy Oracle databases
PDF
Hadoop Integration in Cassandra
PDF
Spark SQL Deep Dive @ Melbourne Spark Meetup
PPTX
advDBMS_XML.pptx
KEY
No SQL, No problem - using MongoDB in Ruby
XML Tools for Perl
Ch23
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Sql Summit Clr, Service Broker And Xml
AWS Hadoop and PIG and overview
Import web resources using R Studio
NyaruDBにゃるものを使ってみた話 (+Realm比較)
Working With XML in IDS Applications
eXtensible Markup Language (XML)
What's New for Developers in SQL Server 2008?
SQL Server 2008 Overview
Xml Java
DB2 Native XML
Using Ruby on Rails with legacy Oracle databases
Hadoop Integration in Cassandra
Spark SQL Deep Dive @ Melbourne Spark Meetup
advDBMS_XML.pptx
No SQL, No problem - using MongoDB in Ruby
Ad

More from Marco Gralike (12)

PPTX
UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
PPTX
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
PPTX
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
PPTX
UKOUG Tech15 - Going Full Circle - Building a native JSON Database API
PPTX
Ordina Oracle Open World
PDF
An introduction into Oracle VM V3.x
PDF
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
PPTX
An AMIS Overview of Oracle database 12c (12.1)
PPTX
Flexibiliteit & Snel Schakelen
PPTX
Expertezed 2012 Webcast - XML DB Use Cases
PPTX
BGOUG 2012 - Drag & drop and other stuff - Using your database as a file server
PPT
Amis ACE
UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
UKOUG Tech15 - Going Full Circle - Building a native JSON Database API
Ordina Oracle Open World
An introduction into Oracle VM V3.x
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An AMIS Overview of Oracle database 12c (12.1)
Flexibiliteit & Snel Schakelen
Expertezed 2012 Webcast - XML DB Use Cases
BGOUG 2012 - Drag & drop and other stuff - Using your database as a file server
Amis ACE

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Sensors and Actuators in IoT Systems using pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
Teaching material agriculture food technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Chapter 3 Spatial Domain Image Processing.pdf
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
Sensors and Actuators in IoT Systems using pdf
20250228 LYD VKU AI Blended-Learning.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
The AUB Centre for AI in Media Proposal.docx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...

Oracle Database 11g Release 2 - XMLDB New Features

  • 1. Oracle XML DatabaseOracle Database 11g Release 2 New FeaturesMarco Gralike – AMIS – OOW 2009
  • 2. Started as DBA with Oracle 7 on Windows NT 3.1 (1994)Experienced with Oracle 7.x / 8.x / 9.x / 10.x and 11.1Oracle 11g Beta tester for Oracle XMLDBActive Oracle OTN XMLDB Forum MemberOracle ACE Award for XMLDB Community ContributionsOakTable Network memberWho Am I
  • 3. Other ImprovementsXDB RepositoryDBMS_METADATARAC SupportStructured XMLIndexaka: XMLIndex Structured ComponentObject Relational Partitioning (V 11.1.0.7.0)Equi-Partitioning by ReferenceBinary XML PartitioningRange, List, HashNew Features
  • 4. extract, extractValue, existsNode XQueryXMLSequence XQueryora:instanceof XQueryora:instanceof-only  XQuerygetNamespace()  XQuerygetRootElement()  XQuerygetStringVal(), getCLOBVal(), and getBLOBVal()  XMLSerializeFunction-based indexes on XMLType  Structured XMLIndexDeprecated Features…
  • 6. XDB RepositorySpeed Improvement Now Securefile based were possibleDBMS_METADATANow supports Object Relational XMLType StructuresDBMS_METADATA.GET_DDLRACProtocol Server SupportOther Improvements
  • 8. XML Data StructureStructured XMLSemi- StructuredUnstructured XMLSearching / Handling XML ContentDocument DrivenContent / Data DrivenBefore we start  Some definitions…
  • 9. Structured / Semi – Structured ContentStructuredSemiStructured
  • 11. Document <> Data Driven
  • 13. XML Index OptionsBTree IndexBTree IndexBTree IndexbookstoreOracle Text IndexSecondary Oracle Text IndexFunction based Index (XPath)bookwhitepaperUnstructuredXMLIndextitleauthorauthorchaptertitleauthoridparagraphcontentcontent
  • 14. XMLIndex UsageBinary XML(Schema based)Binary XML, CLOB(Schema less, Schema based)XMLIndex Structured ComponentXMLIndex Structured Component
  • 15. Simple: Unstructured XMLIndexSQL> CREATEINDEXxmlindex_idx ON “XMLTYPE_COLUMN"(xdata) INDEXTYPEISXDB.XMLINDEX;Index created.SQL> CREATEINDEXxmlindex_idx ON “XMLTYPE_TABLE"(object_value) INDEXTYPEISXDB.XMLINDEX;Index created.
  • 19. Full Blown XMLIndex can be BIG
  • 24. Can be maintained Manually
  • 27. PATH TABLEPATH TABLEPATH INDEX(PATHID, RID), BTREEORDER INDEX(RID, ORDER_KEY), BTREEVALUE INDEX(SUBSTRB("VALUE",1,1599))
  • 29. Unstructured XMLIndexCREATEINDEXXMLIDX ON XMLBINARY_TAB (object_value) INDEXTYPEISXDB.XMLIndexPARAMETERS ('PATHS (INCLUDE (/ROOT/ID /ROOT/INFO/INFO_ID ) NAMESPACEMAPPING(xmlns="http://localhost/xmlschema_bin.xsd") ) PATH TABLE path_table(TABLESPACE XML_DATA)PATH ID INDEX pathid_idx (TABLESPACE XML_INDX)ORDER KEY INDEX orderkey_idx (TABLESPACE XML_INDX)VALUE INDEX    value_idx   (TABLESPACE XML_INDX)ASYNC (SYNC ALWAYS) STALE (FALSE) ') PARALLEL LOGGING;
  • 31. With highly Structured XML dataLikely candidates: ComplexTypesStructured Islands of DataCan be nested, but only one levelThey deliver Relational Performance…!Usage
  • 32. Index Options – 11g Release 2BTree IndexBTree IndexBTree IndexbookstoreSecondary Oracle Text IndexFunction based Index (XPath)bookwhitepaperStructuredXMLIndexUn-structuredXMLIndextitleauthorauthorchaptertitleauthoridparagraphcontentcontentHighly StructuredIslands of Data
  • 33. Simpe: Structured XMLIndexSQL> CREATE INDEX xmlindex_sxi on xmldata_table (doc) indextype is xdb.xmlindex parameters ('GROUP elementinfo_group XMLTABLE xml_cnt_tab_elementinfo ' '/root/element' ' COLUMNS infocol VARCHAR2(4000) PATH ' 'info' ' '); Be aware' '
  • 34. XMLIndex Structured Component“Structured XMLIndex”Content Table(s)BasedonXMLTABLE syntaxXMLTable construct canbenestedbut:Only ONE XMLType column allowedVIRTUAL column is passedCanbemaintainedManuallySecondairyindexespossibleStructuredXMLIndexf (x)ContentTables
  • 35. Structured XMLIndex (Partitioned)SQL> CREATE INDEX xmlindex_sxi on xmldata_table (doc) indextype is xdb.xmlindexLOCAL parameters ('GROUP elementinfo_group XMLTABLE xml_cnt_tab_elementinfo ' '/root/element' ' COLUMNS infocol VARCHAR2(4000) PATH ' 'info' ' '); LOCAL
  • 39. NON Unique BTREE IndexYour ColumnsYourdefinedsecondairyindexesRIDrowidYOURcolumnsXKeyRAWNot nullRIDrowidKeyRAWNot nullYOURcolumnsXYOURcolumnsXRIDrowidKeyRAWNot null
  • 40. Adding Structured IndexesSQL> ALTER INDEX xmlindex_sxiparameters ('ADD_GROUP GROUP new_group XMLTABLE xml_cnt_tab_added ' '/root/extra' ' COLUMNS extracol VARCHAR2(4000) PATH ' 'new_element' ' ');
  • 41. Combining XML Index OptionsUnstructuredXMLIndexbookstoreSecondary IndexbookStructuredXMLIndexwhitepaperStructuredXMLIndextitleauthorauthorparagraphtitleauthoridchaptercontentcontent
  • 42. Mixed XMLIndex structuresCREATE INDEX xmlindex on TEST_RANGE_XML (doc) indextype is xdb.xmlindex PARAMETERS (' PATH TABLE path_table PATHS (EXCLUDE(/root)) '); BEGIN DBMS_XMLINDEX.registerParameter ('StructuredXML', 'ADD_GROUP GROUP ElementInfo XMLTABLE xml_content_table_info ' '/root/ElementInfo' ' COLUMNS ValueInfo VARCHAR2(4000) PATH ' 'ValueInfo' '); END; /ALTER INDEX xmlindex PARAMETERS('PARAM StructuredXML');
  • 43. XMLIndex MaintenanceALTER INDEXXMLIndex Parameter ChangesDBMS_XMLINDEX.DROPPARAMETERDBMS_XMLINDEX.MODIFYPARAMETERDBMS_XMLINDEX.REGISTERPARAMETERManual Synchronizing an XMLIndexDBMS_XMLINDEX.SYNCINDEX DBMS_XMLINDEX.SYNCINDEX(user, ‘TAB', REINDEX=>TRUE);
  • 44. Oracle11g Release 2XML Partitioning
  • 45. New XML Partitioning OptionsObject Relational PartitioningEqui-Partitioning since version Oracle 11.1.0.7.0Binary XML PartitioningRangeListHashLocal partitioned XMLIndexLOCAL keyword in XMLIndex create syntaxXMLIndex is not supported for HASH partitioning
  • 46. XML Partitioning – Object RelationalStorageGeneratevia DBMS_XMLSCHEMAXML Schema BasedXDB Annotationsxdb:defaultTablexdb:tablePropsJDeveloper orXMLSpyManualCreationDBMS_METADATA.GET_DDLEVENT setting [alter session set events='31098 trace name context forever'; ]For Data centric XML Data + XML Schema
  • 47. An Example (V9.2-10.2)<xs:schema version="1.0"    xmlns:xs="http://www.w3.org/2001/XMLSchema"     xmlns:xdb="http://xmlns.oracle.com/xdb">  <xs:element name="TestElement" type="TestElementType"       xdb:defaultTable="TESTELEMENT"       xdb:tableProps="PARTITION BY RANGE (XMLDATA.IDENTIFIER)         (PARTITION P01 VALUES LESS THAN (10) TABLESPACE users,          PARTITION P02 VALUES LESS THAN (20) TABLESPACE users,          PARTITION P03 VALUES LESS THAN (MAXVALUE) TABLESPACE users)"/>  <xs:complexType name="TestElementType">    <xs:sequence>      <xs:element name="Identifier" type="xs:int"                   xdb:SQLName="IDENTIFIER"/>      <xs:element name="Person" type="xs:string"/>      <xs:element name="Street" type="xs:string"/>      <xs:element name="City" type="xs:string"/>      <xs:element name="State" type="xs:string"/>      <xs:element name="Zipcode" type="xs:string"/>    </xs:sequence>   </xs:complexType></xs:schema>
  • 49. Equi Partitioning of Table PART_DEMOEMPLOYEES_PROJ_TABPROJ_DETAILS_TABEMP_PROJ_P11“employees”.”employee”reference_idEMP_PROJ_P12
  • 50. XML Partitioning – Binary XML StorageManualCreationPartition Options: Range – List – HashXML Schema basedor Schema lessXML PartitioningbasedonColumnVirtual ColumnXMLTABLEsyntaxBasicfileorSecurefileStoragePost-parseRepresentation of XML DataFor Document centric XML Data +/- XML Schema
  • 51. Binary XML – RANGE PartitioningSQL> CREATE TABLE TEST_RANGE_XML 2 ( "ID" NUMBER(15,0), 3 "DOC" "SYS"."XMLTYPE" 4 ) SEGMENT CREATION IMMEDIATE 5 NOCOMPRESS NOLOGGING 6 TABLESPACE "XML_DATA" 7 XMLTYPE COLUMN "DOC" STORE AS SECUREFILE BINARY XML 8 (TABLESPACE "XML_DATA" 9 NOCOMPRESS KEEP_DUPLICATES) 10 XMLSCHEMA "http://www.server.com/XMLSchema_V1.0.xsd" 11 ELEMENT "ROOT" 12 DISALLOW NONSCHEMA13 PARTITION BY RANGE("ID") 14 (PARTITION RANGE_PART_01 VALUES LESS THAN (100) TABLESPACE "XML_DATA" 15 ,PARTITION RANGE_PART_02 VALUES LESS THAN (200) TABLESPACE "XML_DATA") 16 ,PARTITION RANGE_PART_MAX VALUES LESS THAN (MAXVALUE));
  • 52. Binary XML – LIST PartitioningSQL> CREATE TABLE TEST_LIST_XML 2 ( "REGION" VARCHAR2(3), 3 "DOC" "SYS"."XMLTYPE" 4 ) SEGMENT CREATION IMMEDIATE 5 NOCOMPRESS NOLOGGING 6 TABLESPACE "XML_DATA" 7 XMLTYPE COLUMN "DOC" STORE AS SECUREFILE BINARY XML 8 (TABLESPACE "XML_DATA" 9 NOCOMPRESS KEEP_DUPLICATES) 10 XMLSCHEMA "http://www.server.com/XMLSchema_V1.0.xsd" 11 ELEMENT "ROOT" 12 DISALLOW NONSCHEMA13 PARTITION BY LIST("REGION") 14 (PARTITION LIST_PART_01 VALUES ('AAA', 'BBB') 15 ,PARTITION LIST_PART_02 VALUES ('CCC', 'DDD'));
  • 53. Binary XML – HASH PartitioningXMLIndex is not allowedSQL> CREATE TABLE TEST_HASH_XML 2 ( "ID" NUMBER(15,0), 3 "DOC" "SYS"."XMLTYPE" 4 ) SEGMENT CREATION IMMEDIATE 5 NOCOMPRESS NOLOGGING 6 TABLESPACE "XML_DATA" 7 XMLTYPE COLUMN "DOC" STORE AS SECUREFILE BINARY XML 8 (TABLESPACE "XML_DATA" 9 NOCOMPRESS KEEP_DUPLICATES) 10 XMLSCHEMA "http://www.server.com/XMLSchema_V1.0.xsd" 11 ELEMENT "ROOT" 12 DISALLOW NONSCHEMA13 PARTITION BY HASH("ID") 14 (PARTITION "HASH_SECTION_01" TABLESPACE "XML_DATA_01" 15 ,PARTITION "HASH_SECTION_02" TABLESPACE "XML_DATA_02" 16 ,PARTITION "HASH_SECTION_03" TABLESPACE “XML_DATA_03" ); but an Oracle Text Index is
  • 55. Notes To Remember…Only ONE XMLIndex is allowed in a user schemaAdd extra XMLIndex structures (structured or unstructured) via ADD_GROUP syntaxOnly SYNC=ALWAYS is allowed while using mixed XMLIndex structures or add more than oneYou need the LOCAL parameter to create local partitioned XMLIndexesAn XMLIndex on a HASH partitioned XMLType column or XMLType table, isnot allowedBut you can create an Oracle Text Index on such structures
  • 56. There Can Be Only One XMLIndex
  • 57. Recap
  • 58. Maintenance, Storage ImprovementsXML PartitioningBinary XML & Object Relational XMLTypeDBMS_METADATAObject Relational SupportPerformance ImprovementsNew XMLIndex OptionMore FlexibilitySecurefile XDB RepositoryEnhancements / New XMLDB Features in 11gR2
  • 59. Oracle Open World 2009 - XMLDB Sessions
  • 60. ReferencesXMLDB DevelopersGuidehttp://www.oracle.com/pls/db112/homepageThe XMLDB Forumhttp://forums.oracle.com/forums/forum.jspa?forumID=34XML DB FAQ Thread http://forums.oracle.com/forums/thread.jspa?threadID=410714Bloghttp://technology.amis.nl/bloghttp://blog.gralike.com
  • 62. StructureCONTENT TABLE(s)KEY INDEX(KEY), Unique BTREERID INDEX(RID), Non-Unique BTREEIndexesneededforcombined XMLIndex TypesMixed Unstructured, StructuredXMLIndexesYOUR COLUMN -SECONDAIRY INDEXESStructuredXMLIndexf (x)ContentTables
  • 63. Security PrincipalsDatabase Users and RolesLDAP Users and GroupsOracle Fusion Users and Roles= (Your) Application Users and RolesSecurity ClassesA security class is a named set of privileges.It includes privileges that it inherits from other security classes, and it can include privileges that it defines.Extra Fine Grained Security possibleSecurity Improvements