| Oracle® Database PL/SQL Packages and Types Reference 11g Release 2 (11.2) E25788-04 | 
 | 
| 
 | PDF · Mobi · ePub | 
The DBMS_XDB package supports the following features:
Resource Management subprograms which complement Resource Views
The Access Control List (ACL)-based Security Mechanism
Configuration Session Management
Creation of the XDB username
This chapter contains the following topics:
Overview
Deprecated Subprograms
Security Model
Constants
This section contains topics which relate to using the DBMS_XDB package.
The DBMS_XDB package supports the following features:
The Resource Management functionality providesLINK Procedures, EXISTSRESOURCE Function, LOCKRESOURCE Function, GETLOCKTOKEN Procedure, UNLOCKRESOURCE Function, CREATERESOURCE Functions, RENAMERESOURCE Procedure, DELETERESOURCE Procedure, GETRESOID Function, CREATEOIDPATH Function, REBUILDHIERARCHICALINDEX Procedure and CREATEFOLDER Function subprograms which complement Resource Views.
The Access Control List (ACL)-based Security Mechanism can be used with in-hierarchy ACLs stored by the database or in-memory ACLs that may be stored outside the database. Some of these methods can be used for both Oracle resources and arbitrary database objects. Use CHECKPRIVILEGES Function, GETACLDOCUMENT Function, CHANGEPRIVILEGES Function and GETCHILDRESPATHS Function for Oracle Resources. ACLCHECKPRIVILEGES Function provides access to Oracle's ACL-based Security mechanism without storing objects in the Hierarchy.
Configuration Session Management is supported by CFG_REFRESH Procedure, CFG_GET Function and CFG_UPDATE Procedure. methods.
The XDB username is created during XDB installation. This user owns a set of default tables and packages. GETXDB_TABLESPACE Function and MOVEXDB_TABLESPACE Procedure enable movement of schemas to a specified tablespace, and support the default SYSAUX tablespace introduction
Note:
Oracle recommends that you do not use deprecated procedures in new applications. Support for deprecated features is for backward compatibility only and may be terminated in future releases.The following subprograms are deprecated with Oracle Database 11g:
This functionality is replaced by the subprograms of the same name in the DBMS_XDB_ADMINpackage:
Owned by XDB, the DBMS_XDB package must be created by SYS or XDB. The EXECUTE privilege is granted to PUBLIC . Subprograms in this package are executed using the privileges of the current user. Subprograms that operate on the XDB Configuration will succeed only if the current user is SYS or XDB, or the current user has the XDBADMIN or DBA role.
Table 163-1 Defined Constants for DBMS_XDB
| Constant | Type | Value | Description | 
|---|---|---|---|
| 
 | 
 | 1 | Deletes a resource; fails if the resource has children. | 
| 
 | 
 | 2 | Deletes a resource and its children, if any. | 
| 
 | 
 | 3 | Deletes the resource, even if the object it contains is invalid. | 
| 
 | 
 | 4 | Deletes a resource and its children, if any, even if the object it contains is invalid. | 
