System Monitor Guide and Reference

db2MonitorSwitches - Get/Update Monitor Switches

Selectively turns on or off switches for groups of monitor data to be collected by the database manager. Returns the current state of these switches for the application issuing the call.

Scope

This API only returns information for the node on which it is executed.

Authorization

One of the following:

Required Connection

Instance. If there is no instance attachment, a default instance attachment is created.

To display the settings for a remote instance (or a different local instance), it is necessary to first attach to that instance.

Version

db2ApiDf.h

C API Syntax

int db2MonitorSwitches (db2Uint32 version,
                             void* pParamStruct,
                             struct sqlca* sqlca);
 
typedef struct
{
        struct sqlm_recording_group     *piGroupStates;
        void                            *poBuffer; 
        db2Uint32                       iBufferSize;
        db2Uint32                       iReturnData;
        db2Uint32                       iVersion;
        db2int32                        iNodeNumber;
        db2Uint32                       *poOutputFormat;
}db2MonitorSwitchesData;

API Parameters

version
Input. Specifies the version and release level of the structure passed as the second parameter pParamStruct.

pParamStruct
Input. A pointer to the db2MonitorSwitchesStruct structure.

sqlca
Output. A pointer to the sqlca structure.

piGroupStates
Input. A pointer to the structure containing a list of switches.

poBuffer
A pointer to a buffer where the switch state data will be written.

iBufferSize
Input. Specifies the size of the output buffer.

iReturnData
Input. A flag specifying whether or not the current switch states should be written to the data buffer pointed to by poBuffer.

iVersion
Input. Version ID of the database monitor data to collect. The database monitor only returns data that was available for the requested version. Set this parameter to one of the following symbolic constants:

Note:If SQLM_DBMON_VERSION1 is specified as the version, the APIs cannot be run remotely.

iNodeNumber
Input. The node where the request is to be sent. Based on this value, the request will be processed for the current node, all nodes or a user specified node. Valid values are:

Note:For standalone instances SQLM_CURRENT_NODE must be used.

poOutputFormat
The format of the stream returned by the server. It will be one of the following:

SQLM_STREAM_STATIC_FORMAT
Indicates that the switch states are returned in static, pre-Version 7 switch structures.

SQLM_STREAM_DYNAMIC_FORMAT
Indicates that the switches are returned in a self-describing format, similar to the format returned for db2GetSnapshot.
Note:For detailed information about the use of the database monitor APIs, and for a summary of all database monitor data elements and monitoring groups, see the System Monitor Guide and Reference.

Usage Notes

To obtain the status of the switches at the database manager level, call db2GetSnapshot - Get Snapshot, specifying SQMA_DB2 for OBJ_TYPE (get snapshot for database manager).

For detailed information about the use of the database monitor APIs, and for a summary of all database monitor data elements and monitoring groups, see the System Monitor Guide and Reference.

See Also

db2GetSnapshot - Get Snapshot

db2GetSnapshotSize - Estimate Size Required for db2GetSnapshot() Output Buffer

db2ResetMonitor - Reset Monitor.


[ Top of Page | Previous Page | Next Page ]