db2ts CLEAR COMMAND LOCKS command

Removes all command locks for a specific text search index or for all text search indexes in the database. A command lock is created at the beginning of a text search index command, and is destroyed when it is done. It prevents undesirable conflict between different commands.

Use of this command is required in the rare case that locks remain in place due to an unexpected system behavior, and need to be cleaned up explicitly.

For execution, the command needs to be prefixed with db2ts at the command line.

Authorization

The privileges held by the authorization ID of the statement used to clear locks on the index must include both of the following authorities:
  • SYSTS_MGR role
  • DBADM authority or CONTROL privilege on the base table on which the index is defined

The privileges held by the authorization ID of the statement used to clear locks on the database connection must include the SYSTS_ADM role.

Required connection

Database

Command syntax

Read syntax diagramSkip visual syntax diagramCLEAR COMMAND LOCKSFOR INDEXindex-nameFOR TEXTconnection options
connection options
Read syntax diagramSkip visual syntax diagramCONNECT TOdatabase-nameUSERusernameUSINGpassword

Command parameters

FOR INDEX index-name
The name of the index as specified in the CREATE INDEX command.
CONNECT TO database-name
This clause specifies the database to which a connection will be established. The database must be on the local system. If specified, this clause takes precedence over the environment variable DB2DBDFT. This clause can be omitted if the following are all true:
  • The DB2DBDFT environment variable is set to a valid database name.
  • The user running the command has the required authorization to connect to the database server.
USER username USING password
This clause specifies the authorization name and password that will be used to establish the connection.

Usage notes

You would invoke this command because the process owning the command lock is dead. In this case, the command (represented by the lock) may not have completed, and the index may not be operational. You need to take appropriate action. For example, the process executing the DROP INDEX command dies suddenly. It has deleted some index data, but not all the catalog and collection information. The command lock is left intact. After clearing the DROP INDEX command lock, you may want to re-execute the DROP INDEX command. In another example, the process executing the UPDATE INDEX command is interrupted. It has processed some documents, but not all, and the command lock is still in place. After reviewing the text search index status and clearing the UPDATE INDEX command lock, you can re-execute the UPDATE INDEX command.

When this command is issued, the content of the Db2® Text Search view SYSIBMTS.TSLOCKS is updated.