DB2 Version 9.7 for Linux, UNIX, and Windows

MON_FORMAT_XML_METRICS_BY_ROW - Get formatted row-based output for all metrics

The MON_FORMAT_XML_METRICS_BY_ROW table function returns formatted row-based output for all metrics contained in an XML metrics document.

Note: If your database was created in Version 9.7 before Fix Pack 1, to run this routine you must have already run the db2updv97 command. If your database was created before Version 9.7, it is not necessary to run the db2updv97 command (because the catalog update is automatically taken care of by the database migration). If you downgrade to Version 9.7, this routine will no longer work.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-MON_FORMAT_XML_METRICS_BY_ROW--(--xmldoc--)-----------------><

The schema is SYSPROC.

Table function parameters

xmldoc
An input argument of type BLOB(8M) that contains an XML document with either a system_metrics or activity_metrics element. XML documents with these elements can be obtained from the following sources:
  • Returned by one of the MON_GET_*_DETAILS table functions.
  • From the metrics column output by statistics and activity event monitors.
  • From the formatted output of the unit of work, or package cache event monitors.

Authorization

EXECUTE privilege on the MON_FORMAT_XML_METRICS_BY_ROW function.

Example

This example shows how to call the MON_FORMAT_XML_METRICS _BY_ROW table function to return row-based formatted information from the XML document produced by the MON_GET_WORKLOAD_DETAILS table function.

SELECT SUBSTR(TFXML.WORKLOAD_NAME, 1, 13) AS WORKLOAD_NAME,
       SUBSTR(METRICS.METRIC_NAME, 1, 25) AS METRIC_NAME,
       METRICS.VALUE
   FROM 
     TABLE( MON_GET_WORKLOAD_DETAILS( NULL, -2 ) ) AS TFXML,
     TABLE( MON_FORMAT_XML_METRICS_BY_ROW( TFXML.DETAILS )) AS METRICS 
ORDER BY METRICS.VALUE DESC

The following example is a partial listing of the output of this query.

WORKLOAD_NAME METRIC_NAME               VALUE
------------- ------------------------- ---------------
PAYROLL       ACT_COMPLETED_TOTAL                    15
FINANCE       ACT_COMPLETED_TOTAL                    12
PAYROLL       LOCK_WAITS                              8
FINANCE       LOCK_WAITS                              5
FINANCE       DEADLOCKS                               3
PAYROLL       DEADLOCKS                               0

Information returned

Table 1. Information returned for MON_FORMAT_XML_METRICS_BY_ROW
Column Name Data Type Description
METRIC_NAME VARCHAR(128) The unique identifier for the total time metric value.
VALUE BIGINT The current value of the metric.
XML documents that contain an element of type system_metrics are generated from the following interfaces:
  • MON_GET_CONNECTION_DETAILS
  • MON_GET_SERVICE_SUBCLASS_DETAILS
  • MON_GET_UNIT_OF_WORK_DETAILS
  • MON_GET_WORKLOAD_DETAILS
  • DETAILS_XML column from a STATISTICS event monitor
  • METRICS column produced by EVMON_FORMAT_UE_TO_TABLES for the UNIT OF WORK event monitor
  • XMLREPORT column of EVMON_FORMAT_UE_TO_XML for the UNIT OF WORK event monitor
