For the purposes of the DBMS_METADATA
API, every entity in the database is modeled as an object that belongs to an object type. For example, the table scott.emp
is an object and its object type is TABLE
. When you fetch an object's metadata you must specify the object type.
To fetch a particular object or set of objects within an object type, you specify a filter. Different filters are defined for each object type. For example, two of the filters defined for the TABLE
object type are SCHEMA
and NAME
. They allow you to say, for example, that you want the table whose schema is scott
and whose name is emp
.
The DBMS_METADATA
API makes use of XML (Extensible Markup Language) and XSLT (Extensible Stylesheet Language Transformation). The DBMS_METADATA
API represents object metadata as XML because it is a universal format that can be easily parsed and transformed. The DBMS_METADATA
API uses XSLT to transform XML documents into either other XML documents or into SQL DDL.
You can use the DBMS_METADATA
API to specify one or more transforms (XSLT scripts) to be applied to the XML when the metadata is fetched (or when it is resubmitted). The API provides some predefined transforms, including one named DDL that transforms the XML document into SQL creation DDL.
You can then specify conditions on the transform by using transform parameters. You can also specify optional parse items to access specific attributes of an object's metadata. For more details about all of these options and examples of their implementation, see the following sections: