IBM Books

Administrative API Reference

sqlesdeg - Set Runtime Degree

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 (
    long NumAgentIds,
    unsigned long * pAgentIds,
    long Degree,
    struct sqlca * pSqlca);
/* ... */
 

Generic API Syntax



/* File: sqlenv.h */
/* API: Set Runtime Degree */
/* ... */
SQL_API_RC SQL_API_FN
  sqlgsdeg (
    struct sqlca * pSqlca,
    long Degree,
    unsigned long * pAgentIds,
    long NumAgentIds);
/* ... */
 

API Parameters

pSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.

Degree
Input. The new value for the maximum run time degree of parallelism. The value must be in the range 1 to 32767.

pAgentIds
Input. Pointer to an array of unsigned long integers. Each entry describes the agent ID of the corresponding application. To list the agent IDs of the active applications, use db2GetSnapshot - Get Snapshot.

NumAgentIds
Input. An integer representing the total number of active applications to which the new degree value will apply. This number should be the same as the number of elements in the array of agent IDs.

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

C
\sqllib\samples\c\setrundg.c

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.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]