Some preliminary design criteria are presented for consideration when planning your Oracle XML DB solution.
Oracle XML DB is installed automatically if Database Configuration Assistant (DBCA) is used to build Oracle Database using the general-purpose template.
You can determine whether or not Oracle XML DB is already installed. If it is installed, then the following are true:
Oracle XML DB is suited for any application where some or all of the data processed is represented using XML.
Oracle XML DB provides for high-performance database ingestion, storage, processing and retrieval of XML data. It also lets you quickly and easily generate XML from existing relational data. Applications for which Oracle XML DB is particularly suited include the following:
Business-to-business (B2B) and application-to-application (A2A) integration
A typical Oracle XML DB application has at least one of the following characteristics:
Large numbers of XML documents must be ingested or generated
Large XML documents must be processed or generated
High-performance searching is needed, both within a document and across large collections of documents
High levels of security are needed
Fine-grained security is needed
Data processing must use XML documents, and data must be stored in relational tables
Programming must support open standards such as SQL, XML, XQuery, XPath, and XSL
Information must be accessed using standard Internet protocols such as FTP, HTTP(S)/WebDAV, and Java Database Connectivity (JDBC)
XML data must be queried from SQL
Analytic capabilities must be applied to XML data
XML documents must be validated against an XML schema
When planning an Oracle XML DB application it can be worthwhile to consider some preliminary design criteria.
These include the following:
The ways that you intend to store your XML data
The structure of your XML data
The languages used to implement your application
The ways you intend to process your XML data
However, in general Oracle recommends that you start with the following Oracle XML DB features. For most use cases they are all that you need to consider.
Storage model – binary XML
Indexing – XML search index,
XMLIndex with structured component
Database language – SQL, with SQL/XML functions
XML languages – XQuery and XSLT
Client APIs – OCI, thin JDBC, SQL .NET
There are several ways to store XML data in Oracle Database.
XMLType tables and views is outlined in Figure 2-1.
Figure 2-1 Oracle XML DB Storage Options for XML Data
If you have existing relational data, you can access it as XML data by creating
XMLType views over it. You can use the following to define the
Object types: object tables, object constructors, and object views.
Regardless of which storage options you choose for your application, Oracle XML DB provides the same functionality. Though the storage model you use can affect your application performance and XML data fidelity, it is totally independent of how frequently you query or update your data and what APIs your application uses.
How structured your XML data is, and whether it is based on an XML schema, can influence how you store it.
If your XML data is not XML Schema-based, then, regardless of how structured it is, you can store it in an
XMLType table or view as binary XML, or you can store it as a file in an Oracle XML DB Repository folder. You cannot store it object-relationally.
If your XML data is XML Schema-based then you must store it as binary XML or object-relationally.
Oracle XML DB offers a full range of XML processing options.
The following are available and should be considered when designing your Oracle XML DB application:
XML Generation and
XMLType views. Whether you need to generate (or regenerate) XML data. See Generation of XML Data from Relational Data.
Whether your application is data-centric or document-centric, or both. See Overview of How To Use Oracle XML DB.
DOM fidelity, document fidelity.
XMLType storage, whether object-relational or binary XML, preserves DOM fidelity. That is, A DOM created from an XML document stored as
XMLType is identical to a DOM created from the original document. However, there could be differences in insignificant whitespace. See DOM Fidelity, SYS_XDBPD$ and DOM Fidelity for Object-Relational Storage, and PL/SQL APIs for XMLType.
If you need to preserve document fidelity (insignificant whitespace) in addition to DOM fidelity, then store two copies of your original document: one as an
XMLType instance for database use and XML processing, the other as a
CLOB instance to provide document fidelity.
XPath searching. You can use XPath syntax embedded in a SQL statement to query XML content in the database. See Query and Update of XML Data, Access to Oracle XML DB Repository Data, andRepository Access Using RESOURCE_VIEW and PATH_VIEW.
How often XML documents are accessed, updated, and manipulated. See Query and Update of XML Data.
Whether you need to update fragments or whole documents. You can use XPath expressions to specify individual elements and attributes of your document during updates, without rewriting the entire document. This is more efficient, especially for large XML documents. See Updating XML Data.
Which kinds of indexing best suit your application and data. See Indexes for XMLType Data.
XSLT. Whether you need to transform the XML data to HTML, WML, or other languages, and, if so, how your application does this. While storing XML documents in Oracle XML DB, you can optionally ensure that their structure complies with (validates against) specific XML schemas. See Transformation and Validation of XMLType Data.
Design considerations for applications that use Oracle XML DB Repository include access method, security needs, and whether you need versioning.
There are two main repository access methods:
Navigation-based access or path-based access. This is suitable for both content/document and data oriented applications. Oracle XML DB provides the following languages and access APIs:
SQL access through resource and path views. See Repository Access Using RESOURCE_VIEW and PATH_VIEW.
PL/SQL access using package
DBMS_XDB or packages
DBMS_XDB_REPOS. See PL/SQL Access to Oracle XML DB Repository.
Protocol-based access using HTTP(S)/WebDAV or FTP, most suited to content-oriented applications. See Repository Access Using Protocols.
Query-based access. This can be most suited to data oriented applications. Oracle XML DB provides access using SQL queries through the following APIs:
These options for accessing repository data are also discussed in Access to Oracle XML DB Repository Data.
You can also consider the following access criteria:
Oracle XML DB is an integrated part of Oracle Database, and works well with other database options and features.
Oracle Exadata Storage Server Software – high-performance, scalable, and highly available use of XML data. See Oracle Exadata Storage Server Software User's Guide.
Oracle Real Application Clusters (Oracle RAC) – Use XML data with clusters of database instances. See Oracle Real Application Clusters Administration and Deployment Guide
Oracle Multitenant option – Use XML data with a multitenant architecture, where each pluggable database has its own Oracle XML DB Repository. See Oracle Database Concepts
Compression and Encryption – You can compress or encrypt binary XML data that uses SecureFiles LOB storage. For XML data stored object-relationally, you can compress or encrypt XML elements and attributes individually.
Parallel Execution – Execution of the following operations can be carried out in parallel:
A query of
XMLType data stored as binary XML using SecureFiles LOBs
A direct load for an
XMLType table on which an Oracle Text
CONTEXT index is defined