Oracle9i XML Database Developer's Guide - Oracle XML DB Release 2 (9.2) Part Number A96620-01 |
|
This appendix describes the ways you can manage and configure your Oracle XML DB applications. It contains the following sections:
You will need to install Oracle XML DB under the following conditions:
You can perform a new installation of Oracle XML DB with or without Database Configuration Assistant (DBCA):
Oracle XML DB is part of the seed database and installed by DBCA as part of database installation by default. No additional steps are required to install Oracle XML DB, however, if you choose to install "Customized" database, you can configure Oracle XML DB tablespace and FTP, HTTP, and WebDAV port numbers.
By default DBCA performs the following tasks:
The Oracle XML DB tablespace holds the data that is stored in Oracle XML DB Repository. This includes data that is stored in the Repository using:
It is possible to store data in tables outside this tablespace and access that data through the Repository by having REFs to that data stored in the tables in this tablespace.
Warning: The Oracle XML DB tablespace should not be dropped. If it is dropped it renders all Repository data inaccessible. |
Oracle XML DB uses dynamic protocol registration to setup FTP and HTTP listener service with the local listener. So, make certain that the listener is up, when accessing any Oracle XML DB protocols.
To allow for unauthenticated access to your Oracle XML DB Repository data through HTTP, you must unlock the ANONYMOUS
user account.
After the database installation, you must run the following SQL scripts in rdbms/admin
connecting to SYS
to install Oracle XML DB after creating a new tablespace for Oracle XML DB Repository. Here is the syntax for this:
catqm.sql <xdb_pass> <XDB_TS_NAME> <TEMP_TS_NAME> #Create the tables and views needed to run XDB
For example:
catqm.sql change_on_install XDB TEMP
Reconnect to SYS
again and run the following:
catxdbj.sql #Load xdb java library
Note: Make sure that the database is started with Oracle9i Release 2 (9.2.0) compatibility or higher. |
After the manual installation, carry out these tasks:
init.ora
file:
dispatchers="(PROTOCOL=TCP) (SERVICE=<sid>XDB)"
ANONYMOUS
user account.To reinstall Oracle XML DB, run following SQL commands connecting to SYS to drop Oracle XML D user and tablespace:
drop user xdb cascade; alter tablespace <XDB_TS_NAME> offline; drop tablespace <XDB_TS_NAME> including contents;
Install Oracle XML DB manually as described in "Installing a New Oracle XML DB Manually Without DBCA".
Run the script, catproc.sql
, as always.
As a post upgrade step, if you want Oracle XML DB functionality, you must install Oracle XML DB manually as described in "Installing a New Oracle XML DB Manually Without DBCA" .
The following sections describe how to configure Oracle XML DB. You can also configure Oracle XML DB using Oracle Enterprise Manager.
Oracle XML DB is managed through a configuration resource stored in Oracle XML DB Repository, /sys/xdbconfig.xml
.
The Oracle XML DB configuration file is alterable at runtime. Simply updating the configuration file, causes a new version of the file to be generated. At the start of each session, the current version of the configuration is bound to that session. The session will use this configuration for its life, unless you invoke an explicit call to refresh to the latest configuration.
Oracle XML DB configuration is stored as an XML resource, /xdbconfig.xml
conforming to the Oracle XML DB configuration XML schema: http://xmlns.oracle.com/xdb/xdbconfig.xsd
To configure or modify the configuration of Oracle XML DB, update the /xdbconfig.xml
file by inserting, removing, or editing the appropriate XML elements in xdbconfig.xml
.
Oracle XML DB configuration XML schema has the following structure:
A top level tag, <xdbconfig>
is divided into two sections:
The following describes the syntax:
<xdbconfig> <sysconfig> ... </sysconfig> <userconfig> ... </userconfig> </xdbconfig>
The <sysconfig>
section is further subdivided as follows:
<sysconfig> General parameters <protocolconfig> ... </protocolconfig> </sysconfig>
It stores several general parameters that apply to all Oracle XML DB, for example, the maximum age for an ACL, whether Oracle XML DB should be case sensitive, and so on.
Protocol-specific parameters are grouped inside the <protocolconfig>
tag.
The <userconfig>
section contains any parameters that you may want to add.
The structure of the <protocolconfig>
section is as follows:
<protocolconfig> <common> ... </common> <httpconfig> ... </httpconfig> <ftpconfig> ... </ftpconfig> </protocolconfig>
Under <common>
Oracle9i stores parameters that apply to all protocols, such as MIME type information. There are also HTTP and FTP specific parameters under sections <httpconfig>
and <ftpconfig>
respectively.
Inside <httpconfig>
there is a further subsection, <webappconfig>
that corresponds to Web-based applications. It includes Web application specific parameters, for example, icon name, display name for the application, list of servlets in Oracle XML DB, and so on.
See Also:
|
The following is a sample Oracle XML DB configuration file:
<xdbconfig xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdbconfig.xsd http://xmlns.oracle.com/xdb/xdbconfig.xsd"> <sysconfig> <acl-max-age>900</acl-max-age> <invalid-pathname-chars>,</invalid-pathname-chars> <call-timeout>300</call-timeout> <max-session-use>100</max-session-use> <default-lock-timeout>3600</default-lock-timeout> <xdbcore-logfile-path>/sys/log/xdblog.xml</xdbcore-logfile-path> <xdbcore-log-level>1</xdbcore-log-level> <protocolconfig> <common> <extension-mappings> <mime-mappings> <mime-mapping> <extension>au</extension> <mime-type>audio/basic</mime-type> </mime-mapping> <mime-mapping> <extension>avi</extension> <mime-type>video/x-msvideo</mime-type> </mime-mapping> <mime-mapping> <extension>bin</extension> <mime-type>application/octet-stream</mime-type> </mime-mapping> <lang-mappings> <lang-mapping> <extension>en</extension> <lang>english</lang> </lang-mapping> </lang-mappings> <charset-mappings> </charset-mappings> <encoding-mappings> <encoding-mapping> <extension>gzip</extension> <encoding>zip file</encoding> </encoding-mapping> <encoding-mapping> <extension>tar</extension> <encoding>tar file</encoding> </encoding-mapping> </encoding-mappings> </extension-mappings> <session-pool-size>50</session-pool-size> <session-timeout>6000</session-timeout> </common> <ftpconfig> <ftp-port>2100</ftp-port> <ftp-listener>local_listener</ftp-listener> <ftp-protocol>tcp</ftp-protocol> <logfile-path>/sys/log/ftplog.xml</logfile-path> <log-level>0</log-level> <session-timeout>6000</session-timeout> </ftpconfig> <httpconfig> <http-port>8080</http-port> <http-listener>local_listener</http-listener> <http-protocol>tcp</http-protocol> <session-timeout>6000</session-timeout> <server-name>XDB HTTP Server</server-name> <max-header-size>16384</max-header-size> <max-request-body>2000000000</max-request-body> <logfile-path>/sys/log/httplog.xml</logfile-path> <log-level>0</log-level> <servlet-realm>Basic realm="XDB"</servlet-realm> <webappconfig> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> </welcome-file-list> <error-pages> </error-pages> <servletconfig> <servlet-mappings> <servlet-mapping> <servlet-pattern>/oradb/*</servlet-pattern> <servlet-name>DBURIServlet</servlet-name> </servlet-mapping> </servlet-mappings> <servlet-list> <servlet> <servlet-name>DBURIServlet</servlet-name> <display-name>DBURI</display-name> <servlet-language>C</servlet-language> <description>Servlet for accessing DBURIs</description> <security-role-ref> <role-name>authenticatedUser</role-name> <role-link>authenticatedUser</role-link> </security-role-ref> </servlet> </servlet-list> </servletconfig> </webappconfig> </httpconfig> </protocolconfig> </sysconfig> <userconfig><numusers>40</numusers></userconfig> </xdbconfig>
The Oracle XML DB Configuration API can be accessed just like any other XML schema-based resource in the hierarchy. It can be accessed and manipulated using FTP, HTTP, WebDav, Oracle Enterprise Manager, or any of the resource and DOM APIs for Java or PL/SQL.
For convenience, there is a PL/SQL API provided as part of the DBMS_XDB
package for configuration access. It exposes the following functions:
The cfg_get() function returns a copy of the configuration as an XMLType
:
DBMS_XDB.CFG_GET() RETURN SYS.XMLTYPE
cfg_get() is auto-commit.
The cfg_update() function updates the configuration with a new one:
DBMS_XDB.CFG_UPDATE(newconfig SYS.XMLTYPE)
If you have a few parameters to update in the configuration file, you can use the following :
BEGIN DBMS_XDB.CFG_UPDATE(UPDATEXML(UPDATEXML (DBMS_XDB.CFG_GET(), /xdbconfig/descendant::ftp-port/text()', '2121'), '/xdbconfig/descendant::http-port/text()', 19090')) END; /
If you have many parameters to updat, the preceding example may prove too cumbersome. Use instead FTP, HTTP, or Oracle Enterprise Manager.
The cfg_refresh()
function updates the configuration snapshot to correspond to the latest version on disk at that instant:
DBMS_XDB.CFG_REFRESH()
Typically, cfg_refresh()
is called in one of the following scenarios:
See Also:
Oracle9i XML API Reference - XDK and Oracle XML DB the chapter on |
|
Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|