IBM Books

System Monitor Guide and Reference

sqlmon - 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 or database:

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

Version

sqlmon.h

C API Syntax



/* File: sqlmon.h */
/* API: Get/Update Monitor Switches */
/* ... */
int SQL_API_FN
  sqlmon (
    unsigned long         version,
    _SQLOLDCHAR           *reserved,
    sqlm_recording_group  group_states[],
    struct sqlca          *sqlca);
/* ... */
 

Generic API Syntax



/* File: sqlmon.h */
/* API: Get/Update Monitor Switches */
/* ... */
int SQL_API_FN
  sqlgmon (
    unsigned long         reserved_lgth,
    struct   sqlca        *sqlca,
    sqlm_recording_group  group_states[],
    _SQLOLDCHAR           *reserved,
    unsigned long         version);
/* ... */
 

API Parameters

reserved_lgth
Reserved for future use. Users should set this value to zero.

sqlca
Output. A pointer to the sqlca structure.

group_states
Input/Output. Pointer to an array of size SQLM_NUM_GROUPS (6). If the array size is less than six, an error message is returned. The user determines which element of the array corresponds to which switch by indexing it to the following symbolic statements (defined in sqlmon.h):

The array contains the following elements:

reserved
Reserved for future use. Users should set this value to NULL.

version
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:

If requesting data for a version higher than the current server, the database monitor only returns data for its level (see the server_version field in the "collected" portion of the datastream.
Note:If SQLM_DBMON_VERSION1 is specified as the version, the APIs cannot be run remotely.

Sample Programs

C
\sqllib\samples\c\db2mon.c

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).

See Also

db2GetSnapshot - Get Snapshot

sqlmonsz - Estimate Size Required for db2GetSnapshot() Output Buffer

sqlmrset - Reset Monitor.


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

[ DB2 List of Books | Search the DB2 Books ]