db2ts ENABLE DATABASE FOR TEXT command
The db2ts ENABLE DATABASE FOR TEXT command enables Db2® Text Search
for the current database.
It creates administrative tables and views, sets default
values for parameters, and must run successfully before you can create text search indexes on
columns in tables within the database. The command needs to be prefixed with db2ts at the command
line.
After enabling the database, it is necessary to specify the connection information for the text search server in the SYSIBMTS.TSSERVERS view. The enable operation includes an attempt to populate the server data and will show a warning if the server configuration cannot be accessed. In any case, it is recommended to verify the connection information in the view. For details, see the topic about updating Db2 Text Search server information.
Authorization
- The privileges held by the authorization ID of the statement must include the SYSTS_ADM role and the DBADM authority.
Required connection
Database
Command syntax
Command parameters
- ADMINISTRATION TABLES IN tablespace-name
- Specifies the name of an existing regular table space for administration tables created while
enabling the database for Db2 Text
Search. It is recommended that the table space is in the database partition group IBMCATGROUP. For a
partitioned database, the bufferpool and table space should be defined with 32 KB page size.
If the clause is not specified, SYSTOOLSPACE is used as default table space. In this case, ensure that SYSTOOLSPACE already exists. If it does not exist, the SYSPROC.SYSINSTALLOBJECTS procedure may be used to create it.
Note: Use quotation marks to specify a case-sensitive table space name. - AUTOGRANT
- This option has been deprecated and does not grant privileges to the instance owner anymore. Its use is no longer suggested and might be removed in a future release.
- CONNECT TO database-name
- This clause specifies the database to which a connection is 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 statements 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 used to establish the connection.
Example
Example 1: Enable a database for Db2 Text Search
creating administration tables in table space named
tsspace
and return any error
messages in English.
CALL SYSPROC.SYSTS_ENABLE('ADMINISTRATION TABLES IN tsspace', 'en_US', ?)
The following is an example of output from this
query.
Value of output parameters
--------------------------
Parameter Name : MESSAGE
Parameter Value : Operation completed successfully.
Return Status = 0
Usage notes
When executed successfully,
this command does the following actions:
- Enables the Db2 Text Search feature for the database.
- Establishes Db2 Text Search database configuration default values in the view SYSIBMTS.TSDEFAULTS.
- Creates the following Db2 Text Search
administrative views in the SYSIBMTS schema:
- SYSIBMTS.TSDEFAULTS
- SYSIBMTS.TSLOCKS
- SYSIBMTS.TSINDEXES
- SYSIBMTS.TSCONFIGURATION
- SYSIBMTS.TSCOLLECTIONNAMES
- SYSIBMTS.TSSERVERS