See Table 2 for the types of metrics that are returned from the XML document in this case:
Table 2. Metric names returned by MON_FORMAT_XML_METRICS_BY_ROW for XML documents containing a system_metrics element type
Metric Name Description of metric or Monitor element
TOTAL_WAIT_TIME total_wait_time - Total wait time
CLIENT_IDLE_WAIT_TIME client_idle_wait_time - Client idle wait time
POOL_READ_TIME pool_read_time - Total buffer pool physical read time
POOL_WRITE_TIME pool_write_time - Total buffer pool physical write time
DIRECT_READ_TIME direct_read_time - Direct read time
DIRECT_WRITE_TIME direct_write_time - Direct write time
LOCK_WAIT_TIME lock_wait_time - Time waited on locks
AGENT_WAIT_TIME agent_wait_time - Agent wait time
WLM_QUEUE_TIME_TOTAL wlm_queue_time_total - Workload manager total queue time
FCM_SEND_WAIT_TIME fcm_send_wait_time - FCM send wait time
FCM_RECV_WAIT_TIME fcm_recv_wait_time - FCM recv wait time
TCPIP_SEND_WAIT_TIME tcpip_send_wait_time - TCP/IP send wait time
TCPIP_RECV_WAIT_TIME tcpip_recv_wait_time - TCP/IP recv wait time
IPC_SEND_WAIT_TIME ipc_send_wait_time - Interprocess communication send wait time
IPC_RECV_WAIT_TIME ipc_recv_wait_time - Interprocess communication recv wait time
LOG_BUFFER_WAIT_TIME log_buffer_wait_time - Log buffer wait time
LOG_DISK_WAIT_TIME log_disk_wait_time - Log disk wait time
FCM_MESSAGE_SEND_WAIT_TIME fcm_message_send_wait_time - FCM message send wait time
FCM_MESSAGE_RECV_WAIT_TIME fcm_message_recv_wait_time - FCM message recv wait time
FCM_TQ_SEND_WAIT_TIME fcm_tq_send_wait_time - FCM tablequeue send wait time
FCM_TQ_RECV_WAIT_TIME fcm_tq_recv_wait_time - FCM tablequeue recv wait time
AUDIT_FILE_WRITE_WAIT_TIME audit_file_write_wait_time - Audit file write wait time
AUDIT_SUBSYSTEM_WAIT_TIME audit_subsystem_wait_time - Audit subsystem wait time
DIAGLOG_WRITE_WAIT_TIME diaglog_write_wait_time - Diag log write time
TOTAL_RQST_TIME total_rqst_time - Total request time
TOTAL_COMPILE_TIME total_compile_time - Total compile time
TOTAL_IMPLICIT_COMPILE_TIME total_implicit_compile_time - Total implicit compile time
TOTAL_SECTION_TIME total_section_time - Total section time
TOTAL_COMMIT_TIME total_commit_time - Total commit time
TOTAL_ROLLBACK_TIME total_rollback_time - Total rollback time
TOTAL_RUNSTATS_TIME total_runstats_time - Total runtime statistics
TOTAL_REORG_TIME total_reorg_time - Total reorganization time
TOTAL_LOAD_TIME total_load_time - Total load time
TOTAL_SECTION_SORT_TIME total_section_sort_time - Total section sort time
TOTAL_ROUTINE_USER_CODE_TIME total_routine_user_code_time - Total routine user code time
TOTAL_COMPILE_PROC_TIME total_compile_proc_time - Total compile processing time

TOTAL_IMPLICIT_
  COMPILE_PROC_TIME

total_implicit_compile_proc_time - Total implicit compile processing time
TOTAL_SECTION_PROC_TIME total_section_proc_time - Total section processing time
TOTAL_COMMIT_PROC_TIME total_commit_proc_time - Total commits processing time
TOTAL_ROLLBACK_PROC_TIME total_rollback_proc_time - Total rollback processing time
TOTAL_RUNSTATS_PROC_TIME total_runstats_proc_time - Total runtime statistics processing time
TOTAL_REORG_PROC_TIME total_reorg_proc_time - Total reorganization processing time
TOTAL_LOAD_PROC_TIME total_load_proc_time - Total load processing time
TOTAL_SECTION_SORT_PROC_TIME total_section_sort_proc_time - Total section sort processing time

TOTAL_ROUTINE_USER_CODE_
PROC_TIME