Table 163-2 DBMS_XDB Package Subprograms
| Subprogram | Description | 
|---|---|
| Checks access privileges granted to the current user by specified ACL document on a resource whose owner is specified by the 'owner' parameter. | |
| Adds to  | |
| Adds a mime mapping to the XDB configuration | |
| Adds a schema location mapping to the XDB configuration | |
| Adds a servlet to XDB configuration | |
| Adds a servlet mapping to XDB configuration | |
| Adds a security role  | |
| Adds adds an XML extension to the XDB configuration | |
| Appends a childpath to a parentpath | |
| Takes in user-defined metadata either as a  | |
| Retrieves the session's configuration information | |
| Refreshes the session's configuration information to the latest configuration | |
| Updates the configuration information | |
| Changes the owner of the resource/s to the specified owner. | |
| Adds a specified ACE to a specified resource's ACL | |
| Checks access privileges granted to the current user on the specified resource | |
| Creates a new folder resource in the hierarchy | |
| Creates a virtual path to the resource based on object ID | |
| Creates a new resource | |
| Deletes from  | |
| Deletes the mime mapping from the XDB configuration | |
| Deletes a resource from the hierarchy | |
| Deletes metadata from a resource (can be used for schema-based or nonschema-based metadata) | |
| Deletes the schema location mapping for the specified schema URL from the XDB configuration. | |
| Deletes a servlet from XDB configuration | |
| Deletes the servlet mapping for the specified servlet name from the XDB configuration | |
| Deletes the specified role from a servlet in the XDB configuration | |
| Deletes the specified XML extension from the XDB configuration | |
| Determines if a resource is the hierarchy, based on its absolute path | |
| Retrieves ACL document that protects resource given its path name | |
| Returns a cursor over the absolute paths of all the child resources | |
| Retrieves the contents of a resource returned as a BLOB | |
| Retrieves the contents of a resource returned as a CLOB | |
| Retrieves the contents of a resource returned as a string | |
| Retrieves the contents of a resource returned as a a  | |
| Retrieves the contents of a resource returned as an  | |
| Gets the value of the current FTP port | |
| Gets the value of the current HTTP port | |
| Returns that resource's lock token for the current user given a path to a resource | |
| Retrieves the parameters of a listener end point corresponding to the XML DB HTTP server | |
| Returns the object ID of the resource from its absolute path | |
| Returns the current tablespace of the XDB (user) | |
| Returns  | |
| Returns  | |
| Returns  | |
| Returns  | |
| Returns  | |
| Creates a link to an existing resource | |
| Gets a WebDAV-style lock on that resource given a path to that resource | |
| [Deprecated] Moves the XDB (user) to the specified tablespace | |
| Processes document links in the specified resource | |
| Deletes all user metadata from a resource | |
| [Deprecated] Rebuilds the hierarchical index after import or export operations | |
| Renames the XDB resource | |
| Sets the ACL on a specified resource | |
| Replaces the contents of a specified resource with specified datatype | |
| Sets the FTP port to a new value | |
| Sets the HTTP port to a new value | |
| Sets the parameters of a listener end point corresponding to the XML DB HTTP server | |
| Restricts all listener end points of the XML DB HTTP server to listen either only on the localhost interface or on both localhost and non-localhost interfaces | |
| Splits the path into a parentpath and childpath | |
| Changes the modification time of the resource to the current time | |
| Updates metadata for a resource | |
| Unlocks the resource given a lock token and resource path | 
This function checks access privileges granted to the current user by specified ACL document by the OWNER of the resource. Returns positive integer if all privileges are granted.
DBMS_XDB.ACLCHECKPRIVILEGES( acl_path IN VARCHAR2, owner IN VARCHAR2, privs IN xmltype) RETURN PLS_INTEGER;
Table 163-3 ACLCHECKPRIVILEGES Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path in the Hierarchy for ACL document | 
| 
 | Resource owner name; the pseudo user "DAV:owner" is replaced by this user during ACL privilege resolution | 
| 
 | An  | 
This procedure adds to xdb$config a mapping of the URL pattern to an expiration date. This will control the Expire headers for URLs matching the pattern.
DBMS_XDB.ADDHTTPEXPIREMAPPING (
     pattern    IN    VARCHAR2,
     expire     IN    VARCHAR2);
Table 163-4 ADDHTTPEXPIREMAPPING Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | URL pattern (only * accepted as wildcards) | 
| 
 | Expiration directive, follows the  base [plus] (num type)* -- base: now | modification -- type: year|years|month|months|week|weeks|day|days| minute|minutess|second|seconds | 
DBMS_XDB.ADDHTTPEXPIREMAPPING ('/public/test1/*', 'now plus 4 weeks');
DBMS_XDB.ADDHTTPEXPIREMAPPING (
             '/public/test2/*', 'modification plus 1 day 30 seconds');
This procedure adds the following mime mapping to XDB configuration:
<mime-mapping> <extension>extension</extension> <mime-type>mimetype</mime-type> </mime-mapping>
DBMS_XDB.ADDMIMEMAPPING(
     extension    IN   VARCHAR2,
     mimetype     IN   VARCHAR2);
Table 163-5 ADDMIMEMAPPING Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Extension for which a mime type is being added | 
| 
 | Mime type | 
This procedure adds the following schema location mapping to the XDB configuration:
<schemaLocation-mapping>
     <namespace>namespace</namespace>
     <element>element</element>
      <schemaURL>schemaURL</schemaURL>
</schemaLocation-mapping>
DBMS_XDB.ADDSCHEMALOCMAPPING(
     namespace    IN   VARCHAR2,
     element      IN   VARCHAR2,
     schemaURL    IN   VARCHAR2);
Table 163-6 ADDSCHEMALOCMAPPING Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Namespace | 
| 
 | Element | 
| 
 | Schema URL | 
This procedure adds the following servlet to XDB configuration:
<servlet>
     <servlet-name>name</servlet-name>     <servlet-language>language</servlet-language>
     <display-name>dispname</display-name>
     <description>descript</description>
     <servlet-class>class</servlet-class>
     <servlet-schema>schema</servlet-schema>
