IBM Books

API Reference

sqlmonss - Get Snapshot

Collects database manager monitor information and returns it to a user-allocated data buffer. The information returned represents a snapshot of the database manager operational status at the time the API was called.

Scope

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

Authorization

One of the following:

sysadm
sysctrl
sysmaint

Required Connection

Instance. To obtain a snapshot from a remote instance (or a different local instance), it is necessary to first attach to that instance.

API Include File

sqlmon.h

C API Syntax



/* File: sqlmon.h */
/* API: Get Snapshot */
/* ... */
int SQL_API_FN
  sqlmonss (
    unsigned long   version,
    _SQLOLDCHAR     *reserved,
    sqlma           *sqlma_ptr,
    unsigned long   buffer_length,
    void            *buffer_area,
    sqlm_collected  *collected,
    struct sqlca    *sqlca);
/* ... */

Generic API Syntax



/* File: sqlmon.h */
/* API: Get Snapshot */
/* ... */
int SQL_API_FN
  sqlgmnss (
    unsigned long   reserved_lgth,  
    struct   sqlca  *sqlca,
    sqlm_collected  *collected,
    void            *buffer_area,
    unsigned long   buffer_length,
    sqlma           *sqlma_ptr,
    _SQLOLDCHAR     *reserved,
    unsigned long   version);
/* ... */

API Parameters

reserved_lgth
A 4-byte unsigned integer representing the length of the reserved area.
sqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.
collected
Output. A pointer to the sqlm_collected structure into which the database monitor delivers summary statistics and the number of each type of data structure returned in the buffer area. For more information about this structure, see SQLM-COLLECTED.
buffer_area
Output. Pointer to the user-defined data area into which the snapshot information will be returned. For information about interpreting the data returned in this buffer, see the System Monitor Guide and Reference.
buffer_length
Input. The length of the data buffer. Use sqlmonsz - Estimate Size Required for sqlmonss() Output Buffer to estimate the size of this buffer. If the buffer is not large enough, a warning is returned, along with the information that will fit in the assigned buffer. It may be necessary to resize the buffer and call the API again.
sqlma_ptr
Input. Pointer to the user-allocated sqlma (monitor area) structure. This structure specifies the type(s) of data to be collected. For more information, see SQLMA.
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:

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 SQLM-COLLECTED).
Note:If SQLM_DBMON_VERSION1 is specified as the version, the APIs cannot be run remotely.

Sample Programs

C
\sqllib\samples\c\dbsnap.c

Usage Notes

If an alias for a database residing at a different instance is specified, an error message is returned.

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

sqlmon - Get/Update Monitor Switches


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

[ DB2 List of Books | Search the DB2 Books ]