IBM Books

System Monitor Guide and Reference

sqlmrset - Reset Monitor

Resets the database system monitor data of a specified database, or of all active databases, for the application issuing the call.

Scope

This API only affects the node on which it is issued.

Authorization

One of the following:

Required Connection

Instance or database:

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

Version

sqlmon.h

C API Syntax



/* File: sqlmon.h */
/* API: Reset Monitor */
/* ... */
int SQL_API_FN
  sqlmrset (
    unsigned long  version,
    _SQLOLDCHAR    *reserved,
    unsigned long  reset_all,
    _SQLOLDCHAR    *db_alias,
    struct sqlca   *sqlca);
/* ... */
 

Generic API Syntax



/* File: sqlmon.h */
/* API: Reset Monitor */
/* ... */
int SQL_API_FN
  sqlgmrst (
    unsigned short  dbnamel,
    unsigned long   reserved_lgth,
    struct   sqlca  *sqlca,
    _SQLOLDCHAR     *db_alias,
    unsigned long   reset_all,
    _SQLOLDCHAR     *reserved,
    unsigned long   version);
/* ... */
 

API Parameters

dbnamel
Input. A 2-byte unsigned integer representing the length in bytes of the database alias.

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

sqlca
Output. A pointer to the sqlca structure.

db_alias
Input. The name that is used to reference the database.

If SQLM_ON is specified for the reset_all parameter, this alias is ignored, and the data areas for all active databases are reset.

reset_all
Input. Indicates whether to reset data areas for a specific database, or for all active databases. Set this parameter to one of the following (defined in sqlmon):

SQLM_OFF
Resets data areas for a specific database.

SQLM_ON
Resets data areas for all active databases.

reserved
Reserved for future use. Must be set 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:

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

Each process (attachment) has its own private view of the monitor data. If one user resets, or turns off a monitor switch, other users are not affected. When an application first calls any database monitor function, it inherits the default switch settings from the database manager configuration file . These settings can be overridden with sqlmon - Get/Update Monitor Switches.

If all active databases are reset, some database manager information is also reset to maintain the consistency of the data that is returned.

This API cannot be used to selectively reset specific data items or specific monitor groups. However, a specific group can be reset by turning its switch off, and then on, using sqlmon - Get/Update Monitor Switches.

See Also

sqlmon - Get/Update Monitor Switches

db2GetSnapshot - Get Snapshot

sqlmonsz - Estimate Size Required for db2GetSnapshot() Output Buffer.


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

[ DB2 List of Books | Search the DB2 Books ]