total_routine_user_code_proc_time - Total routine user code processing time
ACT_ABORTED_TOTAL act_aborted_total - Total aborted activities
ACT_COMPLETED_TOTAL act_completed_total - Total completed activities
ACT_REJECTED_TOTAL act_rejected_total - Total rejected activities
AGENT_WAITS_TOTAL agent_waits_total - Total agent waits
POOL_DATA_L_READS pool_data_l_reads - Buffer pool data logical reads
POOL_INDEX_L_READS pool_index_l_reads - Buffer pool index logical reads
POOL_TEMP_DATA_L_READS pool_temp_data_l_reads - Buffer pool temporary data logical reads
POOL_TEMP_INDEX_L_READS pool_temp_index_l_reads - Buffer pool temporary index logical reads
POOL_TEMP_XDA_L_READS pool_temp_xda_l_reads - Buffer pool temporary XDA data logical reads
POOL_XDA_L_READS pool_xda_l_reads - Buffer pool XDA data logical reads
POOL_DATA_P_READS pool_data_p_reads - Buffer pool data physical reads
POOL_INDEX_P_READS pool_index_p_reads - Buffer pool index physical reads
POOL_TEMP_DATA_P_READS pool_temp_data_p_reads - Buffer pool temporary data physical reads
POOL_TEMP_INDEX_P_READS pool_temp_index_p_reads - Buffer pool temporary index physical reads
POOL_TEMP_XDA_P_READS pool_temp_xda_p_reads - Buffer pool temporary XDA data physical reads
POOL_XDA_P_READS pool_xda_p_reads - Buffer pool XDA data physical reads
POOL_DATA_WRITES pool_data_writes - Buffer pool data writes
POOL_INDEX_WRITES pool_index_writes - Buffer pool index writes
POOL_XDA_WRITES pool_xda_writes - Buffer pool XDA data writes
DEADLOCKS deadlocks - Deadlocks detected
DIRECT_READS direct_reads - Direct reads from database
DIRECT_WRITES direct_writes - Direct writes to database
DIRECT_READ_REQS direct_read_reqs - Direct read requests
DIRECT_WRITE_REQS direct_write_reqs - Direct write requests
FCM_RECV_VOLUME fcm_recv_volume - FCM recv volume
FCM_RECVS_TOTAL fcm_recvs_total - FCM recvs total
FCM_SEND_VOLUME fcm_send_volume - FCM send volume
FCM_SENDS_TOTAL fcm_sends_total - FCM sends total
IPC_RECV_VOLUME ipc_recv_volume - Interprocess communication recv volume
IPC_RECVS_TOTAL ipc_recvs_total - Interprocess communication recvs total
IPC_SEND_VOLUME ipc_send_volume - Interprocess communication send volume
IPC_SENDS_TOTAL ipc_sends_total - Interprocess communication send total
LOCK_ESCALS lock_escals - Number of lock escalations
LOCK_TIMEOUTS lock_timeouts - Number of lock timeouts
LOCK_WAITS lock_waits - Lock waits
NUM_LOG_BUFFER_FULL num_log_buffer_full - Number of full log buffers
LOG_DISK_WAITS_TOTAL log_disk_waits_total - Log disk waits total
RQSTS_COMPLETED_TOTAL rqsts_completed_total - Total requests completed
ROWS_MODIFIED rows_modified - Rows modified
ROWS_READ rows_read - Rows read
ROWS_RETURNED rows_returned - Rows returned
TCPIP_RECV_VOLUME tcpip_recv_volume - TCP/IP received volume
TCPIP_SEND_VOLUME tcpip_send_volume - TCP/IP send volume
TCPIP_RECVS_TOTAL tcpip_recvs_total - TCP/IP recvs total
TCPIP_SENDS_TOTAL tcpip_sends_total - TCP/IP sends total
WLM_QUEUE_ASSIGNMENTS_TOTAL wlm_queue_assignments_total - Workload manager total queue assignments
APP_RQSTS_COMPLETED_TOTAL app_rqsts_completed_total - Total application requests completed
TOTAL_SECTION_SORTS total_section_sorts - Total section sorts
TOTAL_SORTS total_sorts - Total Sorts
POST_THRESHOLD_SORTS post_threshold_sorts - Post threshold sorts
POST_SHRTHRESHOLD_SORTS post_shrthreshold_sorts - Post shared threshold sorts
SORT_OVERFLOWS sort_overflows - Sort overflows
ACT_RQSTS_TOTAL act_rqsts_total - Total activity requests
TOTAL_ROUTINE_INVOCATIONS total_routine_invocations - Total routine invocations
TOTAL_COMPILATIONS total_compilations - Total compilations
TOTAL_IMPLICIT_COMPILATIONS total_implicit_compilations - Total implicit complications
TOTAL_APP_SECTION_EXECUTIONS total_app_section_executions - Total section executions
TOTAL_APP_COMMITS total_app_commits - Total application commits
INT_COMMITS int_commits - Internal commits
TOTAL_APP_ROLLBACKS

