This chapter describes the new features and functionality, enhancements, APIs, and product integration support added to Oracle XML DB for Oracle Database 11g.
It also describes the deprecation of certain Oracle XML DB constructs.
The following Oracle XML DB constructs are deprecated in Oracle Database 11g Release 2 (11.2.0.3). They are still supported in 11.2.0.3 for backward compatibility, but Oracle recommends that you do not use them in new applications.
PL/SQL procedure DBMS_XDB_ADMIN.createRepositoryXMLIndex
PL/SQL procedure DBMS_XDB_ADMIN.XMLIndexAddPath
PL/SQL procedure DBMS_XDB_ADMIN.XMLIndexRemovePath
PL/SQL procedure DBMS_XDB_ADMIN.dropRepositoryXMLIndex
XML schema annotation (attribute) csx:encodingType
XMLIndex
index on CLOB
portions of hybrid XMLType
storage, that is, on CLOB
data that is embedded within object-relational storage
The following PL/SQL procedures have been moved from package DBMS_XDB
to package DBMS_XDB_ADMIN
in Oracle Database 11g Release 2 (11.2.0.3):
moveXDB_tablespace
rebuildHierarchicalIndex
The following Oracle XML DB features are new in Oracle Database 11g Release 2 (11.2.0.2).
Default Storage Model for XMLType
The default XMLType
storage model is used if you do not specify a storage model when you create an XMLType
table or column. Prior to Oracle Database 11g Release 2 (11.2.0.2), unstructured (CLOB
) storage was used by default. The default storage model is now binary XML storage.
Note:
You can create a new table that uses binary XML storage and populate it with existingXMLType
data that is stored using CLOB
storage. Use CREATE TABLE AS SELECT
..., selecting from the existing data.This functionality is available starting with Oracle Database 11g Release 2 (11.2.0.2).
Default LOB Storage for Binary XML
XMLType
data that uses the binary XML storage model is stored internally using large objects (LOBs). Prior to Oracle Database 11g Release 2 (11.2.0.2), binary XML data was stored by default using the BasicFile LOB storage option. By default, LOB storage for binary XML data now uses the SecureFile LOB storage option whenever possible.
If SecureFile LOB storage is not possible then the default behavior uses BasicFile LOB storage. This can occur if either of the following is true:
The tablespace for the XMLType
table does not use automatic segment space management.
A setting in file init.ora
prevents SecureFile LOB storage. For example, see parameter DB_SECUREFILE
.
See Also:
Oracle Database Administrator's Guide for information about automatic segment space management
Oracle Database Reference for information about parameter DB_SECUREFILE
"Oracle Database 11g Release 2 (11.2.0.2) Deprecated Oracle XML DB Constructs"
This functionality is available starting with Oracle Database 11g Release 2 (11.2.0.2).
XQuery Pragma ora:defaultTable for Repository Query Performance
Previously, to obtain optimal performance for XQuery expressions that use fn:doc
and fn:collection
over Oracle XML DB Repository resources, you needed to carry out explicit joins with RESOURCE_VIEW
. The new XQuery extension-expression pragma ora:defaultTable
now performs the necessary joins automatically.
This functionality is available starting with Oracle Database 11g Release 2 (11.2.0.2).
XML Diagnosability Mode: SQL*Plus System Variable XMLOptimizationCheck
You can use the SQL*Plus SET
command with the new system variable XMLOptimizationCheck
to turn on an XML diagnosability mode for SQL. When this mode is on, execution plans are automatically checked for XPath rewrite, and if a plan is suboptimal then an error is raised and diagnostic information is written to the trace file indicating which operators are not rewritten.
This functionality is available starting with Oracle Database 11g Release 2 (11.2.0.2).
The following Oracle XML DB constructs are deprecated in Oracle Database 11g Release 2 (11.2.0.2). They are still supported in 11.2.0.2 for backward compatibility, but Oracle recommends that you do not use them in new applications.
XMLType
data stored as binary XML using BasicFile LOB storage. See also the new feature "Default LOB Storage for Binary XML".
Oracle XQuery function ora:view
– Use XQuery functions fn:doc
and fn:collection
instead. See Chapter 5, "Using XQuery with Oracle XML DB".
The following Oracle XML DB features are new in Oracle Database 11g Release 2 (11.2.0.1).
Partitioning XMLType Tables and Columns
For XMLType
data stored object-relationally, when you partition a base XMLType
table or a base table with an XMLType
column, any collection tables that use heap-based table storage are now, by default, automatically equipartitioned also. Equipartitioning means that there is a corresponding collection-table partition for each partition of the base table. A child element is stored in the collection-table partition that corresponds to the base-table partition of its parent element.
Access control lists (ACLs) have been enhanced in various ways, to provide fine-grained access control that you can customize. You can define your own privileges and associate them with users and roles in flexible ways. Inheritance is available for ACLs. Access control entries (ACEs) can stipulate start and end dates. You can control access for application users and roles that are not necessarily the same as database users and roles.
See Also:
Chapter 27, "Repository Access Control"Repository Read and Write Performance Enhancements
Performance has been improved for Oracle XML DB Repository read and write operations.
Binary XML Performance Enhancements and Partitioning
The performance of queries and DML operations on binary XML tables has been improved, and you can now partition binary XML tables, using a virtual column as the partitioning key.
You can use XMLIndex
to index islands of structured XML content embedded in content that is generally unstructured. An XMLIndex
index can thus index both structured and unstructured XML content.
You can create a local XMLIndex
index on data in partitioned XMLType
tables.
See Also:
"XMLIndex"You can use a new optimizer hint to request cost-based optimization of XQuery expressions.
The following Oracle XML DB constructs are deprecated in Oracle Database 11g Release 2 (11.2.0.1). They are still supported in 11.2.0.1 for backward compatibility, but Oracle recommends that you do not use them in new applications.
Oracle SQL function extract
– Use SQL/XML function XMLQuery
instead. See "XMLQUERY SQL/XML Function in Oracle XML DB".
Oracle SQL function extractValue
– Use SQL/XML function XMLTable
or SQL/XML functions XMLCast
and XMLQuery
instead.
See "SQL/XML Functions XMLQUERY and XMLTABLE" for information about using function XMLTable
See "XMLCAST SQL/XML Function" for information about using functions XMLCast
and XMLQuery
Oracle SQL function existsNode
– Use SQL/XML function XMLExists
instead. See "XMLEXISTS SQL/XML Function".
Oracle SQL function XMLSequence
– Use SQL/XML function XMLTable
instead. See "XMLTABLE SQL/XML Function in Oracle XML DB".
Oracle XPath function ora:instanceof
– Use XQuery operator instance of
instead.
Oracle XPath function ora:instanceof-only
– Use XML Schema attribute xsi:type
instead.
PL/SQL XMLType
methods getStringVal()
, getCLOBVal()
, and getBLOBVal()
, – Use SQL/XML function XMLSerialize
instead. See "XMLSERIALIZE SQL/XML Function".
PL/SQL XMLType
method getNamespace()
– Use XQuery function fn:namespace-uri
instead.
PL/SQL XMLType
method getRootElement()
– Use XQuery function fn:local-name
instead.
Function-based indexes on XMLType
– Use XMLIndex
with a structured component instead. See "Function-Based Indexes".
Binary XML is a new storage model for abstract data type XMLType
, joining the existing storage models of structured (object-relational) and unstructured (CLOB
) storage. Binary XML is XML-Schema aware, but it can also be used with XML data that is not based on an XML schema. See "XMLType Storage Models".
See Also:
Oracle Database Advanced Application Developer's Guide for an overview of XMLType
data stored as binary XML
Oracle Database SQL Language Reference for information about creating XMLType
tables and columns stored as binary XML
Oracle Database XML Java API Reference for information about manipulating binary XML data using Java
Oracle Database XML C API Reference for information about manipulating binary XML data using C
A new index type is provided for XMLType
: XMLIndex
. This can greatly improve the performance of XPath-based predicates and fragment extraction for XMLType
data, whether based on an XML schema or not. The new index type is a (logical) domain index that consists of underlying physical tables and secondary indexes. See Chapter 6, "Indexing XMLType Data".
Note:
TheCTXSYS.CTXXPath
index is deprecated in Oracle Database 11g Release 1 (11.1). The functionality that was provided by CTXXPath
is now provided by XMLIndex
.
Oracle recommends that you replace CTXXPath
indexes with XMLIndex
indexes. The intention is that CTXXPath
will no longer be supported in a future release of the database.
See Also:
Oracle Database Reference for information about new view XIDX_USER_PENDING
Oracle Database PL/SQL Packages and Types Reference for information about new PL/SQL package DBMS_XMLINDEX
XMLType OCTs Now Use Heap Storage Instead of IOTs
You can store collections of XML elements as ordered collection tables (OCTs). OCTs now use heap storage, by default. In prior releases, OCTs were index-organized tables (IOTs), by default. A new XML schema registration option, REGISTER_NT_AS_IOT
, forces the use of IOTs.
Default Value of XML Schema Annotation storeVarrayAsTable Is Now true
In prior releases, the default value of XML schema annotation storeVarrayAsTable
was false
; the default value is now true
. This means that by default an XML collection is stored as a set of rows in an ordered collection table (OCT). Each row corresponds to an element in the collection. With annotation storeVarrayAsTable = "false"
, the entire collection is instead serialized as a varray and stored in a LOB column.
Using storeVarrayAsTable = "true"
facilitates the efficient use of collections: queries, updates, and creation of B-tree indexes.
See Also:
"Controlling How Collections Are Stored for Object-Relational XMLType Storage" for more information about storing XML collections object-relationallyApplications can now register listeners with handlers for events associated with Oracle XML DB Repository operations such as creating, deleting, and updating a resource. See Chapter 30, "Oracle XML DB Repository Events".
See Also:
Oracle Database XML Java API Reference for new Java methods
Oracle Database PL/SQL Packages and Types Reference for information about new PL/SQL package DBMS_XEVENT
Oracle Database PL/SQL Packages and Types Reference for information about new PL/SQL package DBMS_RESCONFIG
Oracle Database PL/SQL Packages and Types Reference for information about new PL/SQL package DBMS_XDBRESOURCE
Support for Content Repository API for Java (JCR: JSR-170)
Oracle XML DB now supports Content Repository API for Java (JCR) and the JSR-170 standard. You can access Oracle XML DB Repository using the JCR APIs. See Chapter 31, "Using Oracle XML DB Content Connector".
See Also:
Oracle Database XML Java API Reference for new Java methodsNew Repository Resource Link Types
You can now create weak folder links to represent Oracle XML DB Repository folder-child relationships. Hard links are still available, as well. See "Link Types".
See Also:
Oracle Database PL/SQL Packages and Types Reference for updates to PL/SQL package DBMS_XDB
Oracle Database SQL Language Reference for updates to function under_path
Support for WebDAV Privileges and New Oracle XML DB Privileges
All WebDAV privileges are now supported by Oracle XML DB Repository. In addition, there are some new Oracle XML DB-specific atomic privileges. See Chapter 27, "Repository Access Control".
See Also:
Oracle Database PL/SQL Packages and Types Reference for information about new PL/SQL package DBMS_NETWORK_ACL_ADMIN
Oracle Database PL/SQL Packages and Types Reference for information about PL/SQL package UTL_TCP
Oracle Database PL/SQL Packages and Types Reference for information about PL/SQL package UTL_INADDR
You can now access Oracle Database through Web services. You can write and deploy Web services that can query the database using SQL or XQuery, or access stored PL/SQL functions and procedures. See Chapter 33, "Using Native Oracle XML DB Web Services"
In many cases, you can now evolve XML schemas without copying the corresponding XML instance documents. See Chapter 10, "XML Schema Evolution".
See Also:
Oracle Database PL/SQL Packages and Types Reference for updates to PL/SQL packageDBMS_XMLSCHEMA
Support for Recursive XML Schemas
Oracle XML DB now performs XPath rewrite on some queries that use '//
' in XPath expressions to target nodes at multiple or arbitrary depths, even when the XML data conforms to a recursive XML schema. See "Support for Recursive Schemas"
See Also:
Oracle Database PL/SQL Packages and Types Reference for updates to PL/SQL packageDBMS_XMLSCHEMA
Support for XLink and XInclude
Oracle XML DB now supports the XLink and XInclude standards. See Chapter 23, "Using XLink and XInclude with Oracle XML DB".
You can now associate natural-language translation information with XML schemas and corresponding instance documents. This includes support for standard attributes xml:lang
and xml:srclang
. See "XML Translations".
See Also:
Oracle Database PL/SQL Packages and Types Reference for information about new PL/SQL packageDBMS_XMLTRANSLATIONS
The previous 64K limit on text nodes and attribute values has been lifted. Text nodes and attribute values are no longer limited in size to 64K bytes each. New streaming push and pull APIs are available in PL/SQL, Java, and C to provide virtually unlimited node sizes. See "Large Node Handling using DBMS_XMLDOM" for information about handling large nodes in PL/SQL and "Handling Large Nodes using Java".
See Also:
Oracle Database SQL Language Reference for information about creating XMLType
tables and columns stored as binary XML
Oracle Database XML Java API Reference for information about new Java methods
Oracle Database PL/SQL Packages and Types Reference for information about new PL/SQL package DBMS_SDA
and updates to PL/SQL package DBMS_XMLDOM
The Java XML APIs in Oracle XML DB and Oracle XML Developer's Kit have been unified.
See Also:
Oracle Database XML Java API Reference, package oracle.xml.parser.v2
Oracle Data Pump Support for XMLType
Oracle Data Pump is now the recommended way to import and export XMLType
data. See Chapter 36, "Exporting and Importing XMLType Tables".
Support for XMLType by Oracle Streams and Logical Standby
Oracle Streams and logical standby now support XMLType
stored as CLOB
. Both XML schema-based and non-schema-based XML data are supported.
See Also:
Oracle Database Reference for information on views DBA_STREAMS_UNSUPPORTED
and DBA_STREAMS_COLUMNS
Oracle XML Developer's Kit Pull-Parser API (XML Events, JSR-173)
You can use the new Oracle XML Developer Kit (XDK) pull-parser API with Oracle XML DB. See "Using the Oracle XML Developer's Kit Pull Parser with Oracle XML DB".
See Also:
Oracle Database XML C API Reference for information about new C methods and types
Oracle XML DB support for the XQuery language has been updated to reflect the latest version of the XQuery standard, W3C XQuery 1.0 Recommendation.
See Also:
http://www.w3.org
for information about the XQuery language
Fine-Grained Access to Network Services Using PL/SQL
New atomic privileges are provided for access control entries (ACEs). These privileges are used for fine-grained PL/SQL access to network services.
SQL/XML Standard Compliance and Performance Enhancements
Oracle XML DB support for the SQL/XML standard has been updated to reflect the latest version of the standard. This includes support for standard SQL functions XMLExists
and XMLCast
. See "Querying XMLType Data using SQL/XML Functions XMLExists and XMLCast" and "Generating XML using SQL Functions".
See Also:
Oracle Database SQL Language Reference for information about SQL/XML functionsXMLExists
, XMLCast
, XMLQuery
, XMLTable
, and XMLForest
.XML-Update Performance Enhancements
The performance of SQL functions used to update XML data has been enhanced for XML schema-based data that is stored object-relationally. This includes XPath rewrite for SQL functions updateXML
, insertChildXML
, and deleteXML
.
XQuery and SQL/XML Performance Enhancements
XQuery and SQL/XML performance enhancements include treatment of the following:
User-defined XQuery functions
XQuery prolog variables
XQuery count
function applied to the result of using a SQL/XML generation function
Positional expressions in XPath predicates
XQuery computed constructors
SQL/XML function XMLAgg
The performance of XSLT transformations using SQL function XMLTransform
and XMLType
method transform()
has been enhanced.