Sets the maximum run time degree of intrapartition parallelism for SQL statement execution for specified active applications. It has no effect on CREATE INDEX statement execution parallelism.
This API affects all database partition servers that are listed in the db2nodes.cfg file.
Instance. To change the maximum run time degree of parallelism on a remote server, it is first necessary to attach to that server. If no attachment exists, the SET RUNTIME DEGREE statement fails.
sqlenv.h
SQL_API_RC SQL_API_FN
sqlesdeg (
sqlint32 NumAgentIds,
sqluint32 * pAgentIds,
sqlint32 Degree,
struct sqlca * pSqlca);
SQL_API_RC SQL_API_FN
sqlgsdeg (
struct sqlca * pSqlca,
sqlint32 Degree,
sqluint32 * pAgentIds,
sqlint32 NumAgentIds);
If this parameter is set to SQL_ALL_USERS (defined in sqlenv), the new degree will apply to all active applications. If it is set to zero, an error is returned.
The database system monitor functions are used to gather the agent IDs and degrees of active applications.
Minimal validation is performed on the array of agent IDs. The user must ensure that the pointer points to an array containing the total number of elements specified. If NumAgentIds is set to SQL_ALL_USERS, the array is ignored.
If one or more specified agent IDs cannot be found, the unknown agent IDs are ignored, and the function continues. No error is returned. An agent ID may not be found, for example, if the user signs off between the time an agent ID is collected and the API is called.
Agent IDs are recycled, and are used to change the degree of parallelism for applications some time after being gathered by the database system monitor. When a user signs off, therefore, another user may sign on and acquire the same agent ID through this recycling process, with the result that the new degree of parallelism will be modified for the wrong user.
This API can be called from REXX through the SQLDB2 interface.