db2ts DISABLE DATABASE FOR TEXT command

This command reverses the changes (for example, drops the text-search related tables and view) made by the command ENABLE DATABASE FOR TEXT.

Important: Net Search Extender (NSE) is no longer supported in Db2®. Use the Db2 Text Search feature.
When issued, this command:
  • Disables the Db2 Text Search feature for the database
  • Drops text search catalog tables and views and related database objects
  • If the FORCE option is specified, all text index information is removed from the database and all associated collections are deleted. See the db2ts DROP INDEX command for reference.

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 must include both of the following authorities:
  • DBADM with DATAACCESS authority.
  • SYSTS_ADM role

Required connection

Database

Command syntax

Read syntax diagramSkip visual syntax diagramDISABLE DATABASE FOR TEXTFORCEconnection options
connection options
Read syntax diagramSkip visual syntax diagramCONNECT TOdatabase-nameUSERusernameUSINGpassword

Command parameters

FORCE
Specifies that all text search indexes be forcibly dropped from the database.

If this option is not specified and text search indexes are defined for this database, the command will fail.

If this option is specified and Db2 Text Search service has not been started (the db2ts START FOR TEXT command has not been issued), the text search indexes (collections) are not dropped and need to be cleaned up manually with the db2ts CLEANUP 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

This command does not influence the Db2 Net Search Extender enablement status of the database. It deletes the Db2 Text Search catalog tables and views that are created by the ENABLE FOR TEXT command.

Before dropping a Db2 database that has text search index definitions, issue this command and make sure that the text indexes and collections have been removed successfully.

If some indexes could not be deleted using the FORCE option, the collection names are written to the db2diag log file.
Note: The user is discouraged from usage that results in orphaned collections, such as, collections that remain defined on the text search server but are not used by Db2. Here are some cases that cause orphaned collections:
  • When a DROP DATABASE CLP command is executed without running a DISABLE DATABASE FOR TEXT command
  • When a DISABLE DATABASE FOR TEXT command is executed using the FORCE option.
  • Some other error conditions.
Multiple commands cannot be executed concurrently on a text search index if they may conflict. If this command is issued while a conflicting command is running, an error will occur and the command will fail, after which you can try to run the command again. Some of the conflicting commands are:
  • DROP INDEX
  • UPDATE INDEX
  • CLEAR EVENTS FOR INDEX
  • ALTER INDEX
  • DISABLE DATABASE FOR TEXT