This chapter provides some preliminary design criteria for consideration when planning your Oracle XML DB solution.
This chapter contains these topics:
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:
Database schema (user account) XDB
exists. To check that, run this query:
SELECT * FROM ALL_USERS;
View RESOURCE_VIEW
exists. To check that, use this command:
DESCRIBE RESOURCE_VIEW
See Also:
Chapter 35, "Administration of Oracle XML DB" for information about installing Oracle XML DB manually
Oracle Database 2 Day + Security Guide for information about database schema XDB
Oracle XML DB is suited for any application where some or all of the data processed by the application 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
Internet
Content-management
Messaging
Web Services
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
This section describes some preliminary design criteria that you can consider when planning your Oracle XML DB application. However, 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 various ways to store XML data in Oracle Database. Storage of 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 XMLType
views:
SQL/XML functions. See Chapter 8, "Generation of XML Data from Relational Data" and Chapter 4, "XQuery and Oracle XML DB".
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.
See Also:
"XMLType Storage Models"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.
You can program your Oracle XML DB applications in the following languages:
Java (JDBC, Java Servlets)
PL/SQL
The following processing options 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 Chapter 8, "Generation of XML Data from Relational Data".
Whether your application is data-centric or document-centric, or both. See Chapter 3, "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 Chapter 11, "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 Chapter 5, "Query and Update of XML Data", Chapter 21, "Accessing Oracle XML DB Repository Data", Chapter 24, "Repository Access Using RESOURCE_VIEW and PATH_VIEW", and Appendix E, "Full-Text Search over XML Data Without XQuery".
How often XML documents are accessed, updated, and manipulated. See Chapter 5, "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 Chapter 6, "Indexes for XMLType Data" and Appendix E, "Full-Text Search over XML Data Without XQuery".
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 Chapter 7, "Transformation and Validation of XMLType Data".
This section pertains to data that is stored as resources in Oracle XML DB Repository.
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 Chapter 24, "Repository Access Using RESOURCE_VIEW and PATH_VIEW".
PL/SQL access using package DBMS_XDB
or packages DBMS_XDB_ADMIN
, DBMS_XDB_CONFIG
and DBMS_XDB_REPOS
. See Chapter 26, "PL/SQL Access to Oracle XML DB Repository".
Protocol-based access using HTTP(S)/WebDAV or FTP, most suited to content-oriented applications. See Chapter 28, "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:
Java access (through JDBC). See Java DOM API for XMLType.
PL/SQL access. See Chapter 11, "PL/SQL APIs for XMLType".
These options for accessing repository data are also discussed in Chapter 21, "Accessing Oracle XML DB Repository Data".
You can also consider the following access criteria:
What levels of security you need. See Chapter 27, "Repository Access Control".
Whether you need to version the data. See Chapter 25, "Resource Versions".
Oracle XML DB is an integrated part of Oracle Database, and works well with other database options and features, including the following.
Oracle Streams Advanced Queuing (AQ) – merge XML payloads. See Chapter 38, "XML Data Exchange Using Oracle Streams AQ" and Oracle Database Advanced Queuing User's Guide
Oracle GoldenGate and Oracle Active Data Guard – replicate and safeguard XML data, or perform a rolling upgrade. See Oracle GoldenGate and Oracle Data Guard Concepts and Administration
Oracle Exadata Storage Server Software – high-performance, scalable, and highly available use of XML data. See Oracle Database High Availability Overview
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
DML for 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
See Also:
Oracle Database Concepts