205 DBMS_XDBT
The DBMS_XDBT package provides a convenient mechanism for administrators to set up a CONTEXT index on the Oracle XML DB hierarchy.
The package contains procedures to create default preferences, create the index and set up automatic synchronization of the CONTEXT index
The DBMS_XDBT package also contains a set of package variables that describe the configuration settings for the index. These are intended to cover the basic customizations that installations may require, but is by no means a complete set.
This chapter contains the following topics:
See Also:
205.1 DBMS_XDBT Overview
The DBMS_XDBT package contains a set of package variables that describe the configuration settings for the index.
The DBMS_XDBT package can be used in the following ways:
-
Customize the package to set up the appropriate configuration.
-
Use the DROPPREFERENCES Procedure to drop any existing index preferences
-
Create new index preferences using the CREATEPREFERENCES Procedure procedure
-
Create the
CONTEXTindex using the CREATEINDEX Procedure procedure -
Set up automatic synchronization of the index using the CONFIGUREAUTOSYNC Procedure
205.2 DBMS_XDBT Security Model
Owned by XDB, the DBMS_XDBT package must be created by SYS or XDB. The EXECUTE privilege is granted to SYS or XDB. Subprograms in this package are executed using the privileges of the current user.
205.3 DBMS_XDBT Operational Notes
Configuration settings, or package variables, are available to customize the DBMS_XDBT package.
The DBMS_XDBT package can be customized by using a PL/SQL procedure or an anonymous block to set the relevant package variables, configuration settings, and then execute the procedures. A more general approach would be to introduce the appropriate customizations by modifying this package in place, or as a copy. The system must be configured to use job queues, and the jobs can be viewed through the USER_JOBS catalog views.
Table 205-1 General Indexing Settings for Customizing DBMS_XDBT
| Parameter | Default Value | Description |
|---|---|---|
|
|
|
Name of the |
|
|
|
Tablespace used by tables and indexes comprising the |
|
|
|
Memory used by index creation and SYNC; less than or equal to the |
|
|
|
The log file used for |
Table 205-2 Filtering Settings for Customizing DBMS_XDBT
| Parameter | Default Value | Description |
|---|---|---|
|
|
|
List of mime types that should not be indexed. |
|
|
|
List of mime types that do not need to use the INSO filter. Use this for text-based documents. |
|
|
|
Name of the filter preference. |
Table 205-3 Stoplist Settings for Customizing DBMS_XDBT
| Parameter | Default Value | Description |
|---|---|---|
|
|
|
Name of the stoplist. |
|
|
|
List of stopwords, in excess of |
Table 205-4 Sectioning and Section Group Settings for Customizing DBMS_XDBT
| Parameter | Default Value | Description |
|---|---|---|
|
|
|
Default sectioner. Use |
|
|
|
Name of the section group. |
Table 205-5 Other Index Preference Settings for Customizing DBMS_XDBT
| Parameter | Default Value | Description |
|---|---|---|
|
|
|
Name of the datastore preference |
|
|
|
Name of the storage preference. |
|
|
|
Name of the wordlist preference. |
|
|
|
Name of the default lexer preference. |
Table 205-6 SYNC (CONTEXT Synchronization) Settings for Customizing DBMS_XDBT
| Parameter | Default Value | Description |
|---|---|---|
|
|
|
Indicates when the index should be SYNCed. One of |
|
|
|
Maximum number of documents in the |
|
|
|
How often, in minutes, the pending queue should be checked. Only if the |
|
|
|
Indicates how often, in minutes, the index should be SYNCed. Only if the AutoSyncPolicy is |
205.4 Summary of DBMS_XDBT Subprograms
This table lists the DBMS_XDBT subprograms in alphabetical order and briefly describes them.
Table 205-7 DBMS_XDBT Package Subprograms
| Subprogram | Description |
|---|---|
|
Configures the |
|
|
Creates a USER datastore preference for the |
|
|
Creates a filter preference for the |
|
|
Creates the |
|
|
Creates a lexer preference for the |
|
|
Creates preferences required for the |
|
|
Creates a storage preference for the |
|
|
Creates a section group for the |
|
|
Creates a wordlist preference for the |
|
|
Creates a stoplist for the |
|
|
Drops any existing preferences |
205.4.1 CONFIGUREAUTOSYNC Procedure
This procedure sets up jobs for automatic SYNCs of the CONTEXT index.
Syntax
DBMS_XDBT.CONFIGUREAUTOSYNC;
Usage Notes
-
The system must be configured for job queues for automatic synchronization. The jobs can be viewed using the
USER_JOBScatalog views -
The configuration parameter
AutoSyncPolicycan be set to choose an appropriate synchronization policy.
The synchronization can be based on one of the following:
| Sync Basis | Description |
|---|---|
|
|
The SYNC is triggered when the number of documents in the pending queue is greater than a threshold (See the MaxPendingCount configuration setting). The pending queue is polled at regular intervals (See the CheckPendingCountIntervalconfiguration parameter) to determine if the number of documents exceeds the threshold. |
|
|
The SYNC is triggered at regular intervals. (See theSyncInterval configuration parameter). |
|
|
A combination of both of the preceding options. |
205.4.2 CREATEDATASTOREPREF Procedure
This procedure creates a user datastore preference for the CONTEXT index on the XML DB hierarchy.
Syntax
DBMS_XDBT.CREATEDATASTOREPREF;
Usage Notes
-
The name of the
datastore preference can be modified; see theDatastorePrefconfiguration setting. -
The default
USERdatastore procedure also filters the incoming document. TheDBMS_XDBTpackage provides a set of configuration settings that control the filtering process. -
The
SkipFilter_Typesarray contains a list of regular expressions. Documents with a mime type that matches one of these expressions are not indexed. Some of the properties of the document metadata, such as author, remain unindexed.-
The
NullFilter_Typesarray contains a list of regular expressions. Documents with a mime type that matches one of these expressions are not filtered; however, they are still indexed. This is intended to be used for documents that are text-based, such as HTML, XML and plain-text. -
All other documents use the INSO filter through the IFILTER API.
-
205.4.3 CREATEFILTERPREF Procedure
This procedure creates a NULL filter preference for the CONTEXT index on the XML DB hierarchy.
Syntax
DBMS_XDBT.CREATEFILTERPREF;
Usage Notes
-
The name of the filter preference can be modified; see
FilterPrefconfiguration setting. -
The
USERdatastore procedure filters the incoming document; see CREATEDATASTOREPREF Procedurefor more details.
205.4.4 CREATEINDEX Procedure
This procedure creates the CONTEXT index on the XML DB hierarchy.
Syntax
DBMS_XDBT.CREATEINDEX;
Usage Notes
-
The name of the index can be changed; see the
IndexNameconfiguration setting. -
Set the
LogFileconfiguration parameter to enableROWIDlogging during index creation. -
Set the
IndexMemoryconfiguration parameter to determine the amount of memory that index creation, and later SYNCs, will use.
205.4.5 CREATELEXERPREF Procedure
This procedure creates a BASIC lexer preference for the CONTEXT index on the XML DB hierarchy.
Syntax
DBMS_XDBT.CREATELEXERPREF;
Usage Notes
-
The name of the
lexerpreference can be modified; seeLexerPrefconfiguration setting. No other configuration settings are provided. -
MultiLexerpreferences are not supported. -
Base letter translation is turned on by default.
205.4.6 CREATEPREFERENCES Procedure
This procedure creates a set of default preferences based on the configuration settings.
Syntax
DBMS_XDBT.CREATEPREFERENCES;
205.4.7 CREATESECTIONGROUPPREF Procedure
This procedure creates a section group for the CONTEXT index on the XML DB hierarchy.
Syntax
DBMS_XDBT.CREATESECTIONGROUPPREF;
Usage Notes
-
The name of the section group can be changed; see the
SectiongroupPrefconfiguration setting. -
The HTML sectioner is used by default. No zone sections are created by default. If the vast majority of documents are XML, consider using the
AUTO_SECTION_GROUPor thePATH_SECTION_GROUP; see theSectionGroupconfiguration setting.
205.4.8 CREATESTOPLISTPREF Procedure
This procedure creates a stoplist for the CONTEXT index on the XML DB hierarchy.
Syntax
DBMS_XDBT.CREATESTOPLISTPREF;
Usage Notes
-
The name of the stoplist can be modified; see the
StoplistPrefconfiguration setting. -
Numbers are not indexed.
-
The
StopWordsarray is a configurable list of stopwords. These are meant to be stopwords in addition to the set of stopwords inCTXSYS.DEFAULT_STOPLIST.
205.4.9 CREATESTORAGEPREF Procedure
This procedure creates a BASIC_STORAGE preference for the CONTEXT index on the XML DB hierarchy.
Syntax
DBMS_XDBT.CREATESTORAGEPREF;
Usage Notes
-
The name of the storage preference can be modified; see the
StoragePrefconfiguration setting. -
A tablespace can be specified for the tables and indexes comprising the
CONTEXTindex; see theIndexTablespaceconfiguration setting. -
Prefix and Substring indexing are not turned on by default.
-
The
I_INDEX_CLAUSEuses key compression.
205.4.10 CREATEWORLDLISTPREF Procedure
This procedure creates a word list preference for the CONTEXT index on the XML DB hierarchy.
Syntax
DBMS_XDBT.CREATEWORDLISTPREF;
Usage Notes
-
The name of the word list preference can be modified; see the
WordlistPrefconfiguration setting. No other configuration settings are provided. -
FUZZY_MATCHandSTEMMERattributes are set toAUTO(auto-language detection)