total_app_rollbacks - Total application rollbacks

INT_ROLLBACKS

int_rollbacks - Internal rollbacks

TOTAL_RUNSTATS total_runstats - Total runtime statistics
TOTAL_REORGS total_reorgs - Total reorganizations
TOTAL_LOADS total_loads - Total loads
CAT_CACHE_INSERTS cat_cache_inserts - Catalog cache inserts
CAT_CACHE_LOOKUPS cat_cache_lookups - Catalog cache lookups
PKG_CACHE_INSERTS pkg_cache_inserts - Package cache inserts
PKG_CACHE_LOOKUPS pkg_cache_lookups - Package cache lookups
THRESH_VIOLATIONS thresh_violations - Number of threshold violations
NUM_LW_THRESH_EXCEEDED num_lw_thresh_exceeded - Number of thresholds exceeded
AUDIT_EVENTS_TOTAL audit_events_total - Total audit events
AUDIT_SUBSYSTEM_WAITS_TOTAL audit_subsystem_waits_total - Total audit subsystem waits
AUDIT_FILE_WRITES_TOTAL audit_file_writes_total - Total Audit files written
DIAGLOG_WRITES_TOTAL diaglog_writes_total - Diag log total writes
FCM_MESSAGE_RECV_VOLUME fcm_message_recv_volume - FCM message recv volume
FCM_MESSAGE_RECVS_TOTAL fcm_message_recvs_total - FCM message recvs total
FCM_MESSAGE_SEND_VOLUME fcm_message_send_volume - FCM message send volume
FCM_MESSAGE_SENDS_TOTAL fcm_message_sends_total - FCM message sends total
FCM_TQ_RECV_VOLUME fcm_tq_recv_volume - FCM tablequeue recv volume
FCM_TQ_RECVS_TOTAL fcm_tq_recvs_total - FCM tablequeue recvs total
FCM_TQ_SEND_VOLUME fcm_tq_send_volume - FCM tablequeue send volume
FCM_TQ_SENDS_TOTAL fcm_tq_sends_total - FCM tablequeue send total
TQ_TOT_SEND_SPILLS tq_tot_send_spills - Total number of table queue buffers overflowed
TOTAL_ROUTINE_TIME total_routine_time - Total routine time
TOTAL_CPU_TIME total_cpu_time - Total CPU time
TOTAL_ACT_TIME total_act_time - Total activity time
TOTAL_ACT_WAIT_TIME total_act_wait_time - Total activity wait time
TOTAL_APP_RQST_TIME total_app_rqst_time - Total application request time
IDA_SEND_WAIT_TIME ida_send_wait_time - Time spent waiting to send data
IDA_SENDS_TOTAL ida_sends_total - Number of times data sent
IDA_SEND_VOLUME ida_send_volume - Total data volume sent
IDA_RECV_VOLUME ida_recv_volume - Total data volume received
IDA_RECV_WAIT_TIME ida_recv_wait_time - Time spent waiting to receive data
IDA_RECVS_TOTAL ida_recvs_total - Number of times data received
XML documents that contain an element of type activity_metrics are generated from the following interfaces:
  • MON_GET_ACTIVITY_DETAILS
  • MON_GET_PKG_CACHE_STMT_DETAILS
  • DETAILS_XML column from an ACTIVITY event monitor
  • METRICS column produced by EVMON_FORMAT_UE_TO_TABLES for the PACKAGE CACHE event monitor
  • XMLREPORT column of EVMON_FORMAT_UE_TO_XML for the PACKAGE CACHE event monitor