</servlet>
DBMS_XDB.ADDSERVLET(
     name       IN   VARCHAR2,
    language    IN   VARCHAR2,
    dispname    IN   VARCHAR2,
    icon        IN   VARCHAR2 := NULL,
    descript    IN   VARCHAR2 := NULL,
    class       IN   VARCHAR2 := NULL,
    jspfile     IN   VARCHAR2 := NULL,
    plsql       IN   VARCHAR2 := NULL);
Table 163-7 ADDSERVLET Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Servlet name | 
| 
 | Must be one of "C", "Java", "PL/SQL" | 
| 
 | Display name | 
| 
 | Icon | 
| 
 | Description | 
| 
 | The  | 
| 
 | The  | 
| 
 | The  | 
| 
 | Schema | 
This procedure adds the following servlet mapping to XDB configuration:
<servlet-mapping> <servlet-pattern>pattern</servlet-pattern> <servlet-name>name</servlet-name></servlet-mapping>
DBMS_XDB.ADDSERVLETMAPPING(
     pattern   IN   VARCHAR2,     name      IN   VARCHAR2);
Table 163-8 ADDSERVLETMAPPING Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Sservlet pattern | 
| 
 | Servlet name | 
This procedure adds the following security role REF to a specified servlet in XDB configuration:
<security-role-ref>
     <role-name>rolename</role-name>
     <role-link>rolelink</role-link>
     <description>descript</description>
</security-role-ref>
DBMS_XDB.ADDSERVLETSECROLE(
     servname    IN   VARCHAR2,     rolename    IN   VARCHAR2,     rolelink    IN   VARCHAR2,     descript    IN   VARCHAR2 := NULL);
Table 163-9 ADDSERVLETSECROLE Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Sservlet name | 
| 
 | Role name | 
| 
 | Role link | 
| 
 | Description | 
This procedure adds the following XML extension to the XDB configuration under <xml-extensions>:
<extension>extension</extension>
DBMS_XDB.ADDXMLEXTENSION(
     extension    IN   VARCHAR2);
Table 163-10 ADDXMLEXTENSION Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | XML extension to be added | 
This procedure appends a childpath to a parentpath.
DBMS_XDB.APPENDPATH (
     abspath       OUT   VARCHAR2,     parentpath    IN    VARCHAR2,    childpath      IN    VARCHAR2);
Table 163-11 APPENDPATH Procedure
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
| 
 | Parentpath | 
| 
 | Childpath | 
This procedure takes in user-defined metadata either as a REF to XMLTYPE or an XMLTYPE and adds it to the desired resource.
DBMS_XDB.APPENDRESOURCEMETADATA ( abspath IN VARCHAR2, metadata IN XMLTYPE); DBMS_XDB.APPENDRESOURCEMETADATA ( abspath IN VARCHAR2, metadata IN REF SYS.XMLTYPE);
Table 163-12 APPENDRESOURCEMETADATA Procedure
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
| 
 | Metadata can be schema based or nonschema-based. Schema-based metadata is stored in its own table. | 
In the case in which a REF is passed in, the procedure stores the REF in the resource, and the metadata is stored in a separate table. In this case you are responsible for populating the RESID column for the metadata table. Note that theREF passed in must be unique. In other words, there must not be aREF with the same value in the resource metadata, as this would violate uniqueness of properties. An error is thrown if users attempt to add a REF that already exists.
In the case where the XMLTYPE is passed in, the data is parsed to determine if it is schema-based or not and stored accordingly.
This function retrieves the session's configuration information as an XMLType instance.
DBMS_XDB.CFG_GET RETURN SYS.XMLType;
This procedure refreshes the session's configuration information to the latest configuration.
DBMS_XDB.CFG_REFRESH;
This procedure updates the configuration information and commits the change.
DBMS_XDB.CFG_UPDATE( xdbconfig IN SYS.XMLTYPE);
Table 163-13 CFG_UPDATE Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | The new configuration data | 
This procedure changes the owner of the resource/s to the specified owner.
DBMS_XDB.CHANGEOWNER(
     abspath    IN   VARCHAR2,
     owner      IN   VARCHAR2,
     recurse    IN   BOOLEAN := FALSE);
Table 163-14 CHANGEOWNER Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
| 
 | New owner for the resource | 
| 
 | If  | 
This function adds a specified ACE to a specified resource's ACL.
DBMS_XDB.CHANGEPRIVILEGES( res_path IN VARCHAR2, ace IN xmltype) RETURN PLS_INTEGER;
Table 163-15 CHANGEPRIVILEGES Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Path name of the resource for which privileges need to be changed | 
| 
 | An  | 
