db2ConvMonStream API - Convert the monitor stream to the pre-version 6 format
Converts the new, self-describing
format for a single logical data element (for example,
SQLM_ELM_DB2
) to the corresponding pre-version 6 external monitor structure (for
example, sqlm_db2
).
When upgrading API
calls to use the post-version 5 stream, one must traverse the monitor
data using the new stream format (for example, the user must find
the SQLM_ELM_DB2
element). This portion of the stream
can then be passed into the conversion API to get the associated pre-version
6 data.Authorization
None
Required connection
None
API include file
db2ApiDf.h
API and data structure syntax
SQL_API_RC SQL_API_FN
db2ConvMonStream (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2ConvMonStreamData
{
void *poTarget;
struct sqlm_header_info *piSource;
db2Uint32 iTargetType;
db2Uint32 iTargetSize;
db2Uint32 iSourceType;
} db2ConvMonStreamData;
SQL_API_RC SQL_API_FN
db2gConvMonStream (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
db2ConvMonStream API parameters
- versionNumber
- Input. Specifies the version and release level of the structure passed as the second parameter, pParmStruct.
- pParmStruct
- Input. A pointer to the db2ConvMonStreamData structure.
- pSqlca
- Output. A pointer to the sqlca structure.
db2ConvMonStreamData data structure parameters
- poTarget
- Output. A pointer to the target monitor output structure (for example, sqlm_db2). A list of output types, and their corresponding input types, is given in the following section.
- piSource
- Input. A pointer to the logical data element being converted (for example, SQLM_ELM_DB2). A list of output types, and their corresponding input types, is given in the following section.
- iTargetType
- Input. The type of conversion being performed. Specify the value for the v5 type in sqlmon.h for instance SQLM_DB2_SS.
- iTargetSize
- Input. This parameter can usually be set to the size of the structure pointed to by poTarget; however, for elements that have usually been referenced by an offset value from the end of the structure (for example, statement text in sqlm_stmt), specify a buffer that is large enough to contain the sqlm_stmt statically-sized elements, as well as a statement of the largest size to be extracted; that is, SQL_MAX_STMT_SIZ plus sizeof(sqlm_stmt).
- iSourceType
- Input. The type of source stream. Valid values are SQLM_STREAM_SNAPSHOT (snapshot stream), or SQLM_STREAM_EVMON (event monitor stream).
Usage notes
Following is a list of supported
convertible data elements:
Snapshot variable datastream type | Structure |
---|---|
SQLM_ELM_APPL | sqlm_appl |
SQLM_ELM_APPL_INFO | sqlm_applinfo |
SQLM_ELM_DB2 | sqlm_db2 |
SQLM_ELM_FCM | sqlm_fcm |
SQLM_ELM_FCM_NODE | sqlm_fcm_node |
SQLM_ELM_DBASE | sqlm_dbase |
SQLM_ELM_TABLE_LIST | sqlm_table_header |
SQLM_ELM_TABLE | sqlm_table |
SQLM_ELM_DB_LOCK_LIST | sqlm_dbase_lock |
SQLM_ELM_APPL_LOCK_LIST | sqlm_appl_lock |
SQLM_ELM_LOCK | sqlm_lock |
SQLM_ELM_STMT | sqlm_stmt |
SQLM_ELM_SUBSECTION | sqlm_subsection |
SQLM_ELM_TABLESPACE_LIST | sqlm_tablespace_header |
SQLM_ELM_TABLESPACE | sqlm_tablespace |
SQLM_ELM_ROLLFORWARD | sqlm_rollfwd_info |
SQLM_ELM_BUFFERPOOL | sqlm_bufferpool |
SQLM_ELM_LOCK_WAIT | sqlm_lockwait |
SQLM_ELM_DCS_APPL | sqlm_dcs_appl, sqlm_dcs_applid_info, sqlm_dcs_appl_snap_stats, sqlm_xid, sqlm_tpmon |
SQLM_ELM_DCS_DBASE | sqlm_dcs_dbase |
SQLM_ELM_DCS_APPL_INFO | sqlm_dcs_applid_info |
SQLM_ELM_DCS_STMT | sqlm_dcs_stmt |
SQLM_ELM_COLLECTED | sqlm_collected |
Event monitor variable datastream type | Structure |
---|---|
SQLM_ELM_EVENT_DB | sqlm_db_event |
SQLM_ELM_EVENT_CONN | sqlm_conn_event |
SQLM_ELM_EVENT_TABLE | sqlm_table_event |
SQLM_ELM_EVENT_STMT | sqlm_stmt_event |
SQLM_ELM_EVENT_XACT | sqlm_xaction_event |
SQLM_ELM_EVENT_DEADLOCK | sqlm_deadlock_event |
SQLM_ELM_EVENT_DLCONN | sqlm_dlconn_event |
SQLM_ELM_EVENT_TABLESPACE | sqlm_tablespace_event |
SQLM_ELM_EVENT_DBHEADER | sqlm_dbheader_event |
SQLM_ELM_EVENT_START | sqlm_evmon_start_event |
SQLM_ELM_EVENT_CONNHEADER | sqlm_connheader_event |
SQLM_ELM_EVENT_OVERFLOW | sqlm_overflow_event |
SQLM_ELM_EVENT_BUFFERPOOL | sqlm_bufferpool_event |
SQLM_ELM_EVENT_SUBSECTION | sqlm_subsection_event |
SQLM_ELM_EVENT_LOG_HEADER | sqlm_event_log_header |
The sqlm_rollfwd_ts_info structure is not converted; it only contains a table space name that can be accessed directly from the stream. The sqlm_agent structure is also not converted; it only contains the pid of the agent, which can also be accessed directly from the stream.