来源:http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb19rpl.htm
DBMS_XDB: Configuration Management
Table 23-3 lists the DBMS_XDB Oracle XML DB configuration management functions and procedures.
Table 23-3 DBMS_XDB: Configuration Management Functions and Procedures
Function/Procedure Description
cfg_get
Returns the configuration information for the current session.
cfg_refresh
Refreshes the session configuration information using the current Oracle XML DB configuration file, xdbconfig.xml.
cfg_update
Updates the Oracle XML DB configuration information. This writes the configuration file, xdbconfig.xml.
getFTPPort
Returns the current FTP port number.
getHTTPPort
Returns the current HTTP port number.
setFTPPort
Sets the Oracle XML DB FTP port to the specified port number.
setHTTPPort
Sets the Oracle XML DB HTTP port to the specified port number.
See Also:
Oracle Database PL/SQL Packages and Types Reference
The examples in this section illustrate the use of these functions and procedures.
Example 23-6 Using Function DBMS_XDB.cfg_get
In this example, function cfg_get is used to retrieve the Oracle XML DB configuration file, xdbconfig.xml.
CONNECT SYSTEM/MANAGER
Connected.
SELECT DBMS_XDB.cfg_get() FROM DUAL;
DBMS_XDB.CFG_GET()
--------------------------------------------------------------------------------
900
32
,
true
300
65536
100
false
3600
0
1048576
. . .
. . .
8000
local_listener
tcp
64
16384
2000000000
6000
XDB HTTP Server
0
Basic realm="XDB"
. . .
1024
16
1 row selected.
Example 23-7 Using Procedure DBMS_XDB.cfg_update
This example illustrates the use of procedure cfg_update. The current configuration is retrieved as an XMLType instance and modified. It is then rewritten using cfg_update.
DECLARE
configxml SYS.XMLType;
configxml2 SYS.XMLType;
BEGIN
-- Get the current configuration
configxml := DBMS_XDB.cfg_get();
-- Modify the configuration
SELECT updateXML(
configxml,
'/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()',
'8000',
'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"')
INTO configxml2 FROM DUAL;
-- Update the configuration to use the modified version
DBMS_XDB.cfg_update(configxml2);
END;
/
PL/SQL procedure successfully completed.
SELECT DBMS_XDB.cfg_get() FROM DUAL;
DBMS_XDB.CFG_GET()
--------------------------------------------------------------------------------
900
32
,
true
300
65536
100
false
3600
0
1048576
. . .
. . .
8000
. . .
1024
16
1 row selected.