See Table 3 for the types of metrics that are returned from the XML document in this case:
Table 3. Metric names returned by MON_FORMAT_XML_METRICS_BY_ROW for XML documents containing an activity_metrics element type
Metric Name Description or Monitor element
TOTAL_ACT_WAIT_TIME total_act_wait_time - Total activity wait time
POOL_READ_TIME pool_read_time - Total buffer pool physical read time
POOL_WRITE_TIME pool_write_time - Total buffer pool physical write time
DIRECT_READ_TIME direct_read_time - Direct read time
DIRECT_WRITE_TIME direct_write_time - Direct write time
WLM_QUEUE_TIME_TOTAL wlm_queue_time_total - Workload manager total queue time
LOCK_WAIT_TIME lock_wait_time - Time waited on locks
LOG_BUFFER_WAIT_TIME log_buffer_wait_time - Log buffer wait time
LOG_DISK_WAIT_TIME log_disk_wait_time - Log disk wait time
AUDIT_FILE_WRITE_WAIT_TIME audit_file_write_wait_time - Audit file write wait time
AUDIT_SUBSYSTEM_WAIT_TIME audit_subsystem_wait_time - Audit subsystem wait time
DIAGLOG_WRITE_WAIT_TIME diaglog_write_wait_time - Diag log write time
FCM_SEND_WAIT_TIME fcm_send_wait_time - FCM send wait time
FCM_RECV_WAIT_TIME fcm_recv_wait_time - FCM recv wait time
FCM_MESSAGE_SEND_WAIT_TIME fcm_message_send_wait_time - FCM message send wait time
FCM_MESSAGE_RECV_WAIT_TIME fcm_message_recv_wait_time - FCM message recv wait time
FCM_TQ_SEND_WAIT_TIME fcm_tq_send_wait_time - FCM tablequeue send wait time
FCM_TQ_RECV_WAIT_TIME fcm_tq_recv_wait_time - FCM tablequeue recv wait time
STMT_EXEC_TIME stmt_exec_time - Statement execution time
TOTAL_ROUTINE_TIME total_routine_time - Total routine time
TOTAL_ROUTINE_NON_SECT_TIME total_routine_non_sect_time - Non-section routine execution time
TOTAL_ROUTINE_USER_CODE_TIME total_routine_user_code_time - Total routine user code time
TOTAL_SECTION_TIME total_section_time - Total section time
TOTAL_SECTION_SORT_TIME total_section_sort_time - Total section sort time

TOTAL_ROUTINE_NON_
  SECT_PROC_TIME

total_routine_non_sect_proc_time - Non-section processing time

TOTAL_ROUTINE_USER_CODE_
PROC_TIME

