IBM Books

System Monitor Guide and Reference

db2ConvMonStream

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

Version

db2ApiDf.h

C API Syntax



/* File: db2ApiDf.h */
/* API: db2ConvMonStream */
/* ... */
int db2ConvMonStream (
  unsigned char version,
  db2ConvMonStreamData * data,
  struct sqlca * pSqlca);
 
typedef struct
{
  void * poTarget;
  sqlm_header_info * piSource;
  db2Uint32 iTargetType;
  db2Uint32 iTargetSize;
  db2Uint32 iSourceType
} db2ConvMonStreamData;
/* ... */
 

API Parameters

version
Input. Specifies the version and release level of the structure passed in as the second parameter, data.

data
Input. A pointer to the db2ConvMonStreamData structure.

pSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see the Administrative API Reference.

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

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

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_SZ 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 convertable 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_subsectiion
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.


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

[ DB2 List of Books | Search the DB2 Books ]