Chapter 12: Managing the Oracle XML Database
This chapter covers Oracle XML Database 10g management topics, beginning with looking at the components that are installed. Then, it explores how to configure the Oracle XML Database (Oracle XML DB) to ensure functionality for XML applications. Finally, it shows configurations for user privileges and permissions to secure XML data and operations in the Oracle database.
Installed Oracle XML DB Components
After installing Oracle XML Database 10g, the XDB and ANONYMOUS users and an XDBADMIN role are created. The XDB user is created to maintain the PL/SQL packages, datatypes, and system object registries for Oracle XML DB. The ANONYMOUS user is created to allow for unauthenticated access of the Oracle XML DB Repository through the built-in HTTP server in the Oracle database. The XDBADMIN role is granted to all the DBA users by default so that DBA users can perform Oracle XML DB administration operations, such as registering global XML schemas.
Note | The ANONYMOUS user is created with the account LOCKED. Unless you need unauthenticated access to the Oracle XML DB Repository, do not unlock the ANONYMOUS user; doing so will create a security hole. |
Table 12-1 lists the Oracle XML DB directory tables that are created to manage registered XML schemas, XMLType tables, and views. These tables can be viewed from SQL*Plus or Oracle Enterprise Manager.
Directory Name | Description |
---|---|
DBA_XML_SCHEMAS | All registered XML schemas in the Oracle XML DB |
USER_XML_SCHEMAS | All registered XML schemas owned by the current user |
ALL_XML_SCHEMAS | All registered XML schemas usable by the current user |
DBA_XML_TABLES | All XMLType tables in the Oracle XML DB |
USER_XML_TABLES | All XMLType tables owned by the current user |
ALL_XML_TABLES | All XMLType tables usable by the current user |
DBA_XML_TAB_COLS | All XMLType table columns in the Oracle XML DB |
USER_XML_TAB_COLS | All XMLType table columns in tables owned by the current user |
ALL_XML_TAB_COLS | All XMLType table columns in tables usable by the current user |
DBA_XML_VIEWS | All XMLType views in the Oracle XML DB |
USER_XML_VIEWS | All XMLType views owned by the current user |
ALL_XML_VIEWS | All XMLType views usable by the current user |
DBA_XML_VIEW_COLS | All XMLType view columns in the Oracle XML DB |
USER_XML_VIEW_COLS | All XMLType view columns in views owned by the current user |
ALL_XML_VIEW_COLS | All XMLType view columns in views usable by the current user |
All Oracle XML DB PL/SQL packages and the new XML data types, including XMLType and Oracle XML DB URI types, are installed with Oracle XML DB. Table 12-2 lists major PL/SQL packages, XML datatypes and their function descriptions. All the definition files are stored in the ORACLE_HOME/rdbms/ADMIN directory.
Package Name | Definition File | Functionality |
---|---|---|
XMLTypeXMLSequenceTypeXMLGenFormatType | dbmsxmlt.sql | New XML data types |
UriTypeDBUriTypeFTPUriTypeXDBUriTypeHTTPUriTypeUriFactory | dbmsuri.sql | Oracle XML DB URI datatypes |
DBMS_XMLGENDBMS_XMLSTORE | dbmsxml.sql | PL/SQL packages generating XML from SQL queries and storing XML into relational tables via a canonical mapping |
DBMS_XMLDOM | dbmsxmld.sql | PL/SQL DOM XML parsing API |
DBMS_XMLPARSER | dbmsxmlp.sql | PL/SQL XML parser interface with support of XMLType |
DBMS_XSLPROCESSOR | dbmsxsl.sql | PL/SQL XSL processor with support for XPath XML data extraction from DOM |
DBMS_XMLSCHEMA | dbmsxsch.sql | PL/SQL XML Schema support |
DBMS_XDB | dbmsxdb.sql | PL/SQL APIs to access and manage resource and data in Oracle XML DB Repository |
DBMS_XDBZ | dbmsxdbz.sql | XML DB security support |
DBMS_XDBT | dbmsxdbt.sql | PL/SQL package to set up an Oracle Text ConText index on the Oracle XML DB Repository hierarchy, create default preferences, and set up automatic synchronization of the CONTEXT index |
Note | The corresponding PL/SQL package implementations are in the files with names starting with prvt followed by the letters after dbms in the name of the definition file. For example, the package body of DBMS_ XDBT is in the prvtxdbt.sql file. |
If you need to reinstall Oracle XML DB, you can go to the $ORACLE_HOME/rdbms/admin directory on UNIX and the %ORACLE_HOME%/rdbms/admin directory on Windows, connect to the Oracle database as SYS user, and follow these steps:
Log in to a SQL*Plus session and connect as the SYS user with SYSDBA privileges:
> sqlplus "SYS/<sys_password> as SYSDBA"
Run catnoqm.sql:
SQL> @catnoqm
This step drops the XDB user, and all information in the Oracle XML DB Repository will be lost as will all information in the schema-based XMLType tables and columns.
Shut down and restart the database:
SQL> shutdown immediate;
SQL> startup
Run catqm.sql script and specify the password (such as XDBPW), the default tablespace (such as XDB), and the temporary tablespace (TEMP) for the XDB user:
SQL> @catqm XDBPW XDB TEMP
Run catxdbj.sql to install the XML DB Java packages:
SQL> @catxdbj