A positive integer if the ACL was successfully modified.
If no ACE with the same principal and the same operation (grant/deny) already exists in the ACL, the new ACE is added at the end of the ACL.
This function checks access privileges granted to the current user on the specified resource.
DBMS_XDB.CHECKPRIVILEGES( res_path IN VARCHAR2, privs IN xmltype) RETURN PLS_INTEGER;
Table 163-16 CHECKPRIVILEGES Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path in the Hierarchy for resource | 
| 
 | An  | 
A positive integer if all requested privileges granted.
This function creates a new folder resource in the hierarchy.
DBMS_XDB.CREATEFOLDER( path IN VARCHAR2) RETURN BOOLEAN;
Table 163-17 CREATEFOLDER Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Path name for the new folder | 
TRUE if operation successful; FALSE, otherwise.
The given path name's parent folder must already exist in the hierarchy: if '/folder1/folder2' is passed as the path parameter, then '/folder1' must already exist.
This function creates a virtual path to the resource based on object ID.
DBMS_XDB.CREATEOIDPATH( oid IN RAW) RETURN VARCHAR2;
The functions create a new resource. The description of the overload options precede each version of the syntax
Creates a new resource with a specified string as its contents:
DBMS_XDB.CREATERESOURCE( 
     abspath        IN  VARCHAR2,
     data           IN  VARCHAR2,
     createfolders  IN  BOOLEAN := FALSE)
 RETURN BOOLEAN;
Creates a new resource with a specified XMLType data as its contents:
DBMS_XDB.CREATERESOURCE(
     abspath        IN  VARCHAR2,
     data           IN  SYS.XMLTYPE,
     createfolders  IN  BOOLEAN := FALSE)
 RETURN BOOLEAN;
Given a REF to an existing XMLType row, creates a resource whose contents point to that row. That row should not already exist inside another resource:
DBMS_XDB.CREATERESOURCE(
     abspath        IN  VARCHAR2,
     datarow        IN  REF SYS.XMLTYPE,
     createfolders  IN  BOOLEAN := FALSE)
 RETURN BOOLEAN;
Creates a resource with a specified BLOB as its contents, and specifies character set of the source BLOB:
DBMS_XDB.CREATERESOURCE(
     abspath        IN  VARCHAR2,
     data           IN  BLOB,
     csid           IN  NUMBER :=0,
     createfolders  IN  BOOLEAN := FALSE)
 RETURN BOOLEAN; 
Creates a resource with a specified BFILE as its contents, and specifies character set of the source BFILE:
DBMS_XDB.CREATERESOURCE ( 
     abspath        IN  VARCHAR2,
     data           IN  BFILE,
     csid           IN  NUMBER :=0,
     createfolders  IN  BOOLEAN := FALSE)
 RETURN BOOLEAN;
Creates a resource with a specified CLOB as its contents:
DBMS_XDB.CREATERESOURCE (
     abspath        IN  VARCHAR2,
     data           IN  CLOB,
     createfolders  IN  BOOLEAN := FALSE)
 RETURN BOOLEAN; 
Given a string, inserts a new resource into the hierarchy with the string as the contents:
DBMS_XDB.CREATERESOURCE ( abspath IN VARCHAR2, data IN VARCHAR2, schemaurl IN VARCHAR2 := NULL, elem IN VARCHAR2 := NULL) RETURN BOOLEAN;
Given an XMLTYPE and a schema URL, inserts a new resource into the hierarchy with the XMLTYPE as the contents:
DBMS_XDB.CREATERESOURCE ( abspath IN VARCHAR2, data IN SYS.XMLTYPE, schemaurl IN VARCHAR2 := NULL, elem IN VARCHAR2 := NULL) RETURN BOOLEAN;
Table 163-19 CREATERESOURCE Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource to create. The path name's parent folder must already exist in the hierarchy. In other words, if  | 
| 
 | String buffer containing new resource's contents. The data is parsed to check if it contains a schema-based XML document, and the contents are stored as schema-based in the schema's default table. Otherwise, it is saved as binary data. | 
| 
 | 
 | 
| 
 | Character set id of the document. Must be a valid Oracle ID; otherwise returns an error. If CSID is not specified, or if a zero CSID is specified, then the character set id of the document is determined as follows: 
 | 
| 
 | If  | 
