Types of threads
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.
- 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.