total_routine_user_code_proc_time - Total routine user code processing time
TOTAL_SECTION_PROC_TIME total_section_proc_time - Total section processing time
TOTAL_SECTION_SORT_PROC_TIME total_section_sort_proc_time - Total section sort processing time
TOTAL_SECTION_SORTS total_section_sorts - Total section sorts
LOCK_ESCALS lock_escals - Number of lock escalations
LOCK_WAITS lock_waits - Lock waits
ROWS_MODIFIED rows_modified - Rows modified
ROWS_READ rows_read - Rows read
ROWS_RETURNED rows_returned - Rows returned
DIRECT_READS direct_reads - Direct reads from database
DIRECT_READ_REQS direct_read_reqs - Direct read requests
DIRECT_WRITES direct_writes - Direct writes to database
DIRECT_WRITE_REQS direct_write_reqs - Direct write requests
POOL_DATA_L_READS pool_data_l_reads - Buffer pool data logical reads
POOL_TEMP_DATA_L_READS pool_temp_data_l_reads - Buffer pool temporary data logical reads
POOL_XDA_L_READS pool_xda_l_reads - Buffer pool XDA data logical reads
POOL_TEMP_XDA_L_READS pool_temp_xda_l_reads - Buffer pool temporary XDA data logical reads
POOL_INDEX_L_READS pool_index_l_reads - Buffer pool index logical reads
POOL_TEMP_INDEX_L_READS pool_temp_index_l_reads - Buffer pool temporary index logical reads
POOL_DATA_P_READS pool_data_p_reads - Buffer pool data physical reads
POOL_TEMP_DATA_P_READS pool_temp_data_p_reads - Buffer pool temporary data physical reads
POOL_TEMP_XDA_P_READS pool_temp_xda_p_reads - Buffer pool temporary XDA data physical reads
POOL_TEMP_INDEX_P_READS pool_temp_index_p_reads - Buffer pool temporary index physical reads
POOL_INDEX_P_READS pool_index_p_reads - Buffer pool index physical reads
POOL_DATA_WRITES pool_data_writes - Buffer pool data writes
POOL_XDA_WRITES pool_xda_writes - Buffer pool XDA data writes
POOL_INDEX_WRITES pool_index_writes - Buffer pool index writes
TOTAL_SORTS total_sorts - Total Sorts
POST_THRESHOLD_SORTS post_threshold_sorts - Post threshold sorts
POST_SHRTHRESHOLD_SORTS post_shrthreshold_sorts - Post shared threshold sorts
SORT_OVERFLOWS sort_overflows - Sort overflows
WLM_QUEUE_ASSIGNMENTS_TOTAL wlm_queue_assignments_total - Workload manager total queue assignments
DEADLOCKS deadlocks - Deadlocks detected
FCM_RECV_VOLUME fcm_recv_volume - FCM recv volume
FCM_RECVS_TOTAL fcm_recvs_total - FCM recvs total
FCM_SEND_VOLUME fcm_send_volume - FCM send volume
FCM_SENDS_TOTAL fcm_sends_total - FCM sends total
LOCK_TIMEOUTS lock_timeouts - Number of lock timeouts
NUM_LOG_BUFFER_FULL num_log_buffer_full - Number of full log buffers
LOG_DISK_WAITS_TOTAL log_disk_waits_total - Log disk waits total
TOTAL_ROUTINE_INVOCATIONS total_routine_invocations - Total routine invocations
AUDIT_EVENTS_TOTAL audit_events_total - Total audit events
AUDIT_SUBSYSTEM_WAITS_TOTAL audit_subsystem_waits_total - Total audit subsystem waits
AUDIT_FILE_WRITES_TOTAL audit_file_writes_total - Total Audit files written
DIAGLOG_WRITES_TOTAL diaglog_writes_total - Diag log total writes
FCM_MESSAGE_RECV_VOLUME fcm_message_recv_volume - FCM message recv volume
FCM_MESSAGE_RECVS_TOTAL fcm_message_recvs_total - FCM message recvs total
FCM_MESSAGE_SEND_VOLUME fcm_message_send_volume - FCM message send volume
FCM_MESSAGE_SENDS_TOTAL fcm_message_sends_total - FCM message sends total
FCM_TQ_RECV_VOLUME fcm_tq_recv_volume - FCM tablequeue recv volume
FCM_TQ_RECVS_TOTAL fcm_tq_recvs_total - FCM tablequeue recvs total
FCM_TQ_SEND_VOLUME fcm_tq_send_volume - FCM tablequeue send volume
FCM_TQ_SENDS_TOTAL fcm_tq_sends_total - FCM tablequeue send total
TQ_TOT_SEND_SPILLS tq_tot_send_spills - Total number of table queue buffers overflowed
THRESH_VIOLATIONS thresh_violations - Number of threshold violations
NUM_LW_THRESH_EXCEEDED num_lw_thresh_exceeded - Number of thresholds exceeded
COORD_STMT-EXEC_TIME coord_stmt_exec_time - Execution time for statement by coordinator agent
TOTAL_ACT_TIME total_act_time - Total activity time
TOTAL_CPU_TIME total_cpu_time - Total CPU time
IDA_SEND_WAIT_TIME ida_send_wait_time - Time spent waiting to send data
IDA_SENDS_TOTAL ida_sends_total - Number of times data sent
IDA_SEND_VOLUME ida_send_volume - Total data volume sent
IDA_RECV_VOLUME ida_recv_volume - Total data volume received
IDA_RECV_WAIT_TIME ida_recv_wait_time - Time spent waiting to receive data
IDA_RECVS_TOTAL ida_recvs_total - Number of times data received