Sets the maximum run time degree of intra-partition parallelism for SQL statements for specified active applications. It has no effect on CREATE INDEX parallelism.
Scope
This API affects all nodes that are listed in the $HOME/sqllib/db2nodes.cfg file.
Authorization
One of the following:
Required Connection
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.
Version
sqlenv.h
C API Syntax
/* File: sqlenv.h */ /* API: Set Runtime Degree */ /* ... */ SQL_API_RC SQL_API_FN sqlesdeg ( sqlint32 NumAgentIds, sqluint32 * pAgentIds, sqlint32 Degree, struct sqlca * pSqlca); /* ... */ |
Generic API Syntax
/* File: sqlenv.h */ /* API: Set Runtime Degree */ /* ... */ SQL_API_RC SQL_API_FN sqlgsdeg ( struct sqlca * pSqlca, sqlint32 Degree, sqluint32 * pAgentIds, sqlint32 NumAgentIds); /* ... */ |
API Parameters
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.
REXX API Syntax
This API can be called from REXX through the SQLDB2 interface. See How the API Descriptions are Organized, or the Application Development Guide. For a description of the syntax, see the Command Reference.
Sample Programs
Usage Notes
The database system monitor functions are used to gather the agent IDs and degrees of active applications. For more information, see the System Monitor Guide and Reference.
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 instance, 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.
See Also
db2GetSnapshot - Get Snapshot.