A database instance uses several operating system threads. The database system differentiates between the following types of threads:
· User Kernel Threads (UKTs) process client requests. They are the main consumers of the processor time. A database instance generally has several user kernel threads.
· Special threads provide services for the user kernel threads that are processed asynchronously to the user kernel threads. These include connection requests, reading or writing to data volumes and backups. Special threads execute all tasks that access external resources or that can be blocked.
SQL statements are processed in the user kernel threads in the form of tasks. In general, several tasks share a user kernel thread. The database system controls the sequence in which the tasks run in a user kernel thread, and can therefore avoid conflicts with accesses to resources (see also Task Switching). To distribute tasks optimally to the user kernel threads, the database system performs load balancing.
There are several types of tasks that are responsible for special tasks (see Task Overview). From the user’s point of view, the user tasks are the most important. They process the SQL queries. If a user opens a database session and logs on to the database instance with his or her user name and password, the database system creates a user task for this user.
The user tasks create the main load for the processor. Other tasks and also the special threads consume only little processor time.
To configure the maximum number of processors that are used in parallel, use the MAXCPU general database parameter.
To restrict the maximum number of user tasks that are available, and therefore to restrict the number of concurrent user sessions, use the MAXUSERTASKS general database parameter.
You can use the Database Manager or XCONS database tools to display information about threads and tasks. See Database Manager CLI, Displaying Information on the Database Instance and Utilities, XCONS.
Display all tasks of the HOTELDB database instance as user DBM with the password DBM using the Database Manager CLI:
dbmcli -d HOTELDB -u DBM,DBM show tasks
Display all tasks of the HOTELDB database instance with XCONS:
x_cons HOTELDB show tasks