Databases Reference
In-Depth Information
4.1
Commercial DBMS Systems
All three of the leading commercial database systems at the time of publication -
Oracle, Microsoft SQL Server, and IBM DB2 - provide support for storage of XML
data validated against an XML schema. Both of the major open-source relational
database offerings - PostgreSql and MySql - have support for storing XML, but do
not yet support schema validation in their standard configurations. We now briefly
describe how each of the three major vendors supports XML schemas in general
as well as how each vendor handles changes to those schemas. Furthermore, we
discuss evolution support in the native XML database system Tamino.
Oracle offers two very different ways to evolve an XML schema ( Oracle XML
Schema Evolution 2008 ). The first is a copy-based mechanism that allows a great
deal of flexibility. Data from an XML document collection are copied to a temporary
location, then transformed according to a specification, and finally replaced in its
original location. The second is an in-place evolution that does not require any data
copying but only supports a limited set of possible schema changes.
Oracle has supported XML in tables and columns since version 9i (9.0.1) as
part of XML DB, which comes packaged with Oracle since version 9.2. One can
specify a column to have type XMLType, in which case each row of the table will
have a field that is an XML document, or one can specify a table itself to have
type XMLType, where each row is itself an XML document. In both cases, one can
specifyasingleschemafortheentirecollection of documents. For instance, one can
specify an XML column to have a specified given schema as follows:
CREATE TABLE table with xml column
(id NUMBER, xml document XMLType)
XMLTYPE COLUMN xml document
ELEMENT "http://tempuri.com/temp.xsd#Global1";
Note that when specifying a schema for an XML column or document, one must
also specify a single global element that must serve as the document root for each
document instance. In the example above, schema temp.xsd has a global element
Global1 against which all document roots must validate.
The copy-based version of schema evolution is performed using the DBMS
XMLSCHEMA.copyEvolve stored procedure. The procedure takes as input three
arrays: a list of schema URLs representing the schemas to evolve, a list of XML
schema documents describing the new state of each schema in the first list, and a
list of transformations expressed in XSLT. Each transformation corresponds to a
schema based on its position in the list; so, the first transformation on the list is
used to translate all instances of the first schema to conform to the first new schema
definition, and so on.
There are a few restrictions on the usage of copyEvolve . For instance, the
list of input schemas must include all dependent schemas of anything in the list,
even if those schemas have not changed. There are also some additional steps
that must be performed whenever global element names change. However, from an
expressiveness perspective, one can use the procedure to migrate any schema to any
 
Search WWH ::




Custom Search