These are the maintenance tasks:
You can run these tasks at any time and in any sequence.
Summary |
---|
|
This example updates the index for a common-index table:
db2tx "UPDATE INDEX db2tx.sample"
This example updates the index for a column of a multi-index table:
db2tx "UPDATE INDEX db2tx.sample HANDLE commenthandle"
Use this command to update the index immediately, without waiting for the next periodic indexing to take place automatically. This is useful when you have added several text documents to a database and want to search them immediately.
Text Extender indexes the text documents in this column (or all columns in the table) that have been inserted or changed, and removes from the index the terms from documents that have been deleted. The log table associated with the index contains information about which documents have been inserted, updated, and deleted.
A log table does not automatically contain information about changes to any external files that you may have indexed (see Enabling external text files), such as replacing a document by a newer version having the same absolute path name. Updates occurring on such files cannot be monitored by Text Extender in log tables because the updates do not occur within the scope of DB2 UDB .
To have updates on external files reflected in a Text Extender index, you can do the following:
UPDATE table SET filehandlecol = filehandlecol WHERE DB2TX.FILE(filehandlecol) = filename
where filename is the absolute path name of the external file that was updated.
Summary |
---|
|
Use this command to change the update frequency of an index.
See Setting the frequency of index updates for more information. If you do not specify an update frequency, the current settings are left unchanged.
Use the UPDATEINDEX keyword to determine whether the indexing of the text documents begins immediately, or when periodic indexing is next scheduled. If you do not use this keyword, the current setting is left unchanged.
To change the update frequency for the index so that it is updated at 12:00 or 15:00, on Monday to Friday, if there is a minimum of 100 text documents queued:
db2tx "CHANGE INDEX SETTINGS db2tx.sample HANDLE commenthandle UPDATEFREQ min(100) d(1,2,3,4,5) h(12,15) m(00)"
To stop the periodic updating of an index:
db2tx "CHANGE INDEX SETTINGS db2tx.sample HANDLE commenthandle UPDATEFREQ none"
Summary |
---|
|
Some situations can occur that prevent you from searching in an index, or from updating it. Displaying the status of an index describes how to determine if one of these events has occurred. RESET INDEX STATUS reactivates the index so that you can use it again.
This example resets the index status for the index of a common-index table:
db2tx "RESET INDEX STATUS db2tx.sample"
The syntax lets you reset the index status for a particular text column. This example resets the index status for the index of a multi-index table column:
db2tx "RESET INDEX STATUS db2tx.sample HANDLE commenthandle"
Summary |
---|
|
If something prevents you from searching in an index, or from updating it, or if a document cannot be indexed, this is known as an indexing event. Information about indexing events is stored in the index's log table. It can help you determine the cause of the problem. When you no longer need these messages, you can delete them.
This example deletes messages from the index of a common-index table:
db2tx "DELETE INDEX EVENTS db2tx.sample"
The syntax also lets you delete indexing events for a particular text column. This example deletes the messages for the index of a multi-index table column:
db2tx "DELETE INDEX EVENTS db2tx.sample HANDLE commenthandle"
Summary |
---|
|
If a text column is often updated, searching the index can become inefficient. To make searching efficient again, the index has to be reorganized. Although Text Extender recognizes when an index needs to reorganized and does so in the background automatically, there may be situations that require an index to be reorganized manually using REORGANIZE INDEX. You can use the command GET INDEX STATUS to find out if an index needs to be reorganized.
Although searches can be made on the index while REORGANIZE INDEX is running, index updates cannot.
This example reorganizes the index of a common-index table:
db2tx "REORGANIZE INDEX db2tx.sample"
This example reorganizes the index of a multi-index table column:
db2tx "REORGANIZE INDEX db2tx.sample HANDLE commenthandle"