SYSPROC.SYSTS_SHUTDOWN

You can call the SYSPROC.SYSTS_SHUTDOWN stored procedure to shutdown DB2® text search functions. This stored procedure sets the SERVERSTATUS value in the catalog QSYS2.SYSTEXTSERVERS to 1 (stopped) and also ends the text search server jobs on the host system.

After this stored procedure has completed, SQL queries that use the CONTAINS or SCORE functions or administration stored procedures used for index maintenance return a failure without trying to contact a text search server.
Changes to the based-on table of the index continue to be logged, even when the server is shutdown. However, scheduled updates of the index do not occur until SYSPROC.SYSTS_START has been invoked.

Authorization

The user ID under which this stored procedure is invoked must have the following privileges:
  • *EXECUTE authority on the procedure.
  • SELECT and UPDATE privileges on the SYSTEXTSERVERS table.
  • *EXECUTE authority on the QSYS2 library of the SYSTEXTSERVERS file.
  • *JOBCTL authority or QIBM_DB_SQLADM security special function usage.

For information about the system authorities corresponding to SQL privileges, see GRANT (Table or View Privileges).

Syntax

 >>-SYSTS_SHUTDOWN--(--+-----------+--)-----------------------------><
                      +-serverid--+      
                      '-aliasname-'       

Parameters

serverid or aliasname
Specifies the identifier of the server for clear orphaned indexes. A serverid or server aliasname is a string. If no identifier is provided, the default is to clear orphaned indexes on all servers. The identifier string must either be a valid serverid that exists in the SERVERID column, or a valid server aliasname that exists in the ALIASNAME column of the QSYS2.SYSTEXTSERVERS table. If the identifier can be converted to an integer value, it is interpreted as a serverid. If the identifier cannot be converted to an integer value, it is interpreted as a server aliasname.

The data type of this parameter is VARCHAR(128).

Example

  • To shutdown all production servers:
    CALL SYSPROC.SYSTS_SHUTDOWN().
  • To shutdown a server with an ID of 1:
    CALL SYSPROC.SYSTS_SHUTDOWN(1)
  • To shutdown a server with an alias name of "LOCAL_SERVER":
    CALL SYSPROC.SYSTS_SHUTDOWN('LOCAL_SERVER')
  • To shutdown a server with an alias name of "local_server":
    CALL SYSPROC.SYSTS_SHUTDOWN('local_server')