| 
 | For XML data, schema URL data conforms to (default  | 
| 
 | Element name (default  | 
TRUE if operation successful; FALSE, otherwise.
This procedure deletes from xdb$config all mappings of the URL pattern to an expiration date.
DBMS_XDB.DELETEHTTPEXPIREMAPPING(
     pattern  IN   VARCHAR2);
Table 163-20 DELETEHTTPEXPIREMAPPING Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | URL pattern (only * accepted as wildcards) | 
This procedure deletes the mime mapping for a specified extension from the XDB configuration.
DBMS_XDB.DELETEMIMEMAPPING(
     extension    IN   VARCHAR2);
Table 163-21 DELETEMIMEMAPPING Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Extension for which a mime type is to be deleted | 
This procedure deletes a resource from the hierarchy.
DBMS_XDB.DELETERESOURCE( path IN VARCHAR2, delete_option IN PLS_INTEGER);
Table 163-22 DELETERESOURCE Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Path name of the resource to delete | 
| 
 | The option that controls how a a resource is deleted; defined in Table 163-1: 
 | 
This procedure takes in a resource by absolute path and removes either the schema-based metadata identified by the REF, or the metadata identified by the namespace and name combination, which can be either schema-based or non-schema based. It also takes an additional (optional) parameter that specifies how to delete it. This parameter is only relevant for schema-based resource metadata that needs to be deleted. For non-schema based metadata, this parameter is ignored.
Can be used only for schema-based metadata:
DBMS_XDB.DELETERESOURCEMETADATA ( abspath IN VARCHAR2, metadata IN REF SYS.XMLTYPE, delete_option IN pls_integer := dbms_xdb.DELETE_RESOURCE_METADATA_CASCADE);
Can be used for schema-based or nonschema-based metadata:
DBMS_XDB.DELETERESOURCEMETADATA ( abspath IN VARCHAR2, metadatans IN VARCHAR2, metadataname IN VARCHAR2, delete_option IN pls_integer := dbms_xdb.DELETE_RESOURCE_METADATA_CASCADE);
Table 163-23 DELETERESOURCEMETADATA Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
| 
 | 
 | 
| 
 | Namespace of the metadata fragment to be removed | 
| 
 | Local name of the metadata fragment to be removed | 
| 
 | Only applicable for schema-based metadata, this can be one of the following: 
 | 
This procedure deletes the schema location mapping for a specified schema URL from the XDB configuration.
DBMS_XDB.DELETESCHEMALOCMAPPING(
     schemaURL    IN   VARCHAR2);
This procedure deletes a servlet from the XDB configuration.
DBMS_XDB.DELETESERVLET(
     name        IN   VARCHAR2);
This procedure deletes the servlet mapping for a specified servlet name from the XDB configuration.
DBMS_XDB.DELETESERVLETMAPPING(
     name      IN   VARCHAR2);
This procedure deletes the specified role from a servlet in the XDB configuration.
DBMS_XDB.DELETESERVLETSECROLE(
     servname    IN   VARCHAR2,     rolename    IN   VARCHAR2);
Table 163-27 DELETESERVLETSECROLE Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Servlet name | 
| 
 | Name of the role to be deleted | 
This procedure deletes the specified XML extension from the XDB configuration.
DBMS_XDB.DELETEXMLEXTENSION(
     extension    IN   VARCHAR2);
Table 163-28 DELETEXMLEXTENSION Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | XML extension to be deleted | 
This function indicates if a resource is in the hierarchy. Matches resource by a string that represents its absolute path.
DBMS_XDB.EXISTSRESOURCE( abspath IN VARCHAR2) RETURN BOOLEAN;
Table 163-29 EXISTSRESOURCE Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Path name of the resource whose ACL document is required | 
TRUE if the resource is found.
This function retrieves ACL document that protects resource given its path name.
DBMS_XDB.GETACLDOCUMENT( abspath IN VARCHAR2) RETURN sys.xmltype;
Table 163-30 GETACLDOCUMENT Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Path name of the resource whose ACL document is required | 
The XMLType for ACL document.
This function returns a cursor over the absolute paths of all the child resources.
DBMS_XDB.GETCHILDRESPATHS(
     abspath    IN     VARCHAR2);
  RETURN SYS_REFCURSOR;
Table 163-31 GETCHILDRESPATHS Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
A cursor over the absolute paths of all the child resources.
This function retrieves the contents of a resource returned as a BLOB.
DBMS_XDB.GETCONTENTBLOB(
     abspath    IN     VARCHAR2, 
     csid       OUT    PLS_INTEGER,
     locksrc    IN     BOOLEAN := FALSE) 
  RETURN BLOB;
Table 163-32 GETCONTENTBLOB Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
| 
 | If  | 
| locksrc | Contents of the resource as a BLOB | 
The contents of the resource as a BLOB.
This function gets the contents of a resource returned as a CLOB.
DBMS_XDB.GETCONTENTCLOB(
     abspath    IN     VARCHAR2,
  RETURN CLOB;
Table 163-33 GETCONTENTCLOB Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
The contents of the resource as a CLOB.
This function gets the contents of a resource returned as a string.
DBMS_XDB.GETCONTENTVARCHAR2(
     abspath    IN     VARCHAR2,
  RETURN BLOB;
Table 163-34 GETCONTENTVARCHAR2 Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
The contents of the resource as a string.
This function retrieves the contents of a resource returned as a a REF to an XMLTYPE.
DBMS_XDB.GETCONTENTXMLREF(
     abspath    IN     VARCHAR2,
  RETURN SYS.XMLTYPE;
Table 163-35 GETCONTENTXMLREF Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
The contents of the resource as a REF to an XMLTYPE.
This function retrieves the contents of a resource returned as an XMLTYPE.
DBMS_XDB.GETCONTENTXMLTYPE(
     abspath    IN     VARCHAR2,
  RETURN SYS.XMLTYPE;
Table 163-36 GETCONTENTXMLTYPE Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
The contents of the resource as an XMLTYPE.
This procedure gets the value of the current FTP port.
DBMS_XDB.GETFTPPORT RETURN NUMBER;
This procedure gets the value of the current HTTP port.
DBMS_XDB.GETHTTPPORT RETURN NUMBER;
This procedure retrieves the parameters of a listener end point corresponding to the XML DB HTTP server. The parameters of both HTTP and HTTP2 end points can be retrieved by invoking this procedure.
DBMS_XDB.GETLISTENERENDPOINT ( endpoint IN NUMBER, host OUT VARCHAR2, port OUT NUMBER, protocol OUT NUMBER);
Table 163-37 GETLISTENERENDPOINT Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | End point to be retrieved. Its value can be  | 
| 
 | Interface on which the listener end point listens | 
| 
 | Port on which the listener end point listens | 
| 
 | Transport protocol accepted by the listener end point | 
Given a path to a resource, this procedure returns that resource's lock token for the current user.
DBMS_XDB.GETLOCKTOKEN( path IN VARCHAR2, locktoken OUT VARCHAR2);
Table 163-38 GETLOCKTOKEN Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Path name to the resource | 
| 
 | Logged-in user's lock token for the resource | 
The user must have READPROPERTIES privilege on the resource.
This function gets all privileges granted to the current user on a specified resource.
DBMS_XDB.GETPRIVILEGES( res_path IN VARCHAR2) RETURN sys.xmltype;
Table 163-39 GETPRIVILEGES Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path in the hierarchy of the resource | 
An XMLType instance of <privilege> element, which contains the list of all leaf privileges granted on this resource to the current user.
Returns the object ID of the resource from its absolute path.
DBMS_XDB.GETRESOID( abspath IN VARCHAR2) RETURN RAW;
Table 163-40 GETRESOID Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
NULL if the resource is not present.
This function returns the current tablespace of the XDB (user).
DBMS_XDB.GETXDB_TABLESPACE RETURN VARCHAR2;
This function returns TRUE if the resource has BLOB content.
DBMS_XDB.DBMS_XDB.HASBLOBCONTENT 
     abspath    IN     VARCHAR2)
 RETURN BOOLEAN;
Table 163-41 HASBLOBCONTENT Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
TRUE if the resource has BOB content.
This function returns TRUE if the resource has character content.
DBMS_XDB.DBMS_XDB.HASCHARCONTENT 
     abspath    IN     VARCHAR2)
 RETURN BOOLEAN;
Table 163-42 HASCHARCONTENT Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
TRUE if the resource has character content.
This function returns TRUE if the resource has XML content.
DBMS_XDB.DBMS_XDB.HASXMLCONTENT 
     abspath    IN     VARCHAR2)
 RETURN BOOLEAN;
Table 163-43 HASXMLCONTENT Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
TRUE if the resource has XML content.
This function returns TRUE if the resource has a REF to XML content.
DBMS_XDB.DBMS_XDB.HASXMLREFERENCE 
     abspath    IN     VARCHAR2)
 RETURN BOOLEAN;
Table 163-44 HASXMLREFERENCE Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
TRUE resource has a REF to XML content.
This function returns TRUE if the resource is a folder or container.
DBMS_XDB.DBMS_XDB.ISFOLDER 
     abspath    IN     VARCHAR2)
 RETURN BOOLEAN;
Table 163-45 DBMS_XDB.ISFOLDER Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
TRUE if the resource is a folder or container.
This procedure creates from a specified folder to a specified resource.
DBMS_XDB.LINK( srcpath IN VARCHAR2, linkfolder IN VARCHAR2, linkname IN VARCHAR2);
DBMS_XDB.LINK( srcpath IN VARCHAR2, linkfolder IN VARCHAR2, linkname IN VARCHAR2, linktype IN PLS_INTEGER := DBMS_XDB.LINK_TYPE_HARD);
Table 163-46 LINK Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Path name of the resource to which a link is created | 
| 
 | Folder in which the new link is placed | 
| 
 | Name of the new link | 
| 
 | Type of link to be created: 
 | 
Given a path to a resource, this function gets a WebDAV-style lock on that resource.
DBMS_XDB.LOCKRESOURCE( path IN VARCHAR2, depthzero IN BOOLEAN, shared IN boolean) RETURN BOOLEAN;
Table 163-47 LOCKRESOURCE Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Path name of the resource to lock. | 
| 
 | Currently not supported | 
| 
 | Passing  | 
TRUE if successful.
The user must have UPDATE privileges on the resource.
Note:
This procedure is deprecated in Release 11g. This functionality is replaced by a subprogram of the same name in the DBMS_XDB_ADMINpackage - the MOVEXDB_TABLESPACE Procedure.This procedure moves the XDB (user) to the specified tablespace.
DBMS_XDB.MOVEXDB_TABLESPACE( new_tablespace IN VARCHAR2);
Table 163-48 MOVEXDB_TABLESPACE Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Name of the tablespace to where the XDB is moved | 
This operation waits for all concurrent XDB sessions to exit.
If MOVEXDB_TABLESPACE fails, the user should restart the database before issuing any further command. Failure to do so willproduce indeterminable results.
This procedure processes document links in the specified resource.
DBMS_XDB.PURGERESOURCEMETADATA( abspath IN VARCHAR2, recurse IN BOOLEAN := FALSE);
Table 163-49 PROCESSLINKS Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource. If the path is a folder, use the  | 
| 
 | Used only if  | 
This procedure deletes all user metadata from a resource. Schema-based metadata is removed in cascade mode, rows being deleted from the corresponding metadata tables.
DBMS_XDB.PURGERESOURCEMETADATA( abspath IN VARCHAR2);
Table 163-50 PURGERESOURCEMETADATA Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
Note:
This procedure is deprecated in Release 11g. This functionality is replaced by a subprogram of the same name in the DBMS_XDB_ADMIN package - the REBUILDHIERARCHICALINDEX Procedure.This procedure rebuilds the hierarchical index after import or export operations. This is necessary because data cannot be exported from index tables.
DBMS_XDB.REBUILDHIERARCHICALINDEX;
This procedure renames the XDB resource.
DBMS_XDB.RENAMERESOURCE( srcpath IN VARCHAR2, destfolder IN CARCHAR2, newname IN VARCHAR2);
Table 163-51 RENAMERESOURCE Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path in the Hierarchy for the source resource destination folder | 
| 
 | Absolute path in the Hierarchy for the destination folder | 
| 
 | Name of the child in the destination folder | 
This procedure sets the ACL on a specified resource to be the ACL specified by path.
DBMS_XDB.SETACL( res_path IN VARCHAR2, acl_path IN VARCHAR2);
Table 163-52 SETACL Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path in the Hierarchy for resource | 
| 
 | Absolute path in the Hierarchy for ACL | 
The user must have <write-acl> privileges on the resource.
This procedure replaces the contents of a resource with a specified datatype.
Replaces the contents of the a resource with a specified CLOB:
DBMS_XDB.SETCONTENT(
     abspath    IN   VARCHAR2,
     data       IN   CLOB);
Replaces the contents of a resource with a specified BLOB:
DBMS_XDB.SETCONTENT(
     abspath    IN   VARCHAR2,
     data       IN   BLOB,
     csid    IN PLS_INTEGER);
Replaces the contents of a resource with a specified XMLTYPE:
DBMS_XDB.SETCONTENT(
     abspath    IN   VARCHAR2,
     data       IN   SYS.XMLTYPE);
Replaces the contents of a resource with a specified string:
DBMS_XDB.SETCONTENT(
     abspath    IN   VARCHAR2,
     data       IN   VARCHAR2);
Replaces the contents of a resource with a specified REF to an XMLTYPE
DBMS_XDB.SETCONTENT(
     abspath    IN   VARCHAR2,
     data       IN   CLOB,
     sticky     IN   BOOLEAN := TRUE);
Replaces the contents of a resource with a specified BFILE:
DBMS_XDB.SETCONTENT(
     abspath    IN   VARCHAR2,
     data       IN   CLOB,
     csid       IN   PLS_INTEGER);
Table 163-53 SETCONTENT Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path in the Hierarchy for resource | 
| 
 | Input varying with overload: 
 | 
| 
 | Character set id of the BLOB or BFILE | 
| 
 | Whether or not the  | 
This procedure sets the FTP port to a new value.
DBMS_XDB.SETFTPPORT( new_port IN NUMBER);
Table 163-54 SETFTPPORT Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Value to which the FTP port is set | 
This procedure sets the HTTP port to a new value.
DBMS_XDB.SETHTTPPORT( new_port IN NUMBER);
Table 163-55 SETHTTPPORT Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Value to which the HTTP port is set | 
This procedure sets the parameters of a listener end point corresponding to the XML DB HTTP server. Both HTTP and HTTP2 end points can be set by invoking this procedure.
DBMS_XDB.SETLISTENERENDPOINT ( endpoint IN NUMBER, host IN VARCHAR2, port IN NUMBER, protocol IN NUMBER);
Table 163-56 SETLISTENERENDPOINT Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | End point to be set. Its value can be  | 
| 
 | Interface on which the listener end point is to listen. Its value can be ' | 
| 
 | Port on which the listener end point is to listen | 
| 
 | Transport protocol that the listener end point is to accept. Its value can be  | 
This procedure restricts all listener end points of the XML DB HTTP server to listen either only on the localhost interface (when l_access is set to TRUE) or to listen on both localhost and non-localhost interfaces (when l_access is set to FALSE).
DBMS_XDB.SETLISTENERLOCALACCESS ( l_access BOOLEAN);
Table 163-57 SETLISTENERLOCALACCESS Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | 
 | 
This procedure splits the path into a parentpath and childpath.
DBMS_XDB.SPLITPATH(
      abspath     IN  VARCHAR2,
      parentpath  OUT VARCHAR2,
     childpath    OUT VARCHAR2);
Table 163-58 SPLITPATH Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path to be split | 
| 
 | Parentpath | 
| 
 | Childpath | 
This procedure changes the modification time of the resource to the current time.
DBMS_XDB.DBMS_XDB.TOUCHRESOURCE 
     abspath    IN     VARCHAR2);
