Oracle® Database PL/SQL Packages and Types Reference 11g Release 2 (11.2) Part Number E25788-04 |
|
|
PDF · Mobi · ePub |
The DBMS_XMLINDEX
package provides an interface to implement asychronous indexing.
This chapter contains the following topics:
Overview
Security Model
Asynchronous Index Maintenance
The basic XMLIndex is maintained on every DML operation. However, given the computing costs, in many cases the availability of stale result is adequate. In such situations, it is desirable to defer index updates to a convenient time, for example to a time when the load on the database is low. Thus a mechanism for asynchronous index maintenance is provided.
Owned by XDB
, the DBMS_XMLINDEX
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.
This table list the package subprograms in alphabetical order.
Table 172-1 DBMS_XMLINDEX Package Subprograms
Subprogram | Description |
---|---|
Creates a secondary index for date values in the |
|
Creates a secondary index for number values in the |
|
Drops the |
|
Modifies the |
|
Registers a parameter string and |
|
Synchronizes the index manually |
This procedure creates a secondary index for date values in the VALUE
column of a PATH
TABLE
which is the storage table of an XMLIndex
. The second form of the procedure allows for the date_index_clause
to be set to an empty string.
DBMS_XMLINDEX.CREATEDATEINDEX ( xml_index_schema IN VARCHAR2, xml_index_name IN VARCHAR2, date_index_name IN VARCHAR2, xmltypename IN VARCHAR2, date_index_clause IN VARCHAR2); DBMS_XMLINDEX.CREATEDATEINDEX ( xml_index_schema IN VARCHAR2 xml_index_name IN VARCHAR2, date_index_name IN VARCHAR2, xmltypename IN VARCHAR2);
Table 172-2 CREATEDATEINDEX Procedure Parameters
Parameter | Description |
---|---|
|
Name of the owner of the |
|
Name of the |
|
Name of the secondary index to be created for date values in the |
|
The type to which values in the |
|
Storage clause to be applied to the date index during its creation. This is a string argument appended to the |
This procedure creates a secondary index for number values in the VALUE
column of a PATH
TABLE
which is the storage table of an XMLIndex
.
DBMS_XMLINDEX.CREATENUMBERINDEX ( xml_index_schema IN VARCHAR2, xml_index_name IN VARCHAR2, num_index_name IN VARCHAR2, num_index_clause IN VARCHAR2, xmltypename IN VARCHAR2);
Table 172-3 CREATENUMBERINDEX Procedure Parameters
Parameter | Description |
---|---|
|
Name of the owner of the |
|
Name of the |
|
Name of the secondary index to be created for number values in the |
|
Storage clause to be applied to the number index during its creation. This is a string argument appended to the |
|
The type to which values in the |
This procedure drops the XMLIndex
parameter string that is associated with a given parameter identifier.
DBMS_XMLINDEX.DROPPARAMETER ( name IN VARCHAR2);
Table 172-4 DROPPARAMETER Procedure Parameters
Parameter | Description |
---|---|
|
Identifier for parameter string |
DBMS_XMLINDEX.DROPPARAMETER ( 'myIndexParam');
This procedure modifies the XMLIndex
parameter string that is associated with a given parameter identifier.
DBMS_XMLINDEX.MODIFYPARAMETER ( name IN VARCHAR2, parameter IN CLOB);
Table 172-5 MODIFYPARAMETER Procedure Parameters
Parameter | Description |
---|---|
|
Identifier for parameter string |
|
|
DBMS_XMLINDEX.MODIFYPARAMETER ( 'myIndexParam', 'PATH TABLE po_ptab PATH ID INDEX po_pidx ORDER KEY INDEX po_oidx VALUE INDEX po_vidx');
This procedure registers a parameter identifier and XMLIndex
parameter string pair in XDB.
DBMS_XMLINDEX.REGISTERPARAMETER ( name IN VARCHAR2, parameter IN CLOB);
Table 172-6 REGISTERPARAMETER Procedure Parameters
Parameter | Description |
---|---|
|
Identifier for parameter string |
|
|
DBMS_XMLINDEX.REGISTERPARAMETER ( 'myIndexParam', 'PATH TABLE po_ptab PATH ID INDEX po_pidx ORDER KEY INDEX po_oidx VALUE INDEX po_vidx PATHS(NAMESPACE MAPPING(xmlns:p="http://www.example.com/IPO")) GROUP MASTERGROUP XMLTABLE PO_TAB (''/p:PurchaseOrder'' COLUMNS REFERENCE VARCHAR2(30) PATH ''p:Reference'', REQUESTOR VARCHAR2(30) PATH ''p:Requestor'' ) GROUP ITEMGROUP XMLTABLE ITEMGROUP_TAB (''/p:PurchaseOrder/p:LineItems/p:LineItem'' COLUMNS LINENUMBER NUMBER(38) PATH ''@p:ItemNumber'', QUANTITY NUMBER(38) PATH ''@p:Quantity'', DESCRIPTION VARCHAR2(256) PATH ''p:Description'' ));
This function synchronizes an asynchronously maintained XMLIndex. It applies to the XMLIndex changes that are logged in the pending table, and brings the path table up-to-date with the base XMLTYPE
column.
DBMS_XMLINDEX.SYNCINDEX ( xml_index_schema IN VARCHAR2, xml_index_name IN VARCHAR2, partition_name IN VARCHAR2 DEFAULT NULL, reindex IN BOOLEAN DEFAULT FALSE);
Table 172-7 SYNCINDEX Procedure Parameters
Parameter | Description |
---|---|
|
Name of the owner of the XMLIndex |
|
Name of the XMLIndex |
|
[Currently not supported] |
|
Default is |
EXEC DBMS_XMLINDEX.SYNCINDEX('USER1', 'SS_TAB_XMLI', REINDEX=>TRUE);