1/61
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
Changes in This Release for Oracle XML DB Developer's Guide
Changes in Oracle Database 12
c
Release 1 (12.1.0.2) for Oracle Database
Changes in Oracle Database 12
c
Release 1 (12.1.0.1) for Oracle XML DB
Changes in Oracle Database 11
g
Release 2 (11.2.0.3) for Oracle XML DB
Changes in Oracle Database 11
g
Release 2 (11.2.0.2) for Oracle XML DB
Changes in Oracle Database 11
g
Release 2 (11.2.0.1) for Oracle XML DB
Changes in Oracle Database 11
g
Release 1 (11.1) for Oracle XML DB
Part I Oracle XML DB Basics
1
Introduction to Oracle XML DB
Overview of Oracle XML DB
Oracle XML DB Benefits
Data and Content Unified
Database Capabilities for Working with XML
Advantages of Storing Data as XML in the Database
Data Duality: XML and Relational
Use XMLType Views If Your Data Is Not XML
Efficient Storage and Retrieval of Complex XML Documents
Oracle XML DB Architecture
Oracle XML DB Features
XMLType Data Type
XMLType Storage Models
XML Schema Support
DTD Support in Oracle XML DB
Inline DTD Definitions
External DTD Definitions
Static Data Dictionary Views Related to XML
SQL/XML Standard Functions
Programmatic Access to Oracle XML DB (Java, PL/SQL, and C)
Oracle XML DB Repository: Overview
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
XML Data Storage
Structure of Your XML Data
Application Language
XML Processing Options
Oracle XML DB Repository Access
Oracle XML DB Cooperates with Other Database Options and Features
3
Overview of How To Use Oracle XML DB
Creating XMLType Tables and Columns
Creating Virtual Columns on XMLType Data Stored as Binary XML
Partitioning Tables That Contain XMLType Data Stored as Binary XML
Enforcing XML Data Integrity Using the Database
Enforcing Referential Integrity Using SQL Constraints
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_REPOS
Loading Documents into the Repository Using Protocols
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
Updating XML Content Stored in Oracle XML DB
Generating XML Data from Relational Data
Generating XML Data from Relational Data Using SQL/XML Functions
Generating XML Data from Relational Data Using DBURITYPE
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
Part II Manipulation of XML Data in Oracle XML DB
4
XQuery and Oracle XML DB
Overview of the XQuery Language
XPath Expressions Are XQuery Expressions
XQuery: A Functional Language Based on Sequences
XQuery Is About Sequences
XQuery Is Referentially Transparent
XQuery Update Has Side Effects on Your Data
XQuery Update Snapshots
XQuery Full Text Provides Full-Text Search
XQuery Expressions
FLWOR Expressions
Overview of XQuery in Oracle XML DB
When To Use XQuery
Predefined XQuery Namespaces and Prefixes
SQL/XML Functions XMLQUERY, XMLTABLE, XMLExists, and XMLCast
XMLQUERY SQL/XML Function in Oracle XML DB
XMLTABLE SQL/XML Function in Oracle XML DB
Chaining Calls to SQL/XML Function XMLTABLE
XMLEXISTS SQL/XML Function in Oracle XML DB
XMLCAST SQL/XML Function in Oracle XML DB
URI Scheme oradb: Querying Table or View Data with XQuery
Oracle XQuery Extension Functions
ora:contains XQuery Function
ora:sqrt XQuery Function
ora:tokenize XQuery Function
ora:matches XQuery Function (Deprecated)
ora:replace XQuery Function (Deprecated)
Oracle XQuery Extension-Expression Pragmas
XQuery Static Type-Checking in Oracle XML DB
Oracle XML DB Support for XQuery
Support for XQuery and SQL
Implementation Choices Specified in the XQuery Standards
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
Support for XQuery Full Text
XQuery Full Text, XML Schema-Based Data, and Pragma ora:no_schema
Restrictions on Using XQuery Full Text with XMLExists
Supported XQuery Full Text FTSelection Operators
Supported XQuery Full Text Match Options
Unsupported XQuery Full Text Features
XQuery Full Text Errors
5
Query and Update of XML Data
Using XQuery with Oracle XML DB
XQuery Sequences Can Contain Data of Any XQuery Type
Querying XML Data in Oracle XML DB Repository Using XQuery
Querying Relational Data Using XQuery and URI Scheme oradb
Querying XMLType Data Using XQuery
Using Namespaces with XQuery
Querying XML Data Using SQL and PL/SQL
SQL*Plus XQUERY Command
Using XQuery with XQJ to Access Database Data
Using XQuery with PL/SQL, JDBC, and ODP.NET to Access Database Data
Updating XML Data
Updating an Entire XML Document
Replacing XML Nodes
Updating XML Data to NULL Values
Inserting Child XML Nodes
Deleting XML Nodes
Creating XML Views of Modified XML Data
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
6
Indexes for 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 for XML Data
Optimization Chooses the Right Indexes to Use
Function-Based Indexes Are Deprecated for XMLType
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
Exchange Partitioning and XMLIndex
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
Using Namespaces and Storage Clauses with an XMLIndex Structured Component
Adding a Structured Component to an XMLIndex Index
Using Non-Blocking ALTER INDEX with an XMLIndex Structured Component
Modifying the Data Type of a Structured XMLIndex Component
Dropping an XMLIndex Structured Component
Indexing the Relational Tables of a Structured XMLIndex 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
Syncing an XMLIndex Index in Case of Error ORA-08181
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
Indexing XML Data for Full-Text Queries
Creating and Using an XML Search Index
What To Do If an XML Search Index Is Not Picked Up
Pragma ora:no_schema: Using XML Schema-Based Data with XQuery Full Text
Pragma ora:use_xmltext_idx: Forcing the Use of an XML Search Index
Migrating from Using Oracle Text Index to XML Search Index
Indexing XMLType Data Stored Object-Relationally
Indexing Non-Repeating Text Nodes or Attribute Values
Indexing Repeating (Collection) Elements
7
Transformation and Validation of XMLType Data
XSL Transformation and Oracle XML DB
SQL Function XMLTRANSFORM and XMLType Method TRANSFORM()
XMLTRANSFORM and XMLType.transform(): Examples
XSL Transformation Using DBUri Servlet
Validation of XMLType Instances
Partial and Full XML Schema Validation
Partial Validation
Full Validation
Validating XML Data Stored as XMLType: Examples
Part III Relational Data To and From XML Data
8
Generation of XML Data from Relational Data
Overview of Generating XML Data
Generation of XML Data Using SQL Functions
XMLELEMENT and XMLATTRIBUTES SQL/XML Functions
Escape of 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
Generation of XML Data Using DBMS_XMLGEN
Using PL/SQL Package DBMS_XMLGEN
Functions and Procedures of Package DBMS_XMLGEN
DBMS_XMLGEN Examples
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
9
Relational Views over XML Data
Introduction to Creating and Using Relational Views over XML Data
Creating a Relational View over XML: One Row for Each XML Document
Creating a Relational View over XML: Mapping XML Nodes to Columns
Indexing Binary XML Data Exposed Using a Relational View
Querying XML Content As Relational Data
10
XMLType Views
What Are XMLType Views?
CREATE VIEW for XMLType Views: Syntax
Creating Non-Schema-Based XMLType Views
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
Part IV XMLType APIs
11
PL/SQL APIs for XMLType
Overview of PL/SQL APIs for XMLType
PL/SQL APIs for XMLType: Features
Lazy Loading of XML Data (Lazy Manifestation)
XMLType Data Type Supports XML Schema
XMLType Supports Data in Different Character Sets
PL/SQL APIs for XMLType: References
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
Application Design Using Oracle XML Developer's Kit and Oracle XML DB
Preparing XML Data to Use the PL/SQL DOM API for XMLType
XML Schema Types Are Mapped to SQL Object Types
DOM Fidelity for XML Schema Mapping
Wrap Existing Data as XML with XMLType Views
DBMS_XMLDOM Methods Supported by Oracle XML DB
PL/SQL DOM API for XMLType: Node Types
PL/SQL Function NEWDOMDOCUMENT and DOMDOCUMENT Nodes
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)
Transformations and Conversions with XSLT
PL/SQL XSLT Processor for XMLType: Features
Using the PL/SQL XSLT Processor API for XMLType (DBMS_XSLPROCESSOR)
12
PL/SQL Package DBMS_XMLSTORE
Using Package DBMS_XMLSTORE
Inserting an XML Document Using DBMS_XMLSTORE
Updating XML Data Using DBMS_XMLSTORE
Deleting XML Data Using DBMS_XMLSTORE
13
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
Permissions on MS Windows for Java DOM API, a Thick Connection, and Java Security Manager
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
Large XML Node Handling with 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
14
The C API for XML
Overview of the C API for XML
OCI and the C API for XML: Use 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
15
Oracle XML DB and Oracle Data Provider for .NET
Oracle XML DB Support for ODP.NET XML
ODP.NET Sample Code
Part V XML Schema and Object-Relational XMLType
16
Choice of XMLType Storage and Indexing
Introduction to Choosing an XMLType Storage Model and Indexing Approaches
XMLType Use Case Spectrum: Data-Centric to Document-Centric
Common Use Cases for XML Data Stored as XMLType
XMLType Use Case: No XML Fragment Updating or Querying
XMLType Use Case: Data Integration from Diverse Sources with Different XML Schemas
XMLType Use Case: Staged XML Data for ETL
XMLType Use Case: Semi-Structured XML Data
XMLType Use Case: Business intelligence Queries
XMLType Use Case: XML Queries Involving Full-Text Search
Considerations for Choosing XMLType Storage Model and Indexing
XMLType Storage Model Considerations
XMLType Indexing Considerations
XMLType Storage Options: Relative Advantages
17
XML Schema Storage and Query: Basic
Overview of XML Schema
XML Schema for Schemas
XML Schema Features
XML Instance Documents
XML Namespaces and XML Schemas
Overview of Editing XML Schemas
Overview of Using XML Schema with Oracle XML DB
Why Use XML Schema with Oracle XML DB?
Overview of Annotating an XML Schema to Control Naming, Mapping, and Storage
DOM Fidelity
XMLType Methods Related to XML Schema
XML Schema Registration with Oracle XML DB
XML Schema Registration Actions
Registering an XML Schema with Oracle XML DB
SQL Types and Tables Created During XML Schema Registration
Guidelines for Working with Global Elements
Database Objects That Depend on Registered XML Schemas
Local and Global XML Schemas
Local XML Schema
Global XML Schema
Fully Qualified XML Schema URLs
Deleting an XML Schema
Listing All Registered XML Schemas
Creating XMLType Tables and Columns Based on XML Schemas
Specification of XMLType Storage Options for XML Schema-Based Data
Binary XML Storage of XML Schema-Based Data
Object-Relational Storage of XML Schema-Based Data
Ways to Identify XML Schema Instance Documents
Attributes noNamespaceSchemaLocation and schemaLocation
XML Schema and Multiple Namespaces
XML Schema Data Types Are Mapped to Oracle XML DB Storage
18
XML Schema Storage and Query: Object-Relational Storage
Object-Relational Storage of XML Documents
How Collections Are Stored for Object-Relational XMLType Storage
SQL Types Created during XML Schema Registration for Object-Relational Storage
Default Tables Created during XML Schema Registration
Do Not Use Internal Constructs Generated during XML Schema Registration
Generated Names are Case Sensitive
SYS_XDBPD$ and DOM Fidelity for Object-Relational Storage
Oracle XML Schema Annotations
Common Uses of XML Schema Annotations
XML Schema Annotation Example
Annotating an XML Schema Using DBMS_XMLSCHEMA_ANNOTATE
Available Oracle XML DB XML Schema Annotations
XML Schema Annotation Guidelines for Object-Relational 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
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
Obtaining Annotations from One XML Schema to Apply to Another
How to Map XML Schema Data Types to SQL Data Types
Example of Mapping XML Schema Data Types to SQL
XML Schema Attribute Data Types Mapped to SQL
Overriding the SQLType Value in an XML Schema When Declaring Attributes
XML Schema Element Data Types Mapped to SQL
Override of the SQLType Value in an XML Schema When Declaring Elements
How XML Schema simpleType Is Mapped to SQL
NCHAR, NVARCHAR2, and NCLOB SQLType Values are Not Supported
simpleType: Mapping XML Strings to SQL VARCHAR2 Versus CLOB
Working with Time Zones
How XML Schema complexType Is Mapped to SQL
Attribute Specification in a complexType XML Schema Declaration
complexType Extensions and Restrictions in Oracle XML DB
complexType Declarations in XML Schema: Handling Inheritance
How a complexType Based on simpleContent Is Mapped to an Object Type
How any and anyAttribute Declarations Are Mapped to Object Type Attributes
Creating XML Schema-Based XMLType Columns and Tables
Partitioning of XMLType Tables and Columns Stored Object-Relationally
Examples of Partitioning XMLType Data
Partition Maintenance
Specifying Relational Constraints on XMLType Tables and Columns
Adding Unique Constraints to the Parent Element of an Attribute
Out-Of-Line Storage of XMLType Data
Setting Annotation Attribute xdb:SQLInline to false for Out-Of-Line Storage
Storing Collections in Out-Of-Line Tables
Considerations for Working with Complex or Large XML Schemas
Working with Circular and Cyclical Dependencies Among XML Schemas
For Circular XML Schema Dependencies Set Parameter GENTABLES to TRUE
complexType Declarations XML Schema: Handling Cycles
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
Mapping XML Fragments to Large Objects (LOBs)
Issues with Large XML Schemas
Considerations for Loading and Retrieving Large Documents with Collections
Guidelines for Setting xdbcore Parameters
Debugging XML Schema Registration for XML Data Stored Object-Relationally
19
XPath Rewrite for Object-Relational Storage
Overview of XPath Rewrite for Object-Relational Storage
Examples of XPath Expressions that Are Rewritten
XPath Rewrite for Out-Of-Line Tables
Guidelines for Using Execution Plans to Analyze and Optimize XPath Queries
Guideline: Look for underlying tables versus XML functions in execution plans
Guideline: Name the object-relational 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
20
XML Schema Evolution
Overview of XML Schema Evolution
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 an XSLT Stylesheet
Examples of Using Procedure COPYEVOLVE
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
The diffXML Parameter Document
diffXML Operations and Examples
Part VI Oracle XML DB Repository
21
Accessing Oracle XML DB Repository Data
Overview of Oracle XML DB Repository
Oracle XML DB Provides Name-Level Locking
Two Ways to Access Oracle XML DB Repository Resources
Database Schema (User Account) XDB and the Repository
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 Object-Relational Storage for Resources
Oracle ASM Virtual Folder
How Documents are Stored in the Repository
Repository Data Access Control
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
Access to Oracle XML DB Resources Using Internet Protocols
Where You Can Use Oracle XML DB Protocol Access
Overview of Protocol Access to Oracle XML DB
Retrieval of Oracle XML DB Resources
Storage of Oracle XML DB Resources
Internet Protocols and XMLType: XMLType Direct Stream Write
Access to 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
Accessing the Content of Repository Resources 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 by Updating the Resource Document
Updating XML Schema-Based Documents in the Repository by Updating the Default Table
Querying Resources in RESOURCE_VIEW and PATH_VIEW
Oracle XML DB Hierarchical Repository Index
22
How to Configure 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
How To Use 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
Oracle XML DB Support for XLink
Oracle XML DB Support for XInclude
Expanding Compound-Document Inclusions
Validation of Compound Documents
Update of a Compound Document
Compound Document Versioning, Locking, and Access Control
Use DOCUMENT_LINKS View to Examine XLink and XInclude Links
Querying DOCUMENT_LINKS for XLink Information
Querying DOCUMENT_LINKS for XInclude Information
Configuration of Repository Resources for XLink and XInclude
Configure the Treatment of Unresolved Links: Attribute UnresolvedLink
Configure the Type of Document Links to Create: Element LinkType
Configure the Path Format for Retrieval: Element PathFormat
Configure Conflict-Resolution for XInclude: Element ConflictRule
Configure the Decomposition of Documents Using XInclude: Element SectionConfig
XLink and XInclude Configuration Examples
Manage XLink and XInclude Links Using DBMS_XDB_REPOS.processLinks
24
Repository Access 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
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
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
25
Resource Versions
Overview of Oracle XML DB Versioning
Overview of PL/SQL Package DBMS_XDB_VERSION
Resource Versions and Resource IDs
Resource Versions and ACLs
Resource Versioning Examples
26
PL/SQL Access to Oracle XML DB Repository
DBMS_XDB_REPOS: Access and Manage Repository Resources
DBMS_XDB_REPOS: ACL-Based Security Management
DBMS_XDB_CONFIG: Configuration Management
27
Repository Access Control
Access Control Concepts
Authentication and Authorization
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
Element invert: Complement the Principals in an ACE
Working with Access Control Lists (ACLs)
Creating an ACL Using DBMS_XDB_REPOS.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
Integration Of Oracle XML DB with LDAP
28
Repository Access Using Protocols
Overview of Oracle XML DB Protocol Server
Session Pooling
Oracle XML DB Protocol Server Configuration Management
Configuration of Protocol Server Parameters
Configuring Secure HTTP (HTTPS)
Enabling the HTTP Listener to Use SSL
Enabling TCPS Dispatcher
Using Listener Status to Check Port Configuration
Configuring Protocol Port Parameters after Database Consolidation
Configuration and Management of Authentication Mechanisms for HTTP
Nonces for Digest Authentication
Oracle XML DB Repository and 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
Uploading Content to Oracle XML DB Repository Using FTP
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
HTTP(S) and Oracle XML DB Protocol Server
Oracle XML DB Protocol Server: HTTP(S) Features
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
Control of URL Expiration Time
Anonymous Access to Oracle XML DB Repository Using HTTP
Use of Java Servlets with HTTP(S)
Embedded PL/SQL Gateway
Transmission of Multibyte Data From a Client
Characters That Are Not ASCII in URLs
Character Sets for HTTP(S)
WebDAV and Oracle XML DB
Oracle XML DB WebDAV Features
WebDAV Features That Are Not Supported by Oracle XML DB
WebDAV Client Methods Supported by Oracle XML DB
WebDAV and Microsoft Windows XP SP2
Creating a WebFolder in Microsoft Windows Using Oracle XML DB and WebDAV
Copying Files into Oracle XML DB Repository Using 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
Addition, Modification, and Deletion of 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
Configuration of Repository Events
Configuration Element event-listeners
Configuration Element listener
Repository Events Configuration Examples
31
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
CLASSPATH for Oracle XML DB Content Connector
Obtaining the JCR Repository Object
Java Code to Upload a File to the Repository using Oracle XML DB Content Connector
Additional Code Examples
Use the Standard Java 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
XML Schemas and 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
How to Write 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
Configuration of 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
Data Access Using 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
Create 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
Table or View Access from a Browser Using DBUri Servlet
34
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
Access to PL/SQL Stored Procedures Using a Web Service
Example of Using a PL/SQL Function with a Web Service
Part VII Oracle Tools that Support Oracle XML DB
35
Administration of Oracle XML DB
Upgrade or Downgrade of an Existing Oracle XML DB Installation
Authentication Considerations for Database Installation, Upgrade and Downgrade
Authentication Considerations for a Database Installation
Authentication Considerations for a Database Upgrade
Authentication Considerations for a Database Downgrade
Automatic Installation of Oracle XML DB
Validation of ACL Documents and Configuration File
Administration of Oracle XML DB Using Oracle Enterprise Manager
Configuration of Oracle XML DB Using xdbconfig.xml
Oracle XML DB Configuration File, xdbconfig.xml
Element xdbconfig (Top-Level)
Element sysconfig (Child of xdbconfig)
Element userconfig (Child of xdbconfig)
Element protocolconfig (Child of sysconfig)
Element httpconfig (Child of protocolconfig)
Element 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
Oracle XML DB and Database Consolidation
Package DBMS_XDB_ADMIN
36
How to Load XML Data
Overview of Loading XMLType Data Into Oracle Database
Load XMLType Data Using SQL*Loader
Load XMLType Data in LOBs Using SQL*Loader
Loading LOB Data in Predetermined Size Fields
Load LOB Data in Delimited Fields
Load XML Columns Containing LOB Data from LOBFILEs
Specify LOBFILEs
Load XMLType Data Directly from a Control File Using SQL*Loader
Loading Large XML Documents Using SQL*Loader
37
Export and Import of Oracle XML DB Data
Overview of Exporting and Importing XMLType Tables
Export/Import Limitations for Oracle XML DB Repository
Export/Import Syntax and Examples
Performing a Table-Mode Export /Import
Performing a Schema-Mode Export/Import
38
XML Data Exchange Using Oracle Streams AQ
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): SOAP for AQ
iDAP Architecture
XMLType Queue Payloads
Guidelines for Using XML and Oracle Streams Advanced Queuing
Store Oracle Streams AQ XML Messages with Many PDFs as One Record?
Add New Recipients After Messages Are Enqueued
Enqueue and Dequeue XML Messages?
Parse Messages with XML Content from Oracle Streams AQ Queues
Prevent the Listener from Stopping Until the XML Document Is Processed
HTTPS with AQ
Store XML in Oracle Streams AQ Message Payloads
iDAP and SOAP
Part VIII JSON
39
JSON in Oracle Database
Overview of JSON
Overview of JSON Syntax and the Data It Represents
Overview of JSON Compared with XML
Overview of JSON in Oracle Database
Getting Started Using JSON with Oracle Database
JSON: Character Sets and Character Encoding in Oracle Database
Escape of Unicode Characters in JSON Data
Oracle JSON Path Expressions
Oracle JSON Path Expression Syntax
Oracle JSON Basic Path Expression Syntax
Oracle JSON Path Expression Syntax Relaxation
Oracle SQL Functions and Conditions for Use with JSON Data
Clauses Used in Oracle SQL Functions and Conditions for JSON
RETURNING Clause for Oracle SQL Functions for JSON
Wrapper Clause for Oracle SQL Functions JSON_QUERY and JSON_TABLE
Error Clause for Oracle SQL Functions for JSON
Oracle SQL Conditions IS JSON and IS NOT JSON
Using a Check Constraint To Ensure that a Column Contains JSON Data
Determining Whether a Column Necessarily Contains JSON Data
Unique Versus Duplicate Keys in JSON Objects
About Strict and Lax JSON Syntax
Specifying Strict or Lax Oracle JSON Syntax
Oracle SQL Condition JSON_EXISTS
JSON_EXISTS as JSON_TABLE
Oracle SQL Function JSON_VALUE
Using Oracle SQL Function JSON_VALUE With a Boolean JSON Value
Oracle SQL Function JSON_VALUE Applied to a null JSON Value
JSON_VALUE as JSON_TABLE
Oracle SQL Function JSON_QUERY
JSON_QUERY as JSON_TABLE
Oracle SQL Function JSON_TABLE
JSON_TABLE Generalizes Other Oracle SQL Functions
Using JSON_TABLE with JSON Arrays
Simple Dot-Notation Access to JSON Data
Indexes for JSON Data
How To Tell Whether a Function-Based Index for JSON Data Is Picked Up
Creating Bitmap Indexes for Oracle SQL Condition JSON_EXISTS
Creating JSON_VALUE Function-Based Indexes
Using a JSON_VALUE Function-Based Index with JSON_TABLE Queries
Data Type Considerations for JSON_VALUE Indexing and Querying
Indexing Multiple JSON Properties Using a Composite B-Tree Index
Full-Text Search of JSON Data
Loading External JSON Data
Replication of JSON Data
Oracle Database Support for JSON
Part IX 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
XSLT Stylesheet Example, PurchaseOrder.xsl
Loading XML Data Using C (OCI)
Initializing and Terminating an XML Context (OCI)
B
Oracle XML DB Restrictions
C
Deprecated Functions for Updating XML Data
Migration from Oracle Functions for Updating XML Data to XQuery Update
Deprecated Oracle SQL Functions for Updating XML Data
Insertion of XML Elements Using Deprecated Oracle SQL Functions
UPDATEXML Deprecated Oracle SQL Function
Deprecated Oracle SQL Function UPDATEXML and NULL Values
Update of the Same XML Node More Than Once Using UPDATEXML (Deprecated)
Guidelines for Preserving DOM Fidelity When Using UPDATEXML (Deprecated)
When DOM Fidelity is Preserved
When DOM Fidelity is Not Preserved
How to Tell Whether DOM Fidelity is Preserved
Optimization of Deprecated Oracle SQL Functions that Modify XML Data
Creating XML Views Using Deprecated Oracle SQL Functions that Modify XML Data
INSERTCHILDXML Deprecated Oracle SQL Function
INSERTCHILDXMLBEFORE Deprecated Oracle SQL Function
INSERTCHILDXMLAFTER Deprecated Oracle SQL Function
INSERTXMLBEFORE Deprecated Oracle SQL Function
INSERTXMLAFTER Deprecated Oracle SQL Function
APPENDCHILDXML Deprecated Oracle SQL Function
DELETEXML Deprecated Oracle SQL Function
D
Deprecated Constructs for XML Translation
XML Translations (Deprecated)
Changes to an XML Schema and XML Instance Documents for Translation (Deprecated)
Indication of Translatable Elements in an XML Schema (Deprecated)
Indication of Translation Language Attributes in an XML Instance Document
Making XML Documents Translatable (Deprecated)
Operations on Translated Documents (Deprecated)
PL/SQL Package DBMS_XMLTRANSLATIONS (Deprecated)
DBMS_XMLTRANSLATIONS Methods (Deprecated)
E
Full-Text Search over XML Data Without XQuery
Overview of Oracle-Specific Full-Text Search over XML Data
Comparison of Full-Text Search and Other Search Types
Search of XML DataBarri8ora
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 SQL Function CONTAINS and XPath Function ora:contains
Overview of SQL Function CONTAINS
Overview of XPath Function ora:contains
Comparison of SQL Function CONTAINS and XPath Function ora:contains
SQL Function CONTAINS
Full-Text Search Using SQL Function CONTAINS
Full-Text Boolean Operators AND, OR, and NOT
Full-Text Stemming: $
Combining Boolean and Stemming Operators
SQL Function SCORE
Scope of a CONTAINS Search
Using Structure Operator WITHIN
Using Structure Operator INPATH
Using Structure Operator HASPATH
Projecting the CONTAINS Result
CONTEXT Index
Using 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
Scope of an ora:contains Query
Projecting the ora:contains Result
Using Policies with ora:contains Queries
Using a Policy with ora:contains Queries for Stopwords
Effect of Policies on ora:contains
Policy Defaults
Improving the Performance of ora:contains
Using 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
Index
Scripting on this page enhances content navigation, but does not change the content in any way.