Managing Db2 threads

You can specify maximum numbers of active allied and database access threads that can be allocated concurrently.

About this task

Threads are an important resource within a Db2 subsystem. A thread is a structure that describes a connection made by an application and traces its progress in the Db2 subsystem. These values are specified at installation, and controlled by subsystem parameters. Choosing appropriate values for the maximum numbers of threads is important to keep applications from queuing, and to provide adequate response times.

The following types of threads are used in Db2 subsystems:

Allied threads
Allied threads are threads that are connected to Db2 from TSO, batch, IMS, CICS®, CAF, or RRSAF.
Database Access Threads
Distributed database access threads (sometimes called DBATs) are threads that are connected through a network to access data at a Db2 server on behalf distributed requesting systems. Database access threads are created in the following situations:
  • When new connections are accepted from remote requesters
  • When Db2 is configured in INACTIVE mode, and a new request is received from a remote requester and no pooled database access thread is available to service the new request

Database access threads can operate in ACTIVE or INACTIVE mode. The mode used for database access threads is controlled by the value of the CMTSTAT subsystem parameter.

INACTIVE mode
When the value of the CMTSTAT subsystem parameter is INACTIVE, a database access thread can be active or pooled. When a database access thread is active, it is processing requests from client connections within units of work. When a database access thread is pooled, it is waiting for the next request from a client to start a new unit of work.

INACTIVE mode database access threads are terminated under any of the following conditions:

  • After processing 200 units of work.
  • After being idle in the pool for the amount of time specified by the value of the POOLINAC subsystem parameter.

However, the termination of an INACTIVE mode thread does not prevent another database access thread from being created to meet processing demand, as long as the value of the MAXDBAT subsystem parameter has not been reached.

ACTIVE mode
When the value CMTSTAT subsystem parameter is ACTIVE, a database access thread is always active from initial creation to termination.
Tip: You can also monitor and control threads for specific remote applications by using profile tables. For more information, see: