SYSPROC.SYSTS_TAKEOVER
Invoke the SYSPROC.SYSTS_TAKEOVER stored procedure after encountering problems contacting a text search server during search operations.
Usually, such problems are indicated by console message DSN5001I. If the problem persists, this stored procedure chooses a different, available text search server and restores the text search index to that server.
This stored procedure checks whether the text search server can be contacted for the specified text search index by trying several connection attempts. If the text search index on the text search server is not available, this stored procedure chooses any available server from the SYSIBMTS.SYSTEXTSERVERS table and tries to take over the text search index on the new server. If the attempt to take over a text search index fails, the SYSPROC.SYSTS_TAKEOVER stored procedure selects the next server that is listed in the SYSIBMTS.SYSTEXTSERVERS table and tries again.
After the stored procedure completes successfully, the new server is used for searching and index maintenance. The original text search server remains unchanged. If the stored procedure was unsuccessful on all servers (or if a second server is not listed in the SYSIBMTS.SYSTEXTSERVERS table), this stored procedure reports an error.
The SYSPROC.SYSTS_UPDATE stored procedure, the SYSPROC.SYSTS_DROP stored procedure, and the SYSPROC.SYSTS_RESTORE stored procedure will fail for the specified text search index while this stored procedure is running.
Prerequisites
- Db2 text search functionality was started by invocation of the SYSPROC.SYSTS_START stored procedure.
- The text search index was created (by invocation of the SYSPROC.SYSTS_CREATE stored procedure).
- The DB2ENCRYPTEDPW column in the SYSIBMTS.SYSTEXTSERVERS table has a valid, encrypted password value for the user ID that the text search server uses to connect to Db2 for z/OS®.
- The following stored procedures are not running for the index that you want to take over: SYSPROC.SYSTS_CREATE, SYSPROC.SYSTS_UPDATE, SYSPROC.SYSTS_DROP, and SYSPROC.SYSTS_RESTORE.
- At least one text search server is running.
- The distributed data facility (DDF) must be started, even if you call the stored procedure locally on your z/OS system. The DDF is required to allow the text search server to connect to Db2 to store a text search index.
Authorization
- EXECUTE on the procedure
- EXECUTE on the packages SYSIBMTS.*
- INDEX privilege on the table that the text search index is created on
In addition, the user ID that is listed in the SYSIBMTS.SYSTEXTCONNECTINFO table must have SELECT, INSERT, UPDATE, and DELETE privileges for the text search index table. These privileges must be valid for the user ID after the user ID is used to connect to Db2 for z/OS on a T4 Java™ connection and going through DRDA connect processing.
Syntax
The schema qualifier is SYSPROC.
Parameters
- indexSchema
- Identifies the schema of the text search index. If this parameter
is null, the value of the CURRENT SCHEMA special register for the
invoker is used.
Recommendation: Use a valid SQL name for this parameter.
The data type of this parameter is VARCHAR(128).
- indexName
- Identifies the name of the text search index. The name of the
text search index together with the index schema uniquely identifies
the text search index in the Db2 subsystem. You must specify
a non-null value for this parameter.
Recommendation: Use a valid SQL name for this parameter.
The data type for this parameter is VARCHAR(128).
Example
This example shows how to use the Db2 CALL statement to invoke the SYSPROC.SYSTS_TAKEOVER stored procedure. This example uses the SYSPROC.SYSTS_TAKEOVER stored procedure to choose a different, available text search server and restore the text search index to the available server.
CALL SYSPROC.SYSTS_TAKEOVER('SCHEMA1','IVC2')
- 'SCHEMA1' = indexSchema
- 'IVC2' = indexName