Table 163-59 DBMS_XDB.TOUCHRESOURCE Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
This procedure updates metadata for a resource. The procedure takes in a resource identified by absolute path and the metadata in it to replace identified by its REF. It replaces that piece of metadata with user-defined metadata which is either in the form of a REF to XMLTYPE or an XMLTYPE.
Can be used to update schema-based metadata only. The new metadata must be schema-based:
DBMS_XDB.UPDATERESOURCEMETADATA( abspath IN VARCHAR2, oldmetadata IN REF SYS.XMLTYPE, newmetadata IN REF SYS.XMLTYPE)
Can be used to update schema-based metadata only. The new metadata must be schema-based or nonschema-based:
DBMS_XDB.UPDATERESOURCEMETADATA( abspath IN VARCHAR2, oldmetadata IN REF SYS.XMLTYPE, newmetadata IN XMLTYPE);
Can be used for both schema-based and nonschema-based metadata:
DBMS_XDB.UPDATERESOURCEMETADATA( abspath IN VARCHAR2, oldns IN VARCHAR2, oldname IN VARCHAR, newmetadata IN XMLTYPE);
Can be used for both schema-based or nonschema-based metadata. New metadata must be schema-based:
DBMS_XDB.UPDATERESOURCEMETADATA( abspath IN VARCHAR2, oldns IN VARCHAR2, oldname IN VARCHAR, newmetadata IN REF SYS.XMLTYPE);
Table 163-60 UPDATERESOURCEMETADATA Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 | Absolute path of the resource | 
| 
 | 
 | 
| 
 | 
 | 
| 
 | Namespace identifying old metadata | 
| 
 | Local name identifying old metadata | 
In the case of REF, it stores the REF in the resource and the metadata is stored in a separate table. Uniqueness of REFs is enforced. In the case where the XMLTYPE is passed in, data is parsed to determine if it is schema-based or not and is stored accordingly.
This function unlocks the resource given a lock token and a path to the resource.
DBMS_XDB.UNLOCKRESOURCE( path IN VARCHAR2, deltoken IN VARCHAR2) RETURN BOOLEAN;
Table 163-61 UNLOCKRESOURCE Function Parameters
| Parameter | Description | 
|---|---|
| 
 | Path name to the resource | 
| 
 | Lock token to be removed | 
TRUE if operation successful.
The user must have UPDATE privileges on the resource.