Estimates the buffer size needed by db2GetSnapshot - Get Snapshot.
Scope
This API only affects the instance to which the calling application is attached.
Authorization
One of the following:
Required Connection
Instance. If there is no instance attachment, a default instance attachment is created.
To obtain information from a remote instance (or a different local instance), it is necessary to first attach to that instance. If an attachment does not exist, an implicit instance attachment is made to the node specified by the DB2INSTANCE environment variable.
Version
db2ApiDf.h
C API Syntax
int db2GetSnapshotSize(db2Uint32 version, void* pParamStruct, struct sqlca* sqlca); typedef struct { struct sqlma *piSqlmaData; sqluint32 *poBufferSize; db2Uint32 iVersion; db2int32 iNodeNumber; }db2GetSnapshotSizeData; /* ...*/
API Parameters
Note: | If SQLM_DBMON_VERSION1 is specified as the version, the APIs cannot be run remotely. |
Note: | For stand-alone instances SQLM_CURRENT_NODE must be used. |
Usage Notes
This function generates a significant amount of overhead. Allocating and freeing memory dynamically for each db2GetSnapshot call is also expensive. If calling db2GetSnapshot repeatedly, for example, when sampling data over a period of time, it may be preferable to allocate a buffer of fixed size, rather than call db2GetSnapshotSize.
If the database system monitor finds no active databases or applications, it may return a buffer size of zero (if, for example, lock information related to a database that is not active is requested). Verify that the estimated buffer size returned by this API is non-zero before calling db2GetSnapshot - Get Snapshot. If an error is returned by db2GetSnapshot because of insufficient buffer space to hold the output, call this API again to determine the new size requirements.
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
db2MonitorSwitches - Get/Update Monitor Switches
db2ResetMonitor - Reset Monitor.