Skip Headers
Oracle® XML DB Developer's Guide
11
g
Release 2 (11.2)
Part Number E23094-02
Home
Book List
Index
Master Index
Contact Us
Next
PDF
·
Mobi
·
ePub
Contents
List of Examples
List of Figures
List of Tables
Title and Copyright Information
Preface
Audience
Documentation Accessibility
Related Documents
Conventions
Code Examples
Syntax Descriptions
What's New in Oracle XML DB?
Oracle Database 11g Release 2 (11.2.0.3) Deprecated Oracle XML DB Constructs
Oracle Database 11g Release 2 (11.2.0.3) Other Changes in Oracle XML DB
Oracle Database 11g Release 2 (11.2.0.2) New Features in Oracle XML DB
Oracle Database 11g Release 2 (11.2.0.2) Deprecated Oracle XML DB Constructs
Oracle Database 11g Release 2 (11.2.0.1) New Features in Oracle XML DB
Oracle Database 11g Release 2 (11.2.0.1) Deprecated Oracle XML DB Constructs
Oracle Database 11g Release 1 (11.1) New Features in Oracle XML DB
Part I Oracle XML DB Basics
1
Introduction to Oracle XML DB
Overview of Oracle XML DB
Oracle XML DB Architecture
APIs for XML
Catalog Views Related to XML
Overview of Oracle XML DB Repository
XML Services
Views RESOURCE_VIEW and PATH_VIEW
Oracle XML DB Repository Architecture
Files and Folders
Oracle XML DB Protocol Architecture
Programmatic Access to Oracle XML DB (Java, PL/SQL, and C)
Oracle XML DB Features
XMLType Data Type
XMLType Tables and Columns Can Conform to an XML Schema
XMLType API
XML Schema Support
XMLType Storage Models
XML/SQL Duality
SQL/XML Standard Functions
Automatic Rewriting of XQuery and XPath Expressions
How XPath Expressions Are Evaluated by Oracle XML DB
Rewriting SQL Code That Contains XQuery and XPath Expressions
When Can XPath Rewrite Occur?
What is the XPath-Rewrite Process?
Oracle XML DB Benefits
Unifying Data and Content
Exploiting Database Capabilities
Exploiting XML Capabilities
Efficient Storage and Retrieval of Complex XML Documents
Use XMLType Views If Your Data Is Not XML
Search XML Data using Oracle Text
Build Messaging Applications using Oracle Streams Advanced Queuing
Standards Supported by Oracle XML DB
Oracle XML DB Technical Support
Oracle XML DB Examples Used in This Manual
Further Oracle XML DB Case Studies and Demonstrations
2
Getting Started with Oracle XML DB
Oracle XML DB Installation
Oracle XML DB Use Cases
Application Design Considerations for Oracle XML DB
Structure of Your Data
Oracle XML DB Repository Access
Application Language
Processing
Messaging
Storage
Oracle XML DB Performance
XML Storage Requirements
XML Memory Management
Use of XOBs Reduces Memory Overhead for XML Schema-Based Documents
XOB Uses a Lazily-Loaded Virtual DOM
XML Parsing Optimizations
Node-Searching Optimizations
XML Schema Optimizations
Load Balancing Through Cached XML Schema
Reduced Bottlenecks From Code That Is Not Native
Reduced Java Type Conversion Bottlenecks
3
Using Oracle XML DB
Storing XML Data as XMLType
What is XMLType?
Benefits of XMLType Data Type and API
Creating XMLType Tables and Columns
Partitioning or Constraining Binary XML Data using Virtual Columns
Loading XML Content into Oracle XML DB
Loading XML Content using SQL or PL/SQL
Loading XML Content using Java
Loading XML Content using C
Loading Large XML Files that Contain Small XML Documents
Loading Large XML Files using SQL*Loader
Loading XML Documents into the Repository using DBMS_XDB
Loading Documents into the Repository using Protocols
Character Sets of XML Documents
XML Encoding Declaration
Character-Set Determination When Loading XML Documents into the Database
Character-Set Determination When Retrieving XML Documents from the Database
Overview of the W3C XML Schema Recommendation
XML Instance Documents
XML Schema for Schemas
Editing XML Schemas
XML Schema Features
Text Representation of the Purchase Order XML Schema
Graphical Representation of the Purchase-Order XML Schema
Using XML Schema with Oracle XML DB
Why Use XML Schema with Oracle XML DB?
Validating Instance Documents with XML Schema
Constraining Instance Documents for Business Rules or Format Compliance
Defining How XMLType Contents Must be Stored in the Database
Structured Storage of XML Documents
Annotating an XML Schema to Control Naming, Mapping, and Storage
Controlling How Collections Are Stored for Object-Relational XMLType Storage
Declaring the Oracle XML DB Namespace
Registering an XML Schema with Oracle XML DB
SQL Types and Tables Created During XML Schema Registration
Working with Large XML Schemas
Working with Global Elements
Creating XML Schema-Based XMLType Columns and Tables
Default Tables
Identifying XML Schema Instance Documents
Attributes noNamespaceSchemaLocation and schemaLocation
Dealing with Multiple Namespaces
Enforcing XML Data Integrity using the Database
Comparing Partial to Full XML Schema Validation
Partial Validation
Full Validation
Enforcing Referential Integrity using SQL Constraints
DML Operations on XML Content using Oracle XML DB
XPath and Oracle XML
Querying XML Content Stored in Oracle XML DB
PurchaseOrder XML Document
Retrieving the Content of an XML Document using Pseudocolumn OBJECT_VALUE
Accessing Fragments or Nodes of an XML Document using XMLQUERY
Accessing Text Nodes and Attribute Values using XMLCAST and XMLQUERY
Searching an XML Document using XMLEXISTS, XMLCast, and XMLQuery
Performing SQL Operations on XMLType Fragments using XMLTABLE
Accessing XML Data in Oracle XML DB using Relational Views
Breaking Up a Single Level of XML Data
Breaking Up Multiple Levels of XML Data
Querying XML Content As Relational Data
Updating XML Content Stored in Oracle XML DB
Updating XML Schema-Based and Non-Schema-Based XML Documents
Namespace Support in Oracle XML DB
How Oracle XML DB Processes XMLType Methods and SQL Functions
Generating XML Data from Relational Data
Generating XML Data from Relational Data using SQL/XML Functions
Generating XML Data from Relational Data using DBURITYPE
XSL Transformation and Oracle XML DB
Using Oracle XML DB Repository
Installing and Uninstalling Oracle XML DB Repository
Oracle XML DB Provides Name-Level Locking
Use Protocols or SQL to Access and Process Repository Content
Storing and Retrieving Database Content using Standard Protocols
Uploading Content to Oracle XML DB using FTP
Accessing Oracle XML DB Repository Programmatically
Accessing and Updating XML Content in the Repository
Accessing XML Documents using SQL
Repository Content is Exposed Through RESOURCE_VIEW and PATH_VIEW
Use EXISTS_PATH and UNDER_PATH for Path-Based Predicates in a WHERE Clause
You Can Also Store Non-XML Documents in the Repository
PL/SQL Packages to Create, Delete, Rename, Move,... Folders and Documents
Accessing the Content of Documents using SQL
Accessing the Content of XML Schema-Based Documents
Accessing Resource Content using Element XMLRef in Joins
Updating the Content of Documents Stored in the Repository
Updating Repository Content using Protocols
Updating Repository Content using SQL
Updating XML Schema-Based Documents in the Repository
Controlling Access to Repository Data
Oracle XML DB Transactional Semantics
Querying Metadata and the Folder Hierarchy
RESOURCE_VIEW and PATH_VIEW
Querying Resources in RESOURCE_VIEW and PATH_VIEW
Oracle XML DB Hierarchical Repository Index
How Documents are Stored in the Repository
Viewing Relational Data as XML From a Browser
Accessing a Table or View from a Browser using DBUri SERVLET
XSL Transformation using DBUri Servlet
Part II Storing and Retrieving XML Data in Oracle XML DB
4
XMLType Operations
Selecting and Querying XML Data
Searching XML Documents using XPath Expressions
Querying XMLType Data using SQL/XML Functions XMLExists and XMLCast
XMLEXISTS SQL/XML Function
XMLCAST SQL/XML Function
Examples of Querying XML Data using SQL/XML Functions
Updating XML Data
Updating an Entire XML Document
SQL Functions that Update XML Data
Inserting XML Elements using SQL Functions
UPDATEXML SQL Function
UPDATEXML and NULL Values
Updating the Same XML Node More Than Once
Preserving DOM Fidelity When using UPDATEXML
Optimization of Oracle SQL Functions that Modify XML Data
Creating XML Views using Oracle SQL Functions that Modify XML Data
INSERTCHILDXML SQL Function
INSERTCHILDXMLBEFORE SQL Function
INSERTCHILDXMLAFTER SQL Function
INSERTXMLBEFORE SQL Function
INSERTXMLAFTER SQL Function
APPENDCHILDXML SQL Function
DELETEXML SQL Function
5
Using XQuery with Oracle XML DB
Overview of XQuery in Oracle XML DB
Overview of the XQuery Language
Functional Language Based on Sequences
XQuery Expressions
FLWOR Expressions
SQL/XML Functions XMLQUERY and XMLTABLE
XMLQUERY SQL/XML Function in Oracle XML DB
XMLTABLE SQL/XML Function in Oracle XML DB
When To Use XQuery
Predefined Namespaces and Prefixes
URI Scheme oradb: Querying Table or View Data with XQuery
Oracle XQuery Extension Functions
ora:contains XQuery Function
ora:matches XQuery Function
ora:replace XQuery Function
ora:sqrt XQuery Function
ora:tokenize XQuery Function
Oracle XQuery Extension-Expression Pragmas
XMLQUERY and XMLTABLE Examples
XQuery Is About Sequences
Querying XML Data in Oracle XML DB Repository using XQuery
Querying Table or View Data using XQuery
Using XQuery with XMLType Data
Using Namespaces with XQuery
Performance Tuning for XQuery
Rule-Based and Cost-Based XQuery Optimization
XQuery Optimization over Relational Data
XQuery Optimization over XML Schema-Based XMLType Data
Diagnosing XQuery Optimization: XMLOptimizationCheck
Improving Performance for fn:doc and fn:collection on Repository Data
Using equals_path and under_path Instead of fn:doc and fn:collection
Using Oracle XQuery Pragma ora:defaultTable
XQuery Static Type-Checking in Oracle XML DB
SQL*Plus XQUERY Command
Using XQuery with PL/SQL, JDBC, and ODP.NET
Oracle XML DB Support for XQuery
Support for XQuery and SQL
Implementation Choices Specified in the XQuery Standard
XQuery Features Not Supported by Oracle XML DB
XQuery Optional Features
Support for XQuery Functions and Operators
XQuery Functions fn:doc, fn:collection, and fn:doc-available
6
Indexing XMLType Data
Oracle XML DB Tasks Involving Indexes
Overview of Indexing XMLType Data
XMLIndex Addresses the Fine-Grained Structure of XML Data
Oracle Text Indexes
Optimization Chooses the Right Indexes to Use
Deprecated Indexes for XML Data
Function-Based Indexes
CTXXPath Indexes
Indexing XMLType Data Stored Object-Relationally
Indexing Non-Repeating text() Nodes or Attribute Values
Indexing Repeating (Collection) Elements
XMLIndex
Advantages of XMLIndex
Structured and Unstructured XMLIndex Components
XMLIndex Structured Component
Ignore the Index Content Tables; They Are Transparent
Data Type Considerations for XMLIndex Structured Component
XMLIndex Unstructured Component
Ignore the Path Table – It Is Transparent
Column VALUE of an XMLIndex Path Table
Secondary Indexes on Column VALUE
XPath Expressions that Are Not Indexed by an XMLIndex Unstructured Component
Creating, Dropping, Altering, and Examining an XMLIndex Index
Using XMLIndex with an Unstructured Component
Creating Additional Secondary Indexes on an XMLIndex Path Table
Using XMLIndex with a Structured Component
How to Tell Whether XMLIndex is Used
Turning Off Use of XMLIndex
XMLIndex Path Subsetting: Specifying the Paths You Want to Index
Examples of XMLIndex Path Subsetting
XMLIndex Path-Subsetting Rules
Guidelines for Using XMLIndex with an Unstructured Component
Guidelines for Using XMLIndex with a Structured Component
XMLIndex Partitioning and Parallelism
Asynchronous (Deferred) Maintenance of XMLIndex Indexes
Collecting Statistics on XMLIndex Objects for the Cost-Based Optimizer
Data Dictionary Static Public Views Related to XMLIndex
PARAMETERS Clause for CREATE INDEX and ALTER INDEX
Using a Registered PARAMETERS Clause for XMLIndex
PARAMETERS Clause Syntax for CREATE INDEX and ALTER INDEX
Usage of XMLIndex_parameters_clause
Usage of XMLIndex_parameters
Usage of PATHS Clause
Usage of create_index_paths_clause and alter_index_paths_clause
Usage of pikey_clause, path_id_clause, and order_key_clause
Usage of value_clause
Usage of async_clause
Usage of groups_clause and alter_index_group_clause
Usage of XMLIndex_xmltable_clause
Usage of column_clause
Oracle Text Indexes on XML Data
Creating and Using Oracle Text Indexes
Oracle Text Indexes Are Used Independently of Other Indexes
7
XML Schema Storage and Query: Basic
Overview of XML Schema and Oracle XML DB
Using Oracle XML DB with XML Schema
Why XML Schema?
DTD Support in Oracle XML DB
Inline DTD Definitions
External DTD Definitions
Managing XML Schemas with DBMS_XMLSCHEMA
Registering an XML Schema with Oracle XML DB
Delete and Reload Documents Before Registering Their XML Schema
Storage and Access Infrastructure
Atomic Nature of XML Schema Registration
Managing and Storing XML Schemas
Debugging XML Schema Registration for XML Data Stored Object-Relationally
SQL Object Types Created During XML Schema Registration, for Structured Storage
Default Tables Created During XML Schema Registration
Generated Names are Case Sensitive
Database Objects That Depend on Registered XML Schemas
Listing All Registered XML Schemas
Deleting an XML Schema
DBMS_XMLSCHEMA.DELETESCHEMA Options
XMLType Methods Related to XML Schema
Local and Global XML Schemas
Local XML Schema
Global XML Schema
DOM Fidelity
What is DOM Fidelity?
SYS_XDBPD$ and DOM Fidelity for Structured Storage
XML Translations
Changing an XML Schema and XML Instance Documents for Translation
Indicating Translatable Elements in an XML Schema
Indicating Translation Language Attributes in an XML Instance Document
Making XML Documents Translatable
Operations on Translated Documents
Creating XMLType Tables and Columns Based on XML Schemas
Specifying XMLType Storage Options for XML Schema-Based Data
Binary XML Storage of XML Schema-Based Data
Unstructured Storage of XML Schema-Based Data
Structured Storage of XML Schema-Based Data
Specifying Relational Constraints on XMLType Tables and Columns
Oracle XML Schema Annotations
Common Uses of XML Schema Annotations
XML Schema Annotation Example
Available Oracle XML DB XML Schema Annotations
XML Schema Annotation Guidelines for Structured Storage
Avoid Creation of Unnecessary Tables for Unused Top-Level Elements
Provide Your Own Names for Default Tables
Turn Off DOM Fidelity If Not Needed
Use Unordered Collection Elements When Order Doesn't Matter
Annotate Time-Related Elements with a Timestamp Data Type
Add Table and Column Properties
Store Large Collections Out of Line
Querying a Registered XML Schema to Obtain Annotations
Mapping XML Schema Data Types to Oracle XML DB Storage
Mapping XML Schema Data Types to SQL Data Types
Example of Mapping XML Schema Data Types to SQL
Mapping XML Schema Attribute Data Types to SQL
Overriding the SQLType Value in an XML Schema When Declaring Attributes
Mapping XML Schema Element Data Types to SQL
Overriding the SQLType Value in an XML Schema when Declaring Elements
Mapping simpleType to SQL
NCHAR, NVARCHAR, and NCLOB SQLType Values are Not Supported
simpleType: Mapping XML Strings to SQL VARCHAR2 Versus CLOB
Working with Time Zones
Mapping complexType to SQL
Specifying Attributes in a complexType XML Schema Declaration
8
XPath Rewrite for Structured Storage
Overview of XPath Rewrite for Structured Storage
Sample of XPath Expressions that Are Rewritten
Analyzing and Optimizing XPath Queries using Execution Plans
Guideline: Look for underlying tables versus XML functions in execution plans
Guideline: Name the default tables, so you recognize them in execution plans
Guideline: Create an index on a column targeted by a predicate
Guideline: Create indexes on ordered collection tables
Guideline: Use XMLOptimizationCheck to determine why a query is not rewritten
9
XML Schema Storage and Query: Advanced
Generating XML Schemas with DBMS_XMLSCHEMA.GENERATESCHEMA
Adding Unique Constraints to the Parent Element of an Attribute
Setting Annotation Attribute SQLInline to false for Out-Of-Line Storage
XPath Rewrite for Out-Of-Line Tables
Storing Collections in Out-Of-Line Tables
Partitioning XMLType Tables and Columns Stored Object-Relationally
Examples of Partitioning XMLType Data
Partition Maintenance
Fully Qualified XML Schema URLs
Mapping XML Fragments to Large Objects (LOBs)
complexType Extensions and Restrictions in Oracle XML DB
complexType Declarations in XML Schema: Handling Inheritance
Mapping complexType: simpleContent to Object Types
Mapping complexType: any and anyAttribute
XML Schema: Working with Circular and Cyclical Dependencies
For Circular XML Schema Dependencies Set Parameter GENTABLES to TRUE
complexType Declarations XML Schema: Handling Cycles
How a complexType Can Reference Itself
Cyclical References Among XML Schemas
Support for Recursive Schemas
Sharing defaultTable Among Common Out-Of-Line Elements
Query Rewrite when DOCID is Present
Disabling DOCID Column Creation
Loading and Retrieving Large Documents with Collections
Guidelines for Setting xdbcore Parameters
10
XML Schema Evolution
Overview of XML Schema Evolution
Using Copy-Based Schema Evolution
Scenario for Copy-Based Evolution
copyEvolve Parameters and Errors
Limitations of Procedure COPYEVOLVE
Guidelines for Using Procedure COPYEVOLVE
Top-Level Element Name Changes
User-Created Virtual Columns of Tables Other Than Default Tables
Ensure that the XML Schema and Dependents Are Not Used by Concurrent Sessions
Rollback When Procedure DBMS_XMLSCHEMA.COPYEVOLVE Raises an Error
Failed Rollback From Insufficient Privileges
Privileges Needed for XML Schema Evolution
Updating Existing XML Instance Documents using a Style Sheet
Examples of Using Procedure COPYEVOLVE
Using In-Place XML Schema Evolution
Restrictions for In-Place XML Schema Evolution
Backward-Compatibility Restrictions
Other Restrictions on In-Place Evolution
Supported Operations for In-Place XML Schema Evolution
Guidelines for Using In-Place XML Schema Evolution
inPlaceEvolve Parameters
Creating the Document for the diffXML Parameter
diffXML Operations and Examples
11
Transforming and Validating XMLType Data
Transforming XMLType Instances
SQL Function XMLTRANSFORM and XMLType Method TRANSFORM()
XMLTRANSFORM and XMLType.transform(): Examples
Validating XMLType Instances
Validating XML Data Stored as XMLType: Examples
12
Full-Text Search Over XML Data
Overview of Full-Text Search for XML
Comparison of Full-Text Search and Other Search Types
Searching XML Data
Searching Documents using Full-Text Search and XML Structure
About the Full-Text Search Examples
Roles and Privileges
Schema and Data for Full-Text Search Examples
Overview of CONTAINS and ora:contains
Overview of SQL Function CONTAINS
Overview of XPath Function ora:contains
Comparison of CONTAINS and ora:contains
CONTAINS SQL Function
Full-Text Search using SQL Function CONTAINS
Full-Text Boolean Operators AND, OR, and NOT
Full-Text Stemming: $
Combining Boolean and Stemming Operators
SCORE SQL Function
Restricting the Scope of a CONTAINS Search
WITHIN Structure Operator
INPATH Structure Operator
HASPATH Structure Operator
Projecting the CONTAINS Result
Indexing with a CONTEXT Index
Introduction to CONTEXT Indexes
Effect of a CONTEXT Index on CONTAINS
CONTEXT Index Preferences
Introduction to Section Groups
ora:contains XQuery Function
Full-Text Search using XQuery Function ora:contains
Restricting the Scope of an ora:contains Query
Projecting the ora:contains Result
Policies for ora:contains Queries
Introduction to Policies for ora:contains Queries
Effect of Policies on ora:contains
Policy Defaults
Performance of ora:contains
Use a Primary Filter in the Query
XPath Rewrite and CONTEXT Indexes
Text Path BNF Specification
Support for Full-Text XML Examples
Purchase-Order XML Document, po001.xml
CREATE TABLE Statements
Purchase-Order XML Schema for Full-Text Search Examples
Part III Using XMLType APIs
13
PL/SQL APIs for XMLType
Overview of PL/SQL APIs for XMLType
API Features
Lazy Loading of XML Data (Lazy Manifestation)
XMLType Data Type Supports XML Schema
XMLType Supports Data in Different Character Sets
PL/SQL DOM API for XMLType (DBMS_XMLDOM)
Overview of the W3C Document Object Model (DOM) Recommendation
Oracle XML Developer's Kit Extensions to the W3C DOM Standard
Supported W3C DOM Recommendations
Difference Between DOM and SAX
PL/SQL DOM API for XMLType (DBMS_XMLDOM): Features
XML Schema Support
Enhanced Performance
Designing End-to-End Applications using Oracle XML Developer's Kit and Oracle XML DB
Preparing XML Data to Use the PL/SQL DOM API for XMLType
Defining an XML Schema Mapping to SQL Object Types
DOM Fidelity for XML Schema Mapping
Wrapping Existing Data into XML with XMLType Views
DBMS_XMLDOM Methods Supported
PL/SQL DOM API for XMLType: Node Types
Working with XML Schema-Based Data
DOM NodeList and NamedNodeMap Objects
Using the PL/SQL DOM API for XMLType (DBMS_XMLDOM)
PL/SQL DOM API for XMLType – Examples
Large Node Handling using DBMS_XMLDOM
Get-Push Model
Get-Pull Model
Set-Pull Model
Set-Push Model
Determining Binary Stream or Character Stream
PL/SQL Parser API for XMLType (DBMS_XMLPARSER)
Features of the PL/SQL Parser API for XMLType
Using the PL/SQL Parser API for XMLType (DBMS_XMLPARSER)
PL/SQL XSLT Processor for XMLType (DBMS_XSLPROCESSOR)
Enabling Transformations and Conversions with XSLT
PL/SQL XSLT Processor for XMLType: Features
Using the PL/SQL XSLT Processor API for XMLType (DBMS_XSLPROCESSOR)
PL/SQL Translation API for XMLType (DBMS_XMLTRANSLATIONS)
DBMS_XMLTRANSLATIONS Methods
14
PL/SQL Package DBMS_XMLSTORE
Overview of PL/SQL Package DBMS_XMLSTORE
Using Package DBMS_XMLSTORE
Inserting with DBMS_XMLSTORE
Updating with DBMS_XMLSTORE
Deleting with DBMS_XMLSTORE
15
Java DOM API for XMLType
Overview of Java DOM API for XMLType
Java DOM API for XMLType
Accessing XMLType Data using JDBC
Using XMLType Data with JDBC
How Java Applications Use JDBC to Access XML Documents in Oracle XML DB
Manipulating XML Database Documents using JDBC
Loading a Large XML Document into the Database using JDBC
Java DOM API for XMLType Features
Creating XML Schema-Based Documents
JDBC or SQLJ
Java DOM API for XMLType Classes
Java Methods That Are Deprecated or Not Supported
Using the Java DOM API for XMLType
Handling Large Nodes using Java
Stream Extensions to Java DOM
Get-Pull Model
Get-Push Model
Set-Pull Model
Set-Push Model
Using the Java DOM API and JDBC with Binary XML
16
Using the C API for XML
Overview of the C API for XML (Oracle XDK and Oracle XML DB)
Using OCI and the C API for XML with Oracle XML DB
Accessing XMLType Data Stored in the Database
Creating XMLType Instances on the Client
XML Context Parameter for C DOM API Functions
OCIXmlDbInitXmlCtx() Syntax
OCIXmlDbFreeXmlCtx() Syntax
Initializing and Terminating an XML Context
Using the C API for XML with Binary XML
Using the Oracle XML Developer's Kit Pull Parser with Oracle XML DB
Common XMLType Operations in C
17
Using Oracle Data Provider for .NET with Oracle XML DB
ODP.NET XML Support and Oracle XML DB
ODP.NET Sample Code
Part IV Viewing Existing Data as XML
18
Generating XML Data from the Database
Overview of Generating XML Data From Oracle Database
Generating XML using SQL Functions
XMLELEMENT and XMLATTRIBUTES SQL/XML Functions
Escaping Characters in Generated XML Data
Formatting of XML Dates and Timestamps
XMLElement Examples
XMLFOREST SQL/XML Function
XMLCONCAT SQL/XML Function
XMLAGG SQL/XML Function
XMLPI SQL/XML Function
XMLCOMMENT SQL/XML Function
XMLSERIALIZE SQL/XML Function
XMLPARSE SQL/XML Function
XMLROOT Oracle SQL Function
XMLCOLATTVAL Oracle SQL Function
XMLCDATA Oracle SQL Function
Generating XML using DBMS_XMLGEN
Using PL/SQL Package DBMS_XMLGEN
Functions and Procedures of Package DBMS_XMLGEN
DBMS_XMLGEN Examples
SYS_XMLGEN Oracle SQL Function
Advantages of using Oracle SQL Function SYS_XMLGEN
Using XMLFormat Object Type
SYS_XMLAGG Oracle SQL Function
Guidelines for Generating XML with Oracle XML DB
Ordering Query Results Before Aggregating, using XMLAGG ORDER BY Clause
Returning a Rowset using XMLTABLE
19
XMLType Views
What Are XMLType Views?
Creating XMLType Views: Syntax
Creating Non-Schema-Based XMLType Views
Creating Non-Schema-Based XMLType Views using SQL/XML Publishing Functions
Creating Non-Schema-Based XMLType Views using Object Types and SYS_XMLGEN
Creating XML Schema-Based XMLType Views
Creating XML Schema-Based XMLType Views using SQL/XML Publishing Functions
Using Namespaces with SQL/XML Publishing Functions
Creating XML Schema-Based XMLType Views using Object Types or Object Views
Creating XMLType Employee View, with Nested Department Information
Creating XMLType Department View, with Nested Employee Information
Creating XMLType Views from XMLType Tables
Referencing XMLType View Objects using SQL Function REF
DML (Data Manipulation Language) on XMLType Views
20
Accessing Data Through URIs
Overview of Oracle XML DB URL Features
URIs and URLs
URIType and its Subtypes
DBUris and XDBUris – What For?
URIType Methods
HTTPURIType PL/SQL Method GETCONTENTTYPE()
DBURIType PL/SQL Method GETCONTENTTYPE()
DBURIType PL/SQL Method GETCLOB()
DBURIType PL/SQL Method GETBLOB()
Accessing Data using URIType Instances
XDBUris: Pointers to Repository Resources
XDBUri URI Syntax
XDBUri Examples
DBUris: Pointers to Database Data
Viewing the Database as XML Data
DBUri URI Syntax
DBUris are Scoped to a Database and Session
DBUri Examples
Targeting a Table
Targeting a Row in a Table
Targeting a Column
Retrieving the Text Value of a Column
Targeting a Collection
Creating New Subtypes of URIType using Package URIFACTORY
Registering New URIType Subtypes with Package URIFACTORY
SYS_DBURIGEN SQL Function
Rules for Passing Columns or Object Attributes to SYS_DBURIGEN
SYS_DBURIGEN SQL Function: Examples
Returning Partial Results
RETURNING URLs to Inserted Objects
DBUriServlet
Overriding the MIME Type using a URL
Customizing DBUriServlet
DBUriServlet Security
Configuring Package URIFACTORY to Handle DBUris
Part V Oracle XML DB Repository
21
Accessing Oracle XML DB Repository Data
Overview of Oracle XML DB Repository
Two Ways to Access Oracle XML DB Repository Resources
Repository Terminology and Supplied Resources
Repository Terminology
Supplied Files and Folders
Oracle XML DB Repository Resources
Where Is Repository Data Stored?
Names of Generated Tables
Defining Structured Storage for Resources
Oracle ASM Virtual Folder
Path-Name Resolution
Link Types
Repository and Document Links
Hard Links and Weak Links
Creating a Weak Link with No Knowledge of Folder Hierarchy
Restricting Multiple Hard Links
Navigational or Path Access to Repository Resources
Accessing Oracle XML DB Resources using Internet Protocols
Where You Can Use Oracle XML DB Protocol Access
Using Protocol Access
Retrieving Oracle XML DB Resources
Storing Oracle XML DB Resources
Using Internet Protocols and XMLType: XMLType Direct Stream Write
Accessing Oracle ASM Files using Protocols and Resource APIs – For DBAs
Query-Based Access to Repository Resources
Servlet Access to Repository Resources
Operations on Repository Resources
22
Configuring Oracle XML DB Repository
Resource Configuration Files Configure a Resource
Configuring a Resource
Common Configuration Parameters
Configuration Element ResConfig
Configuration Element defaultChildConfig
Configuration Element applicationData
23
Using XLink and XInclude with Oracle XML DB
Overview of XLink and XInclude
XLink and XInclude Link Types
XLink and XInclude Links Model Document Relationships
XLink and XInclude Link Types
XInclude: Compound Documents
Using XLink with Oracle XML DB
Using XInclude with Oracle XML DB
Expanding Compound-Document Inclusions
Validating Compound Documents
Updating Compound Documents
Versioning, Locking, and Controlling Access to Compound Documents
Examining XLink and XInclude Links using DOCUMENT_LINKS View
Querying DOCUMENT_LINKS for XLink Information
Querying DOCUMENT_LINKS for XInclude Information
Configuring Resources for XLink and XInclude
Configuring Treatment of Unresolved Links: UnresolvedLink Attribute
Configuring the Document Links to Create: LinkType Element
Configuring the Path Format for Retrieval: PathFormat Element
Configuring Conflict-Resolution for XInclude: ConflictRule Element
Configuring Decomposition of Documents using XInclude: SectionConfig Element
XLink and XInclude Configuration Examples
Managing XLink and XInclude Links using DBMS_XDB.processLinks
24
Managing Resource Versions
Overview of Oracle XML DB Versioning
Versioning and Resource IDs
Versioning and ACLs
Resource Versioning Examples
25
Accessing the Repository using RESOURCE_VIEW and PATH_VIEW
Overview of Oracle XML DB RESOURCE_VIEW and PATH_VIEW
RESOURCE_VIEW Definition and Structure
PATH_VIEW Definition and Structure
Understanding the Difference Between RESOURCE_VIEW and PATH_VIEW
Operations You Can Perform using UNDER_PATH and EQUALS_PATH
RESOURCE_VIEW and PATH_VIEW SQL Functions
UNDER_PATH SQL Function
EQUALS_PATH SQL Function
PATH SQL Function
DEPTH SQL Function
Using RESOURCE_VIEW and PATH_VIEW SQL Functions
Accessing Repository Data Paths, Resources and Links: Examples
Deleting Repository Resources: Examples
Deleting Nonempty Folder Resources
Updating Repository Resources: Examples
Working with Multiple Oracle XML DB Resources
Performance Tuning of Oracle XML DB Repository Operations
Searching for Resources using Oracle Text
26
Accessing the Repository using PL/SQL
Overview of PL/SQL Package DBMS_XDB
DBMS_XDB: Resource Management
DBMS_XDB: ACL-Based Security Management
DBMS_XDB: Configuration Management
27
Repository Access Control
Access Control Concepts
Principal: A User or Role
Database Roles Map Database Privileges to Users
Principal DAV::owner
Privilege: A Permission
Access Control Entry (ACE)
Access Control List (ACL)
Database Privileges for Repository Operations
Privileges
Atomic Privileges
Aggregate Privileges
ACLs and ACEs
System ACLs
ACL and ACE Evaluation
ACL Validation
ACL Inheritance
Complementing the Principals in an ACE: Element invert
ACE Validity Time Period
Working with Access Control Lists (ACLs)
Creating an ACL using DBMS_XDB.CREATERESOURCE
Retrieving an ACL Document, Given its Repository Path
Setting the ACL of a Resource
Deleting an ACL
Updating an ACL
Retrieving the ACL Document that Protects a Given Resource
Retrieving Privileges Granted to the Current User for a Particular Resource
Checking Whether the Current User Has Privileges on a Resource
Checking Whether a User Has Privileges using the ACL and Resource Owner
Retrieving the Path of the ACL that Protects a Given Resource
Retrieving the Paths of All Resources Protected by a Given ACL
ACL Caching
Repository Resources and Database Table Security
Optimization: Do not enforce acl-based security if you do not need it
Integrating Oracle XML DB with LDAP
28
Accessing the Repository using Protocols
Overview of Oracle XML DB Protocol Server
Session Pooling
Oracle XML DB Protocol Server Configuration Management
Configuring Protocol Server Parameters
Configuring Secure HTTP (HTTPS)
Enable the HTTP Listener to Use SSL
Enable TCPS Dispatcher
Interaction with Oracle XML DB File-System Resources
Protocol Server Handles XML Schema-Based or Non-Schema-Based XML Documents
Event-Based Logging
Using FTP and Oracle XML DB Protocol Server
Oracle XML DB Protocol Server: FTP Features
FTP Features That Are Not Supported
Supported FTP Client Methods
FTP Quote Methods
Using FTP with Oracle ASM Files
Using FTP on the Standard Port Instead of the Oracle XML DB Default Port
Using IPv6 IP Addresses with FTP
FTP Server Session Management
Handling Error 421. Modifying the Default Timeout Value of an FTP Session
FTP Client Failure in Passive Mode
Using HTTP(S) and Oracle XML DB Protocol Server
Oracle XML DB Protocol Server: HTTP(S) Features
HTTP(S) Features That Are Not Supported
Supported HTTP(S) Client Methods
Using HTTP(S) on a Standard Port Instead of an Oracle XML DB Default Port
Using IPv6 IP Addresses with HTTP(S)
HTTPS: Support for Secure HTTP
Controlling URL Expiration Time
Anonymous Access to Oracle XML DB Repository using HTTP
Using Java Servlets with HTTP(S)
Embedded PL/SQL Gateway
Sending Multibyte Data From a Client
Characters That Are Not ASCII in URLs
Controlling Character Sets for HTTP(S)
Using WebDAV and Oracle XML DB
Oracle XML DB WebDAV Features
WebDAV Features That Are Not Supported
Supported WebDAV Client Methods
Using WebDAV with Microsoft Windows XP SP2
Creating a WebFolder in Microsoft Windows using Oracle XML DB and WebDAV
29
User-Defined Repository Metadata
Overview of Metadata and XML
Kinds of Metadata – Uses of the Term
User-Defined Resource Metadata
Scenario: Metadata for a Photo Collection
XML Schemas to Define Resource Metadata
Adding, Updating, and Deleting Resource Metadata
Adding Metadata using APPENDRESOURCEMETADATA
Deleting Metadata using DELETERESOURCEMETADATA
Adding Metadata using SQL DML
Adding Metadata using WebDAV PROPPATCH
Querying XML Schema-Based Resource Metadata
XML Image Metadata from Binary Image Metadata
Adding Non-Schema-Based Resource Metadata
PL/SQL Procedures Affecting Resource Metadata
30
Oracle XML DB Repository Events
Overview of Repository Events
Repository Events: Use Cases
Repository Events and Database Triggers
Repository Event Listeners and Event Handlers
Repository Event Configuration
Possible Repository Events
Repository Operations and Events
Repository Event Handler Considerations
Configuring Repository Events
Configuration Element event-listeners
Configuration Element listener
Repository Events Configuration Examples
31
Using Oracle XML DB Content Connector
Overview of JCR and Oracle XML DB Content Connector
About the Content Repository API for Java (JCR)
About Oracle XML DB Content Connector
How Oracle XML DB Repository Is Exposed in JCR
Example of How Files and Folders are Exposed in JCR
Oracle Extensions to JCR Node Types
Binary and XML Content
System-Defined Metadata
User-Defined Metadata
Hard Links and Weak Links
How to Use Oracle XML DB Content Connector
Setting CLASSPATH
Obtaining the JCR Repository Object
Sample Code to Upload File
Additional Code Samples
Logging API for Oracle XML DB Content Connector
Supported JCR Compliance Levels
Oracle XML DB Content Connector Restrictions
Default Workspace Name
Operations Restricted to Specific Node Types
Determining the State of Files or Folders
Interaction Between Binary and XML Content
Order in Which Changes Are Saved
Undefined Properties
Node Type nt:base Is Abstract
Node jcr:content Is Created Automatically
Saving Normalizes Node jcr:xmltext
Node Type mix:referenceable
Full-Text Indexing
Using XML Schemas with JCR
Why Register XML Schemas for Use with JCR?
How to Register an XML Schema with JCR
How JCR Node Types are Generated from XML Schemas
Built-In Simple Types
XML Schema-Defined Simple Types
Complex Types
Global Element Declarations
32
Writing Oracle XML DB Applications in Java
Overview of Oracle XML DB Java Applications
Which Oracle XML DB APIs Are Available Inside and Outside the Database?
Design Guidelines: Java Inside or Outside the Database?
HTTP(S): Accessing Java Servlets or Directly Accessing XMLType Resources
Accessing Many XMLType Object Elements: Use JDBC XMLType Support
Use the Servlets to Manipulate and Write Out Data Quickly as XML
Writing Oracle XML DB HTTP Servlets in Java
Configuring Oracle XML DB Servlets
HTTP Request Processing for Oracle XML DB Servlets
Session Pool and Oracle XML DB Servlets
Native XML Stream Support
Oracle XML DB Servlet APIs
Oracle XML DB Servlet Example
33
Using Native Oracle XML DB Web Services
Overview of Native Oracle XML DB Web Services
Configuring and Enabling Web Services for Oracle XML DB
Configuring Web Services for Oracle XML DB
Enabling Web Services for Specific Users
Querying Oracle XML DB using a Web Service
Accessing PL/SQL Stored Procedures using a Web Service
Example of Using a PL/SQL Function with a Web Service
Part VI Oracle Tools that Support Oracle XML DB
34
Administering Oracle XML DB
Installing Oracle XML DB
Installing Oracle XML DB with Database Configuration Assistant
Dynamic Protocol Registration of FTP and HTTP(S) Services with Local Listener
Installing Oracle XML DB Manually without DBCA
Post-Installation
Upgrading an Existing Oracle XML DB Installation
Validation of ACL Documents and Configuration File
Administering Oracle XML DB using Oracle Enterprise Manager
Configuring Oracle XML DB using xdbconfig.xml
Oracle XML DB Configuration File, xdbconfig.xml
<xdbconfig> (Top-Level Element)
<sysconfig> (Child of <xdbconfig>)
<userconfig> (Child of <xdbconfig>)
<protocolconfig> (Child of <sysconfig>)
<httpconfig> (Child of <protocolconfig>)
<servlet> (Descendant of <httpconfig>)
Oracle XML DB Configuration File Example
Oracle XML DB Configuration API
Configuring Default Namespace to Schema Location Mappings
Configuring XML File Extensions
Package DBMS_XDB_ADMIN
35
Loading XML Data using SQL*Loader
Overview of Loading XMLType Data Into Oracle Database
Loading XMLType Data using SQL*Loader
Loading XMLType Data in LOBs using SQL*Loader
Loading LOB Data in Predetermined Size Fields
Loading LOB Data in Delimited Fields
Loading XML Columns Containing LOB Data from LOBFILEs
Specifying LOBFILEs
Loading XMLType Data Directly from a Control File using SQL*Loader
Loading Large XML Documents into Oracle Database
36
Exporting and Importing XMLType Tables
Overview of Oracle Data Pump
EXPORT/IMPORT Support in Oracle XML DB
Exporting XML Schema-Based XMLType Tables
Exporting Hierarchy-Enabled (Repository) Tables
Exporting and Importing Transportable Tablespaces
Repository Resources and Foldering Support
Full Database Export
Exporting and Importing with Different Character Sets
Export/Import Syntax and Examples
Performing a Table-Mode Export /Import
Performing a Schema-Mode Export/Import
37
Exchanging XML Data using Oracle Streams AQ
How Do AQ and XML Complement Each Other?
AQ and XML Message Payloads
Advantages of Using AQ
Oracle Streams and AQ
Streams Message Queuing
XMLType Attributes in Object Types
Internet Data Access Presentation (iDAP)
iDAP Architecture
XMLType Queue Payloads
Guidelines for Using XML and Oracle Streams Advanced Queuing
Storing Oracle Streams AQ XML Messages with Many PDFs as One Record?
Adding New Recipients After Messages Are Enqueued
Enqueuing and Dequeuing XML Messages?
Parsing Messages with XML Content from Oracle Streams AQ Queues
Preventing the Listener from Stopping Until the XML Document Is Processed
Using HTTPS with AQ
Storing XML in Oracle Streams AQ Message Payloads
Comparing iDAP and SOAP
Part VII Appendixes
A
Oracle-Supplied XML Schemas and Examples
XDBResource.xsd: XML Schema for Oracle XML DB Resources
XDBResource.xsd
XDBResConfig.xsd: XML Schema for Resource Configuration
XDBResConfig.xsd
acl.xsd: XML Schema for ACLs
acl.xsd
xdbconfig.xsd: XML Schema for Configuring Oracle XML DB
xdbconfig.xsd
xdiff.xsd: XML Schema for Comparing Schemas for In-Place Evolution
xdiff.xsd
Purchase-Order XML Schemas
XSL Style Sheet Example, PurchaseOrder.xsl
Loading XML Data using C (OCI)
Initializing and Terminating an XML Context (OCI)
B
Oracle XML DB Restrictions
Index
Scripting on this page enhances content navigation, but does not change the content in any way.