188 DBMS_XDB_CONFIG
The DBMS_XDB_CONFIG
package provides an interface for configuring Oracle XML DB and its repository.
This chapter contains the following topics:
See Also:
188.1 DBMS_XDB_CONFIG Overview
PL/SQL package DBMS_XDB_CONFIG
is the Oracle XML DB resource application program interface (API) for PL/SQL for DBAs to configure their system. This API provides functions and procedures to access and manage Oracle XML DB Repository resources using PL/SQL. It includes methods for managing resource security and Oracle XML DB configuration.
Oracle XML DB Repository is modeled on XML, and provides a database file system for any data. The repository maps path names (or URLs) onto database objects of XMLType and provides management facilities for these objects.
PL/SQL package DBMS_XDB_CONFIG is an API that you can use to manage all of the following:
-
Oracle XML DB resources
-
Oracle XML DB security based on access control lists (ACLs). An ACL is a list of access control entries (ACEs) that determines which principals (users and roles) have access to which resources.
-
Oracle XML DB configuration
188.2 DBMS_XDB_CONFIG Security Model
Owned by XDB
, the DBMS_XDB_CONFIG
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.
188.3 DBMS_XDB_CONFIG Constants
The DBMS_XDB_CONFIG
package defines several enumerated constants that should be used for specifying parameter values.
These constants are shown in the following table.
Table 188-1 DBMS_XDB_CONFIG Constants
Constant | Type | Value | Description |
---|---|---|---|
|
|
1 |
Defining listener for first HTTP port |
|
|
2 |
Defining listener for second HTTP port |
|
|
3 |
Defining listener for a remote HTTP port |
|
|
4 |
Defining listener for a remote HTTPS port |
|
|
1 |
Defining listener for HTTP protocol |
|
|
2 |
Defining listener for HTTPS protocol |
188.4 Summary of DBMS_XDB_CONFIG Subprograms
The DBMS_XDB_CONFIG
package uses subprograms for configuring Oracle XML DB and its repository.
These subprograms are listed in the following table.
Table 188-2 DBMS_XDB_CONFIG Package Subprograms
Subprogram | Description |
---|---|
Adds to |
|
Adds a mime mapping to 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 the following XML extension to the XDB configuration under |
|
Retrieves the session's configuration information as an |
|
Refreshes the session's configuration information to the latest configuration |
|
Updates the configuration information and commits the change. |
|
Deletes from |
|
Deletes the mime mapping for a specified extension from the XDB configuration |
|
Deletes the schema location mapping for a specified schema URL from the XDB configuration |
|
Deletes a servlet from the XDB configuration |
|
Deletes the servlet mapping for a 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 |
|
Enables enables digest authentication |
|
Gets the value of the current FTP port |
|
Gets the value of the current HTTP port |
|
Gets the realm name |
|
Gets the value of the current HTTPS port |
|
Gets the parameters of a listener end point corresponding to the XML DB HTTP server |
|
Gets the value of a remote HTTP port |
|
Gets the value of a remote HTTPS port |
|
Returns the value of the |
|
Enables the use of a global port for Oracle Enterprise Manager Database Express (EM Express) clients |
|
Sets the FTP port to a new value |
|
Sets the HTTP port to a new value |
|
Sets the realm to a new value |
|
Sets the HTTPS 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 (when |
|
Sets the remote HTTP port to a new value |
|
Sets the remote HTTPS port to a new value |
|
Obtains the port numbers used by other pluggable databases in the same consolidation database |
188.4.1 ADDHTTPEXPIREMAPPING Procedure
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.
Syntax
DBMS_XDB_REPOS.ADDHTTPEXPIREMAPPING ( pattern IN VARCHAR2, expire IN VARCHAR2);
Parameters
Table 188-3 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 |
Examples
DBMS_XDB_REPOS.ADDHTTPEXPIREMAPPING ('/public/test1/*', 'now plus 4 weeks'); DBMS_XDB_REPOS.ADDHTTPEXPIREMAPPING ( '/public/test2/*', 'modification plus 1 day 30 seconds');
188.4.2 ADDMIMEMAPPING Procedure
This procedure adds the following mime mapping to XDB configuration:
<mime-mapping> <extension>extension</extension> <mime-type>mimetype</mime-type> </mime-mapping>
Syntax
DBMS_XDB_CONFIG.ADDMIMEMAPPING( extension IN VARCHAR2, mimetype IN VARCHAR2);
Parameters
Table 188-4 ADDMIMEMAPPING Procedure Parameters
Parameter | Description |
---|---|
|
Extension for which a mime type is being added |
|
Mime type |
188.4.3 ADDSCHEMALOCMAPPING Procedure
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>
Syntax
DBMS_XDB_CONFIG.ADDSCHEMALOCMAPPING( namespace IN VARCHAR2, element IN VARCHAR2, schemaURL IN VARCHAR2);
Parameters
Table 188-5 ADDSCHEMALOCMAPPING Procedure Parameters
Parameter | Description |
---|---|
|
Namespace |
|
Element |
|
Schema URL |
188.4.4 ADDSERVLET Procedure
This procedure adds a servlet to XDB configuration.
IT adds the following servlet:
<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>
Syntax
DBMS_XDB_CONFIG.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, schema IN VARCHAR2 := NULL);
Parameters
Table 188-6 ADDSERVLET Procedure Parameters
Parameter | Description |
---|---|
|
Servlet name |
|
Must be one of "C", "Java", "PL/SQL" |
|
Display name |
|
Icon |
|
Description |
|
The |
|
This parameter is not supported. Always provide |
|
The |
|
Schema is used to specify If you do not specify any value, then the schema is searched using the default resolver specification. |
188.4.5 ADDSERVLETMAPPING Procedure
This procedure adds a servlet mapping to XDB configuration.
It adds the following servlet mapping:
<servlet-mapping> <servlet-pattern>pattern</servlet-pattern> <servlet-name>name</servlet-name> </servlet-mapping>
Syntax
DBMS_XDB_CONFIG.ADDSERVLETMAPPING( pattern IN VARCHAR2, name IN VARCHAR2);
Parameters
Table 188-7 ADDSERVLETMAPPING Procedure Parameters
Parameter | Description |
---|---|
|
Sservlet pattern |
|
Servlet name |
188.4.6 ADDSERVLETSECROLE Procedure
This procedure adds the security role REF
to a specified servlet in XDB configuration.
It adds the following security role as shown in the following:
<security-role-ref> <role-name>rolename</role-name> <role-link>rolelink</role-link> <description>descript</description> </security-role-ref>
Syntax
DBMS_XDB_CONFIG.ADDSERVLETSECROLE( servname IN VARCHAR2, rolename IN VARCHAR2, rolelink IN VARCHAR2, descript IN VARCHAR2 := NULL);
Parameters
Table 188-8 ADDSERVLETSECROLE Procedure Parameters
Parameter | Description |
---|---|
|
Sservlet name |
|
Role name |
|
Role link |
|
Description |
188.4.7 ADDXMLEXTENSION Procedure
This procedure adds an XML extension to the XDB configuration under <xml-extensions>
.
It adds the following XML extension to the XDB configuration, under <xml-extensions>
:
<extension>extension</extension>
Syntax
DBMS_XDB_CONFIG.ADDXMLEXTENSION( extension IN VARCHAR2);
Parameters
Table 188-9 ADDXMLEXTENSION Procedure Parameters
Parameter | Description |
---|---|
|
XML extension to be added |
188.4.8 CFG_GET Function
This function retrieves the session's configuration information as an XMLType
instance.
Syntax
DBMS_XDB_CONFIG.CFG_GET RETURN SYS.XMLType;
188.4.9 CFG_REFRESH Procedure
This procedure refreshes the session's configuration information to the latest configuration.
Syntax
DBMS_XDB_CONFIG.CFG_REFRESH;
188.4.10 CFG_UPDATE Procedure
This procedure updates the configuration information and commits the change.
Syntax
DBMS_XDB_CONFIG.CFG_UPDATE( xdbconfig IN SYS.XMLTYPE);
Parameters
Table 188-10 CFG_UPDATE Procedure Parameters
Parameter | Description |
---|---|
|
The new configuration data |
188.4.11 DELETEHTTPEXPIREMAPPING Procedure
This procedure deletes from XDB$CONFIG
all mappings of the URL pattern to an expiration date.
Syntax
DBMS_XDB_REPOS.DELETEHTTPEXPIREMAPPING( pattern IN VARCHAR2);
Parameters
Table 188-11 DELETEHTTPEXPIREMAPPING Procedure Parameters
Parameter | Description |
---|---|
|
URL pattern (only * accepted as wildcards) |
188.4.12 DELETEMIMEMAPPING Procedure
This procedure deletes the mime mapping for a specified extension from the XDB configuration.
Syntax
DBMS_XDB_CONFIG.DELETEMIMEMAPPING( extension IN VARCHAR2);
Parameters
Table 188-12 DELETEMIMEMAPPING Procedure Parameters
Parameter | Description |
---|---|
|
Extension for which a mime type is to be deleted |
188.4.13 DELETESCHEMALOCMAPPING Procedure
This procedure deletes the schema location mapping for a specified schema URL from the XDB configuration.
Syntax
DBMS_XDB_CONFIG.DELETESCHEMALOCMAPPING( schemaURL IN VARCHAR2);
Parameters
Table 188-13 DELETESCHEMALOCMAPPING Procedure Parameters
Parameter | Description |
---|---|
|
Schema URL |
188.4.14 DELETESERVLET Procedure
This procedure deletes a servlet from the XDB configuration.
Syntax
DBMS_XDB_CONFIG.DELETESERVLET( name IN VARCHAR2);
Parameters
Table 188-14 DELETESERVLET Procedure Parameters
Parameter | Description |
---|---|
|
Servlet name |
188.4.15 DELETESERVLETMAPPING Procedure
This procedure deletes the servlet mapping for a specified servlet name from the XDB configuration.
Syntax
DBMS_XDB_CONFIG.DELETESERVLETMAPPING( name IN VARCHAR2);
Parameters
Table 188-15 DELETESERVLETMAPPING Procedure Parameters
Parameter | Description |
---|---|
|
Servlet name |
188.4.16 DELETESERVLETSECROLE Procedure
This procedure deletes the specified role from a servlet in the XDB configuration.
Syntax
DBMS_XDB_CONFIG.DELETESERVLETSECROLE( servname IN VARCHAR2, rolename IN VARCHAR2);
Parameters
Table 188-16 DELETESERVLETSECROLE Procedure Parameters
Parameter | Description |
---|---|
|
Servlet name |
|
Name of the role to be deleted |
188.4.17 DELETEXMLEXTENSION Procedure
This procedure deletes the specified XML extension from the XDB configuration.
Syntax
DBMS_XDB_CONFIG.DELETEXMLEXTENSION( extension IN VARCHAR2);
Parameters
Table 188-17 DELETEXMLEXTENSION Procedure Parameters
Parameter | Description |
---|---|
|
XML extension to be deleted |
188.4.18 ENABLEDIGESTAUTHENTICATION Procedure
This procedure enables digest authentication. It will list digest as the first authentication mechanism to be used by the XML DB HTTP server.
Syntax
DBMS_XDB_CONFIG.ENABLEDIGESTAUTHENTICATION;
188.4.19 GETFTPPORT Function
This procedure gets the value of the current FTP port.
Syntax
DBMS_XDB_CONFIG.GETFTPPORT RETURN NUMBER;
188.4.20 GETHTTPCONFIGREALM Function
This function gets the realm name. Definition of a realm is referenced in IETF's RFC2617.
Syntax
DBMS_XDB_CONFIG.GETHTTPCONFIGREALM RETURN VARCHAR2;
188.4.21 GETHTTPPORT Function
This function gets the value of the current HTTP port.
Syntax
DBMS_XDB_CONFIG.GETHTTPPORT RETURN NUMBER;
188.4.22 GETHTTPSPORT Function
This procedure gets the value of the current HTTPS port.
Syntax
DBMS_XDB_CONFIG.GETHTTPSPORT RETURN NUMBER;
Usage Notes
Returns NULL
if no port has been configured
188.4.23 GETLISTENERENDPOINT Procedure
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.
Syntax
DBMS_XDB_CONFIG.GETLISTENERENDPOINT ( endpoint IN NUMBER, host OUT VARCHAR2, port OUT NUMBER, protocol OUT NUMBER);
Parameters
Table 188-18 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 |
188.4.24 GETREMOTEHTTPPORT Function
This function gets the value of a remote HTTP port.
Syntax
DBMS_XDB_CONFIG.GETREMOTEHTTPPORT RETURN NUMBER;
188.4.25 GETREMOTEHTTPSPORT Function
This function gets the value of a remote HTTPS port.
Syntax
DBMS_XDB_CONFIG.GETREMOTEHTTPSPORT RETURN NUMBER;
188.4.26 ISGLOBALPORTENABLED Function
This procedure returns the value of the GlobalPortEnabled
setting.
Syntax
DBMS_XDB_CONFIG.ISGLOBALPORTENABLED RETURN BOOLEAN;
Usage Notes
-
This procedure returns
TRUE
if
has been set toGlobalPortEnabled
TRUE
; otherwise it returnsFALSE
. -
In a multitenant environment, you can execute this function in both the CDB root and PDBs.
188.4.27 SETFTPPORT Procedure
This procedure sets the FTP port to a new value.
Syntax
DBMS_XDB_CONFIG.SETFTPPORT( new_port IN NUMBER);
Parameters
Table 188-19 SETFTPPORT Procedure Parameters
Parameter | Description |
---|---|
|
Value to which the FTP port is set |
188.4.28 SETGLOBALPORTENABLED Procedure
This procedure enables Oracle Enterprise Manager Database Express (EM Express) clients to use a single port (called a global port), for the session rather than using a port dedicated to the PDB.
Syntax
DBMS_XDB_CONFIG.SETGLOBALPORTENABLED ( isenabled IN BOOLEAN);
Parameters
Table 188-20 SETGLOBALPORTENABLED Procedure Parameters
Parameter | Description |
---|---|
|
The default is |
Usage Notes
-
Use the
DBMS_XDB_CONFIG.SETGLOBALPORTENABLED
procedure if you use EM Express to manage database ports in a multitenant environment. -
To use a global port, you must enable it in both the CDB and the PDB. PDBs have it enabled by default. For CDBs, you must run the
DBMS_XDB_CONFIG.SETGLOBALPORTENABLED
procedure in the CDB root. -
After you set
DBMS_XDB_CONFIG.SETGLOBALPORTENABLED
toTRUE
, then you must specify a PDB to use for the global port. You can do so by specifying the PDB name in the Container Name field of the EM Express login page. For example, if you enterhr_pdb
, then the EM Express URL becomeshttp://server_name:5500/hr_pdb/em
. This example uses the port5500
in the CDB root, which in turn routes messages to the EM Express in the PDBhr_pdb
. The port can be an HTTP or HTTPS port. -
The PDB that you specify in the EM Express login page must be open in read/write mode before you can run
DBMS_XDB_CONFIG.SETGLOBALPORTENABLED
. You can check the read/write mode status of a PDB by connecting to the PDB and then querying theOPEN_MODE
column of theV$PDBS
dynamic view. -
The
DBMS_XDB_CONFIG.ISGLOBALPORTENABLED
function returns the value of theDBMS_XDB_CONFIG.SETGLOBALPORTENABLED
setting. -
You can use the
XDB_PROTOCOLS
lockdown profile to control the security for the global port.
See Also:
-
Oracle Database 2 Day DBA for information about using
DBMS_XDB_CONFIG.SETGLOBALPORTENABLED
to start EM Express for a PDB - for information about lockdown profiles
188.4.29 SETHTTPPORT Procedure
This procedure sets the HTTP port to a new value.
Syntax
DBMS_XDB_CONFIG.SETHTTPPORT( new_port IN NUMBER);
Parameters
Table 188-21 SETHTTPPORT Procedure Parameters
Parameter | Description |
---|---|
|
Value to which the HTTP port is set |
188.4.30 SETHTTPCONFIGREALM Procedure
This procedure modifies the realm value.
Syntax
DBMS_XDB_CONFIG.SETHTTPCONFIGREALM( realm IN VARCHAR2);
Parameters
Table 188-22 SETHTTPPORT Procedure Parameters
Parameter | Description |
---|---|
|
Realm as defined in IETF's RFC2617 |
188.4.31 SETHTTPSPORT Procedure
This procedure sets the HTTPS port to a new value.
Syntax
DBMS_XDB_CONFIG.SETHTTPSPORT( new_port IN NUMBER);
Parameters
Table 188-23 SETHTTPSPORT Procedure Parameters
Parameter | Description |
---|---|
|
Value to which the HTTPS port is set |
188.4.32 SETLISTENERENDPOINT Procedure
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.
Syntax
DBMS_XDB_CONFIG.SETLISTENERENDPOINT ( endpoint IN NUMBER, host IN VARCHAR2, port IN NUMBER, protocol IN NUMBER);
Parameters
Table 188-24 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 |
188.4.33 SETLISTENERLOCALACCESS Procedure
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
).
Syntax
DBMS_XDB_CONFIG.SETLISTENERLOCALACCESS ( l_access BOOLEAN);
Parameters
Table 188-25 SETLISTENERLOCALACCESS Procedure Parameters
Parameter | Description |
---|---|
|
|
188.4.34 SETREMOTEHTTPPORT Procedure
This procedure sets a remote HTTP port to a new value.
Syntax
DBMS_XDB_CONFIG.SETREMOTEHTTPPORT( new_port IN NUMBER);
Parameters
Table 188-26 SETREMOTEHTTPPORT Procedure Parameters
Parameter | Description |
---|---|
|
Value to which the remote HTTP port is set |
188.4.35 SETREMOTEHTTPSPORT Procedure
This procedure sets a remote HTTPS port to a new value.
Syntax
DBMS_XDB_CONFIG.SETREMOTEHTTPSPORT ( new_port IN NUMBER);
Parameters
Table 188-27 SETREMOTEHTTPSPORT Procedure Parameters
Parameter | Description |
---|---|
|
Value to which the remote HTTPS port is set |