Decomposing XML documents with annotated XML schemas into nicknames

With annotated XML schema decomposition, you can decompose documents that are based on annotations specified in an XML schema.

About this task

The annotated schema documents must be stored in and registered with the XML schema repository (XSR).

In cases where you need to access XML data as relational data, rather than in its hierarchical form, you can decompose, or shred, the XML data. You can decompose an XML document into a nickname that references a remote table.


  1. Annotate the schema documents with XML schema decomposition.
  2. Create the nickname that you want to use for decomposition. The name of the nickname must match the values in the annotated schema.
  3. Register the schema using the REGISTER XMLSCHEMA command.
  4. Grant USAGE privileges on the XSR object to allow specific users to use a specific XML schema.
  5. Enable the schema for decomposition using the ALTER XSROBJECT statement.
  6. Use the DECOMPOSE XML DOCUMENT command to decompose the XML instance document.