MON_GET_ACTIVITY_DETAILS table function - Return information about an activity as an XML document

The MON_GET_ACTIVITY_DETAILS table function returns information about an activity, including general activity information (like statement text) and a set of metrics for the activity.

The metrics are returned in an XML document.

Authorization

One of the following authorities is required to execute the routine:
  • EXECUTE privilege on the routine
  • DATAACCESS authority
  • DBADM authority
  • SQLADM authority

Default PUBLIC privilege

None

Syntax

Read syntax diagramSkip visual syntax diagramMON_GET_ACTIVITY_DETAILS(application_handle ,uow_id,activity_id,member)

The schema is SYSPROC.

Routine parameters

application_handle
An input argument of type BIGINT that specifies a valid application handle. If the argument is null, no rows are returned from this function, and an SQL0171N error is returned.
uow_id
An input argument of type INTEGER that specifies a valid unit of work identifier unique within the application. If the argument is null, no rows are returned from this function, and an SQL0171N error is returned.
activity_id
An input argument of type INTEGER that specifies a valid activity ID unique within the unit of work. If the argument is null, no rows are returned from this function, and an SQL0171N error is returned.
member
An input argument of type INTEGER that specifies a valid member number in the same instance as the currently connected database when calling this function. Specify -1 for the current database member, or -2 for all active database members. If the null value is specified, -1 is set implicitly.

Information returned

Table 1. Information returned for MON_GET_ACTIVITY_DETAILS
Column name Data type Description
APPLICATION_HANDLE BIGINT application_handle - Application handle
UOW_ID INTEGER uow_id - Unit of work ID
ACTIVITY_ID INTEGER activity_id - Activity ID
MEMBER SMALLINT member- Database member
DETAILS BLOB(8M) XML document that contains activity details. See Table 2 for a description of the elements in this document.
The following example shows the structure of the XML document that is returned in the DETAILS column.

<db2_activity_details xmlns="http://www.ibm.com/xmlns/prod/db2/mon" release="90700000">
  <member>0</member>
  <application_handle>70</application_handle>
  <activity_id>1</activity_id>
  <activity_state>IDLE</activity_state>
  <activity_type>READ_DML</activity_type>
  <uow_id>1</uow_id>
  ...
  <activity_metrics release="90700000">
    <lock_wait_time>2000</lock_wait_time>
    ...
  </activity_metrics>
</db2_activity_details>
For the full schema, see sqllib/misc/DB2MonRoutines.xsd. This document uses the following XML non-primitive type definitions:
<xs:simpleType name = "executable_id_type" >
  <xs:annotation>
     <xs:documentation>
       The binary Executable ID
     </xs:documentation>
  </xs:annotation>
   <xs:restriction base = "xs:hexBinary" >
      <xs:maxLength value = "32" />
   </xs:restriction>
</xs:simpleType>

Detailed metrics returned

Table 2. Detailed metrics returned for MON_GET_ACTIVITY_DETAILS
Element name Data type Description or corresponding monitor element
active_col_vector_consumers xs:long active_col_vector_consumers - Active columnar_vector consumers
active_col_vector_consumers_top xs:long active_col_vector_consumers_top - Active columnar_vector consumers high watermark
active_hash_grpbys xs:long active_hash_grpbys - Active hash GROUP BY operations monitor element
active_hash_grpbys_top xs:long active_hash_grpbys_top - Active hash Group By operations high watermark
active_hash_joins xs:long active_hash_joins - Active hash joins monitor element
active_hash_joins_top xs:long active_hash_joins_top - Active hash joins operations high watermark
active_olap_funcs xs:long active_olap_funcs - Active OLAP Functions monitor element
active_olap_funcs_top xs:long active_olap_funcs_top - Active OLAP functions operations high watermark
active_peas xs:long active_peas - Active partial early aggregations operations
active_peas_top xs:long active_peas_top - Active partial early aggregations operations high watermark
active_peds xs:long active_peds - Active partial early distinct operations
active_peds_top xs:long active_peds_top - Active partial early distinct operations high watermark
active_sort_consumers xs:long active_sort_consumers - Active sort consumers
active_sort_consumers_top xs:long active_sort_consumers_top - Active sort consumers high watermark
active_sorts xs:long active_sorts - Active Sorts monitor element
active_sorts_top xs:long active_sorts_top - Active Sorts high watermark
activity_id xs:nonNegativeInteger activity_id - Activity ID
activity_state xs:string activity_state - Activity state
activity_type xs:string activity_type - Activity type
activitytotalruntime_threshold_id xs:int activitytotalruntime_threshold_id - Activity total runtime threshold ID monitor element
activitytotalruntime_threshold_value xs:dateTime activitytotalruntime_threshold_value - Activity total runtime threshold value monitor element
activitytotalruntime_threshold_violated xs:short activitytotalruntime_threshold_violated - Activity total runtime threshold violated monitor element
activitytotalruntimeinallsc_threshold_id xs:int activitytotalruntimeinallsc_threshold_id - Activity total runtime in all service classes threshold ID monitor element
activitytotalruntimeinallsc_threshold_value xs:dateTime activitytotalruntimeinallsc_threshold_value - Activity total runtime in all service classes threshold value monitor element
activitytotalruntimeinallsc_threshold_violated xs:short activitytotalruntimeinallsc_threshold_violated - Activity total runtime in all service classes threshold violated monitor element
activitytotaltime_threshold_id xs:int activitytotaltime_threshold_id - Activity total time threshold ID
activitytotaltime_threshold_value xs:dateTime activitytotaltime_threshold_value - Activity total time threshold value
activitytotaltime_threshold_violated xs:short (1 = yes, 0 = no) activitytotaltime_threshold_violated - Activity total time threshold violated
adm_bypassed xs:short Reserved for future use.
adm_bypass_act_total xs:long Reserved for future use.
adm_overflows xs:long Reserved for future use.
agents_top xs:long agents_top - Number of Agents Created monitor element
aggsqltempspace_threshold_id xs:int aggsqltempspace_threshold_id - AggSQL temporary space threshold ID.
aggsqltempspace_threshold_value xs:long aggsqltempspace_threshold_value - AggSQL temporary space threshold value
aggsqltempspace_threshold_violated xs:short (1 = yes, 0 = no) aggsqltempspace_threshold_violated - AggSQL temporary space threshold violated
application_handle xs:nonNegativeInteger application_handle - Application handle
audit_events_total xs:nonNegativeInteger audit_events_total - Total audit events
audit_file_write_wait_time xs:nonNegativeInteger audit_file_write_wait_time - Audit file write wait time
audit_file_writes_total xs:nonNegativeInteger audit_file_writes_total - Total Audit files written
audit_subsystem_wait_time xs:nonNegativeInteger audit_subsystem_wait_time - Audit subsystem wait time
audit_subsystem_waits_total xs:nonNegativeInteger audit_subsystem_waits_total - Total audit subsystem waits
cf_wait_time xs:long cf_wait_time - cluster caching facility wait time monitor element
cf_waits xs:long cf_waits - Number of cluster caching facility waits monitor element
client_acctng xs:string(255) client_acctng - Client accounting string monitor element
client_applname xs:string(255) client_applname - Client application name monitor element
client_userid xs:string(255) client_userid - Client user ID monitor element
client_wrkstnname xs:string(255) client_wrkstnname - Client workstation name monitor element
col_synopsis_rows_inserted xs:nonNegativeInteger col_synopsis_rows_inserted - Column-organized synopsis table rows inserted monitor element
col_vector_consumer_overflows xs:long col_vector_consumer_overflows - Columnar vector consumer overflows monitor element.
comm_exit_wait_time xs:long comm_exit_wait_time - Communication exit wait time monitor element
comm_exit_waits xs:long comm_exit_waits - Communication exit number of waits monitor element
concurrentdbcoordactivities_db_threshold_id xs:int concurrentdbcoordactivities_db_threshold_id - Concurrent database coordinator activities threshold ID
concurrentdbcoordactivities_db_threshold_queued xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_db_threshold_queued - Concurrent database coordinator activities
concurrentdbcoordactivities_db_threshold_value xs:long concurrentdbcoordactivities_db_threshold_value - Concurrent database coordinator activities
concurrentdbcoordactivities_db_threshold_violated xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_db_threshold_violated - Concurrent database coordinator activities threshold violated
concurrentdbcoordactivities_subclass_threshold_id xs:int concurrentdbcoordactivities_subclass_threshold_id - Concurrent database coordinator activities subclass threshold ID
concurrentdbcoordactivities_subclass_threshold_queued xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_subclass_threshold_queued - Concurrent database coordinator activities subclass threshold queued
concurrentdbcoordactivities_subclass_threshold_value xs:long concurrentdbcoordactivities_subclass_threshold_value - Concurrent database coordinator activities subclass threshold value
concurrentdbcoordactivities_subclass_threshold_violated xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_subclass_threshold_violated - Concurrent database coordinator activities subclass threshold violated
concurrentdbcoordactivities_superclass_threshold_id xs:int concurrentdbcoordactivities_superclass_threshold_id - Concurrent database coordinator activities superclass
concurrentdbcoordactivities_superclass_threshold_queued xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_superclass_threshold_queued - Concurrent database coordinator activities superclass threshold queued
concurrentdbcoordactivities_superclass_threshold_value xs:long concurrentdbcoordactivities_superclass_threshold_value - Concurrent database coordinator activities superclass threshold value
concurrentdbcoordactivities_superclass_threshold_violated xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_superclass_threshold_violated - Concurrent database coordinator activities superclass threshold violated
concurrentdbcoordactivities_wl_was_threshold_id xs:int concurrentdbcoordactivities_wl_was_threshold_id - Concurrent database coordinator activities workload work action set threshold ID
concurrentdbcoordactivities_wl_was_threshold_queued xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_wl_was_threshold_queued - Concurrent database coordinator activities workload work action set threshold queued
concurrentdbcoordactivities_wl_was_threshold_value xs:long concurrentdbcoordactivities_wl_was_threshold_value - Concurrent database coordinator activities workload work action set threshold value
concurrentdbcoordactivities_wl_was_threshold_violated xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_wl_was_threshold_violated - Concurrent database coordinator activities workload work action set threshold violated
concurrentdbcoordactivities_work_action_set_threshold_id xs:int concurrentdbcoordactivities_work_action_set_threshold_id - Concurrent database coordinator activities work action set threshold ID
concurrentdbcoordactivities_work_action_set_threshold_queued xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_work_action_set_threshold_queued - Concurrent database coordinator activities work action set threshold queued
concurrentdbcoordactivities_work_action_set_threshold_value xs:long concurrentdbcoordactivities_work_action_set_threshold_value - Concurrent database coordinator activities work action set threshold value
concurrentdbcoordactivities_work_action_set_threshold_violated xs:short (1 = yes, 0 = no) concurrentdbcoordactivities_work_action_set_threshold_violated - Concurrent database coordinator activities work action set threshold violated
concurrentworkloadactivities_threshold_id xs:int concurrentworkloadactivities_threshold_id - Concurrent workload activities threshold ID monitor element
concurrentworkloadactivities_threshold_value xs:long concurrentworkloadactivities_threshold_value - Concurrent workload activities threshold value monitor element
concurrentworkloadactivities_threshold_violated xs:short concurrentworkloadactivities_threshold_violated - Concurrent workload activities threshold violated monitor element
coord_member xs:nonNegativeInteger coord_member - Coordinator member
coord_stmt_exec_time xs:nonNegativeInteger coord_stmt_exec_time - Execution time for statement by coordinator agent
cputime_threshold_id xs:int cputime_threshold_id - CPU time threshold ID
cputime_threshold_value xs:long cputime_threshold_value - CPU time threshold value
cputime_threshold_violated xs:short (1 = yes, 0 = no) cputime_threshold_violated - CPU time threshold violated
cputimeinsc_threshold_id xs:int cputimeinsc_threshold_id - CPU time in service threshold ID
cputimeinsc_threshold_value xs:long cputimeinsc_threshold_value - CPU time in service threshold value
cputimeinsc_threshold_violated xs:short (1 = yes, 0 = no) cputimeinsc_threshold_violated - CPU time in service threshold violated
database_work_action_set_id xs:nonNegativeInteger db_work_action_set_id - Database work action set ID
database_work_class_id xs:nonNegativeInteger db_work_class_id - Database work class ID
datataginsc_threshold_id xs:int datataginsc_threshold_id - Datataginsc in threshold identifier
datataginsc_threshold_value xs:string(32) datataginsc_threshold_value - Datataginsc in threshold value
datataginsc_threshold_violated xs:short (1 = yes, 0 = no) datataginsc_threshold_violated - Datataginsc in threshold violated
datatagnotinsc_threshold_id xs:int datatagnotinsc_threshold_id - Datatagnotinsc not in threshold identifier
datatagnotinsc_threshold_value xs:string(32) datatagnotinsc_threshold_value - Datatagnotinsc not in threshold value
datatagnotinsc_threshold_violated xs:short (1 = yes, 0 = no) datatagnotinsc_threshold_violated - Datatagnotinsc not in threshold violated
deadlocks xs:nonNegativeInteger deadlocks - Deadlocks detected
diaglog_write_wait_time xs:nonNegativeInteger diaglog_write_wait_time - Diag log write time
diaglog_writes_total xs:nonNegativeInteger diaglog_writes_total - Diag log total writes
direct_read_reqs xs:nonNegativeInteger direct_read_reqs - Direct read requests
direct_read_time xs:nonNegativeInteger direct_read_time - Direct read time
direct_reads xs:nonNegativeInteger direct_reads - Direct reads from database
direct_write_reqs xs:nonNegativeInteger direct_write_reqs - Direct write requests
direct_write_time xs:nonNegativeInteger direct_write_time - Direct write time
direct_writes xs:nonNegativeInteger direct_writes - Direct writes to database
disabled_peds xs:long disabled_peds - Disabled partial early distincts monitor element
eff_stmt_text xs:string eff_stmt_text - Effective statement text . The first 1024 characters of the concentrated statement text following any literal replacement done by the statement concentrator. Only present if the statement concentrator is enabled and this statement was altered by the statement concentrator.
effective_isolation xs:string effective_isolation - Effective isolation
effective_lock_timeout xs:integer effective_lock_timeout - Effective lock time-out
effective_query_degree xs:integer effective_query_degree - Effective query degree
entry_time xs:dateTime entry_time - Entry timeThe time that this activity arrived into the system.
estimated_runtime xs:long Reserved for future use.
estimated_sort_consumers_top xs:long Reserved for future use.
estimated_sort_shrheap_top xs:long Reserved for future use.
estimatedsqlcost_threshold_id xs:int estimatedsqlcost_threshold_id - Estimated SQL cost threshold ID
estimatedsqlcost_threshold_value xs:long estimatedsqlcost_threshold_value - Estimated SQL cost threshold value
estimatedsqlcost_threshold_violated xs:short (1 = yes, 0 = no) estimatedsqlcost_threshold_violated - Estimated SQL cost threshold violated
evmon_wait_time xs:nonNegativeInteger evmon_wait_time - Event monitor wait time
evmon_waits_total xs:nonNegativeInteger evmon_waits_total - Event monitor total waits
executable_id executable_id_type executable_id - Executable ID
ext_table_read_volume xs:nonNegativeInteger ext_table_read_volume - Total data read by external table readers monitor element
ext_table_recv_volume xs:nonNegativeInteger ext_table_recv_volume - Total data received from external table readers monitor element
ext_table_recv_wait_time xs:nonNegativeInteger ext_table_recv_wait_time - Total agent wait time for external table readers monitor element
ext_table_recvs_total xs:nonNegativeInteger ext_table_recvs_total - Total row batches received from external table readers monitor element
ext_table_send_volume xs:nonNegativeInteger ext_table_send_volume - Total data sent to external table writers monitor element
ext_table_send_wait_time xs:nonNegativeInteger ext_table_send_wait_time - Total agent wait time for external table writers monitor element
ext_table_sends_total xs:nonNegativeInteger ext_table_sends_total - Total row batches sent to external table writers monitor element
ext_table_write_volume xs:nonNegativeInteger ext_table_write_volume - Total data written by external table writers monitor element
fcm_message_recv_volume xs:nonNegativeInteger fcm_message_recv_volume - FCM message recv volume
fcm_message_recv_wait_time xs:nonNegativeInteger fcm_message_recv_wait_time - FCM message recv wait time
fcm_message_recv_waits_total xs:nonNegativeInteger fcm_message_recv_waits_total - Number of times spent waiting for FCM reply message monitor element
fcm_message_recvs_total xs:nonNegativeInteger fcm_message_recvs_total - FCM message recvs total
fcm_message_send_volume xs:nonNegativeInteger fcm_message_send_volume - FCM message send volume
fcm_message_send_wait_time xs:nonNegativeInteger fcm_message_send_wait_time - FCM message send wait time
fcm_message_send_waits_total xs:nonNegativeInteger fcm_message_send_waits_total - Number of times spent blocking on an FCM message send monitor element
fcm_message_sends_total xs:nonNegativeInteger fcm_message_sends_total - FCM message sends total
fcm_recv_volume xs:nonNegativeInteger fcm_recv_volume - FCM recv volume
fcm_recv_wait_time xs:nonNegativeInteger fcm_recv_wait_time - FCM recv wait time
fcm_recv_waits_total xs:nonNegativeInteger fcm_recv_waits_total - Number of times spent waiting to receive data through FCM monitor element
fcm_recvs_total xs:nonNegativeInteger fcm_recvs_total - FCM recvs total
fcm_send_volume xs:nonNegativeInteger fcm_send_volume - FCM send volume
fcm_send_wait_time xs:nonNegativeInteger fcm_send_wait_time - FCM send wait time
fcm_send_waits_total xs:nonNegativeInteger fcm_send_waits_total - Number of times spent blocking on an FCM send operation monitor element
fcm_sends_total xs:nonNegativeInteger fcm_sends_total - FCM sends total
fcm_tq_recv_volume xs:nonNegativeInteger fcm_tq_recv_volume - FCM tablequeue recv volume
fcm_tq_recv_wait_time xs:nonNegativeInteger fcm_tq_recv_wait_time - FCM tablequeue recv wait time
fcm_tq_recv_waits_total xs:nonNegativeInteger fcm_tq_recv_waits_total - Number of times spent waiting to receive the next buffer monitor element
fcm_tq_recvs_total xs:nonNegativeInteger fcm_tq_recvs_total - FCM tablequeue recvs total
fcm_tq_send_volume xs:nonNegativeInteger fcm_tq_send_volume - FCM tablequeue send volume
fcm_tq_send_wait_time xs:nonNegativeInteger fcm_tq_send_wait_time - FCM tablequeue send wait time
fcm_tq_send_waits_total xs:nonNegativeInteger fcm_tq_send_waits_total - Number of times spent waiting to send the next buffer monitor element
fcm_tq_sends_total xs:nonNegativeInteger fcm_tq_sends_total - FCM tablequeue send total
fed_rows_deleted xs:nonNegativeInteger fed_rows_deleted - Rows deleted by a federation system monitor element
fed_rows_inserted xs:nonNegativeInteger fed_rows_inserted - Rows inserted by a federation system monitor element
fed_rows_read xs:nonNegativeInteger fed_rows_read - Rows read by a federation system monitor element
fed_rows_updated xs:nonNegativeInteger fed_rows_updated - Rows updated by a federation system monitor element
fed_wait_time xs:nonNegativeInteger fed_wait_time - Time spent by a federation server monitor element
fed_waits_total xs:nonNegativeInteger fed_waits_total - Total number of execution times for a federation server monitor element
hash_grpby_overflows xs:long hash_grpby_overflows - Hash group by overflows
hash_join_overflows xs:long hash_join_overflows - Hash Join Overflows monitor element
hash_join_small_overflows xs:long hash_join_small_overflows - Hash Join Small Overflows monitor element
ida_recv_volume xs:nonNegativeInteger ida_recv_volume - Total data volume received monitor element

The total volume of data the database server received from an in-database analytics process. The value is reported in bytes.

ida_recv_wait_time xs:nonNegativeInteger ida_recv_wait_time - Time spent waiting to receive data monitor element

The total amount of time spent waiting to receive data from an in-database analytics process.

ida_recvs_total xs:nonNegativeInteger ida_recvs_total - Number of times data received monitor element

The total number of times data was received from an in-database analytics process.

ida_send_volume xs:nonNegativeInteger ida_send_volume - Total data volume sent monitor element

The total volume of data sent from the database server to an in-database analytics process. The value is reported in bytes.

ida_send_wait_time xs:nonNegativeInteger ida_send_wait_time - Time spent waiting to send data monitor element

The total amount of time spent waiting to send data to an in-database analytics process.

ida_sends_total xs:nonNegativeInteger ida_sends_total - Number of times data sent monitor element

The total number of times data was sent to an in-database analytics process.

int_rows_deleted xs:long int_rows_deleted - Internal Rows Deleted monitor element
int_rows_inserted xs:long int_rows_inserted - Internal Rows Inserted monitor element
int_rows_updated xs:long int_rows_updated - Internal Rows Updated monitor element
intra_parallel_state xs:string intra_parallel_state - Current state of intrapartition parallelism monitor element
invocation_id xs:nonNegativeInteger invocation_id - Invocation ID monitor element
is_system_appl xs:short is_system_appl - Is System Application monitor element
last_reference_time xs:dateTime last_reference_time - Last reference time. Every time a request occurs in this activity, this field is updated.
lob_prefetch_reqs xs:nonNegativeInteger lob_prefetch_reqs - LOB prefetcher request count monitor element
lob_prefetch_wait_time xs:nonNegativeInteger lob_prefetch_wait_time - LOB prefetch wait time monitor element
local_start_time xs:dateTime local_start_time - Local start time.
lock_escals xs:nonNegativeInteger lock_escals - Number of lock escalations
lock_escals_global xs:long lock_escals_global - Number of global lock escalations monitor element
lock_escals_locklist xs:long lock_escals_locklist - Number of locklist lock escalations monitor element
lock_escals_maxlocks xs:long lock_escals_maxlocks - Number of maxlocks lock escalations monitor element
lock_timeouts xs:nonNegativeInteger lock_timeouts - Number of lock timeouts
lock_timeouts_global xs:long lock_timeouts_global - Lock timeouts global monitor element
lock_wait_time xs:nonNegativeInteger lock_wait_time - Time waited on locks
lock_wait_time_global xs:long lock_wait_time_global - Lock wait time global monitor element
lock_waits xs:nonNegativeInteger lock_waits - Lock waits
lock_waits_global xs:long lock_waits_global - Lock waits global monitor element
log_buffer_wait_time xs:nonNegativeInteger log_buffer_wait_time - Log buffer wait time
log_disk_wait_time xs:nonNegativeInteger log_disk_wait_time - Log disk wait time
log_disk_waits_total xs:nonNegativeInteger log_disk_waits_total - Log disk waits total
member xs:nonNegativeInteger member- Database member
nesting_level xs:nonNegativeInteger nesting_level - Nesting level monitor element
num_agents xs:long num_agents - Number of Agents Working on a Statement monitor element
num_log_buffer_full xs:nonNegativeInteger num_log_buffer_full - Number of full log buffers
num_lw_thresh_exceeded xs:nonNegativeInteger num_lw_thresh_exceeded - Number of thresholds exceeded
num_routines xs:int num_routines - Number of routines
olap_func_overflows xs:long olap_func_overflows - OLAP Function Overflows monitor element
package_name xs:string (128) package_name - Package name
package_schema xs:string (128) package_schema - Package schema
package_version_id xs:string (128) package_version_id - Package version
parent_activity_id xs:nonNegativeInteger parent_activity_id - Parent activity ID
parent_uow_id xs:nonNegativeInteger parent_uow_id - Parent unit of work ID
planid xs:long planid - Query plan ID monitor element
pool_col_gbp_indep_pages_found_in_lbp xs:nonNegativeInteger pool_col_gbp_indep_pages_found_in_lbp - Buffer pool column-organized GBP independent pages found in local buffer pool
pool_col_gbp_invalid_pages xs:nonNegativeInteger pool_col_gbp_invalid_pages - Buffer pool column-organized GBP invalid data pages
pool_col_gbp_l_reads xs:nonNegativeInteger pool_col_gbp_l_reads - Buffer pool column-organized GBP logical reads
pool_col_gbp_p_reads xs:nonNegativeInteger pool_col_gbp_p_reads - Buffer pool column-organized GBP physical reads
pool_col_l_reads xs:nonNegativeInteger pool_col_l_reads - Buffer pool column-organized logical reads
pool_col_lbp_pages_found xs:nonNegativeInteger pool_col_lbp_pages_found - Buffer pool column-organized LBP pages found
pool_col_p_reads xs:nonNegativeInteger pool_col_p_reads - Buffer pool column-organized physical reads
pool_col_writes xs:nonNegativeInteger pool_col_writes - Buffer pool column-organized writes
pool_data_gbp_indep_pages_found_in_lbp xs:nonNegativeInteger pool_data_gbp_indep_pages_found_in_lbp - Group buffer pool independent data pages found in local buffer pool monitor element
pool_data_gbp_invalid_pages xs:long pool_data_gbp_invalid_pages - Group buffer pool invalid data pages monitor element
pool_data_gbp_l_reads xs:long pool_data_gbp_l_reads - Group buffer pool data logical reads monitor element
pool_data_gbp_p_reads xs:long pool_data_gbp_p_reads - Group buffer pool data physical reads monitor element
pool_data_l_reads xs:nonNegativeInteger pool_data_l_reads - Buffer pool data logical reads
pool_data_lbp_pages_found xs:long pool_data_lbp_pages_found - Local buffer pool found data pages monitor element
pool_data_p_reads xs:nonNegativeInteger pool_data_p_reads - Buffer pool data physical reads
pool_data_writes xs:nonNegativeInteger pool_data_writes - Buffer pool data writes
pool_failed_async_col_reqs xs:nonNegativeInteger pool_failed_async_col_reqs - Failed column-organized prefetch requests
pool_failed_async_data_reqs xs:nonNegativeInteger pool_failed_async_data_reqs - Failed data prefetch requests monitor element
pool_failed_async_index_reqs xs:nonNegativeInteger pool_failed_async_index_reqs - Failed index prefetch requests monitor element
pool_failed_async_other_reqs xs:nonNegativeInteger pool_failed_async_other_reqs - Failed non-prefetch requests monitor element
pool_failed_async_temp_data_reqs xs:nonNegativeInteger pool_failed_async_temp_data_reqs - Failed data prefetch requests for temporary table spaces monitor element
pool_failed_async_temp_index_reqs xs:nonNegativeInteger pool_failed_async_temp_index_reqs - Failed index prefetch requests for temporary table spaces monitor element
pool_failed_async_temp_xda_reqs xs:nonNegativeInteger pool_failed_async_temp_xda_reqs - Failed XDA prefetch requests for temporary table spaces monitor element
pool_failed_async_temp_col_reqs xs:nonNegativeInteger pool_failed_async_temp_col_reqs - Failed column-organized temporary prefetch requests
pool_failed_async_xda_reqs xs:nonNegativeInteger pool_failed_async_xda_reqs - Failed XDA prefetch requests monitor element
pool_index_gbp_indep_pages_found_in_lbp xs:nonNegativeInteger pool_index_gbp_indep_pages_found_in_lbp - Group buffer pool independent index pages found in local buffer pool monitor element
pool_index_gbp_invalid_pages xs:long pool_index_gbp_invalid_pages - Group buffer pool invalid index pages monitor element
pool_index_gbp_l_reads xs:long pool_index_gbp_l_reads - Group buffer pool index logical reads monitor element
pool_index_gbp_p_reads xs:long pool_index_gbp_p_reads - Group buffer pool index physical reads monitor elements
pool_index_l_reads xs:nonNegativeInteger pool_index_l_reads - Buffer pool index logical reads
pool_index_lbp_pages_found xs:long pool_index_lbp_pages_found - Local buffer pool index pages found monitor element
pool_index_p_reads xs:nonNegativeInteger pool_index_p_reads - Buffer pool index physical reads
pool_index_writes xs:nonNegativeInteger pool_index_writes - Buffer pool index writes
pool_queued_async_col_pages xs:nonNegativeInteger pool_queued_async_col_pages - Column-organized page prefetch requests
pool_queued_async_col_reqs xs:nonNegativeInteger pool_queued_async_col_reqs - Column-organized prefetch requests
pool_queued_async_data_pages xs:nonNegativeInteger pool_queued_async_data_pages - Data pages prefetch requests monitor element
pool_queued_async_data_reqs xs:nonNegativeInteger pool_queued_async_data_reqs - Data prefetch requests monitor element
pool_queued_async_index_pages xs:nonNegativeInteger pool_queued_async_index_pages - Index pages prefetch requests monitor element
pool_queued_async_index_reqs xs:nonNegativeInteger pool_queued_async_index_reqs - Index prefetch requests monitor element
pool_queued_async_temp_col_pages xs:nonNegativeInteger pool_queued_async_temp_col_pages - Column-organized page temporary prefetch requests
pool_queued_async_temp_col_reqs xs:nonNegativeInteger pool_queued_async_temp_col_reqs - Column-organized temporary prefetch requests
pool_queued_async_other_reqs xs:nonNegativeInteger pool_queued_async_other_reqs - Non-prefetch requests monitor element
pool_queued_async_temp_data_pages xs:nonNegativeInteger pool_queued_async_temp_data_pages - Data pages prefetch requests for temporary table spaces monitor element
pool_queued_async_temp_data_reqs xs:nonNegativeInteger pool_queued_async_temp_data_reqs - Data prefetch requests for temporary table spaces monitor element
pool_queued_async_temp_index_pages xs:nonNegativeInteger pool_queued_async_temp_index_pages - Index pages prefetch requests for temporary table spaces monitor element
pool_queued_async_temp_index_reqs xs:nonNegativeInteger pool_queued_async_temp_index_reqs - Index prefetch requests for temporary table spaces monitor element
pool_queued_async_temp_xda_pages xs:nonNegativeInteger pool_queued_async_temp_xda_pages - XDA data pages prefetch requests for temporary table spaces monitor element
pool_queued_async_temp_xda_reqs xs:nonNegativeInteger pool_queued_async_temp_xda_reqs - XDA data prefetch requests for temporary table spaces monitor element
pool_queued_async_xda_pages xs:nonNegativeInteger pool_queued_async_xda_pages - XDA pages prefetch requests
pool_queued_async_xda_reqs xs:nonNegativeInteger pool_queued_async_xda_reqs - XDA prefetch requests monitor element
pool_read_time xs:nonNegativeInteger pool_read_time - Total buffer pool physical read time
pool_temp_col_l_reads xs:nonNegativeInteger pool_temp_col_l_reads - Buffer pool column-organized temporary logical reads
pool_temp_col_p_reads xs:nonNegativeInteger pool_temp_col_p_reads - Buffer pool column-organized temporary physical reads
pool_temp_data_l_reads xs:nonNegativeInteger pool_temp_data_l_reads - Buffer pool temporary data logical reads
pool_temp_data_p_reads xs:nonNegativeInteger pool_temp_data_p_reads - Buffer pool temporary data physical reads
pool_temp_index_l_reads xs:nonNegativeInteger pool_temp_index_l_reads - Buffer pool temporary index logical reads
pool_temp_index_p_reads xs:nonNegativeInteger pool_temp_index_p_reads - Buffer pool temporary index physical reads
pool_temp_xda_l_reads xs:nonNegativeInteger pool_temp_xda_l_reads - Buffer pool temporary XDA data logical reads
pool_temp_xda_p_reads xs:nonNegativeInteger pool_temp_xda_p_reads - Buffer pool temporary XDA data physical reads
pool_write_time xs:nonNegativeInteger pool_write_time - Total buffer pool physical write time
pool_xda_gbp_indep_pages_found_in_lbp xs:nonNegativeInteger pool_xda_gbp_indep_pages_found_in_lbp - Group buffer pool XDA independent pages found in local buffer pool monitor element
pool_xda_gbp_invalid_pages xs:nonNegativeInteger pool_xda_gbp_invalid_pages - Group buffer pool invalid XDA data pages
pool_xda_gbp_l_reads xs:nonNegativeInteger pool_xda_gbp_l_reads - Group buffer pool XDA data logical read requests
pool_xda_gbp_p_reads xs:nonNegativeInteger pool_xda_gbp_p_reads - Group buffer pool XDA data physical read requests
pool_xda_l_reads xs:nonNegativeInteger pool_xda_l_reads - Buffer pool XDA data logical reads
pool_xda_lbp_pages_found xs:nonNegativeInteger pool_xda_lbp_pages_found - Local buffer pool XDA data pages found
pool_xda_p_reads xs:nonNegativeInteger pool_xda_p_reads - Buffer pool XDA data physical reads
pool_xda_writes xs:nonNegativeInteger pool_xda_writes - Buffer pool XDA data writes
post_shrthreshold_hash_joins xs:long post_shrthreshold_hash_joins - Post threshold hash joins monitor element
post_shrthreshold_sorts xs:nonNegativeInteger post_shrthreshold_sorts - Post shared threshold sorts
post_threshold_col_vector_consumers xs:long post_threshold_col_vector_consumers - Post threshold columnar_vector consumers
post_threshold_hash_grpbys xs:long post_threshold_hash_grpbys - Hash group by thresholdpost_threshold_hash_grpbys - Hash group by threshold
post_threshold_hash_joins xs:long post_threshold_hash_joins - Hash Join Threshold monitor element
post_threshold_olap_funcs xs:long post_threshold_olap_funcs - OLAP function threshold monitor element
post_threshold_peas xs:long post_threshold_peas - Partial early aggregation threshold monitor element
post_threshold_peds xs:long post_threshold_peds - Partial early distincts threshold monitor element
post_threshold_sorts xs:nonNegativeInteger post_threshold_sorts - Post threshold sorts
prefetch_wait_time xs:nonNegativeInteger prefetch_wait_time - Time waited for prefetch
prefetch_waits xs:nonNegativeInteger prefetch_waits - Prefetcher wait count monitor element
query_actual_degree xs:int query_actual_degree - Actual runtime degree of intrapartition parallelism monitor element
query_card_estimate xs:long query_card_estimate - Query Number of Rows Estimate monitor element
query_cost_estimate xs:integer query_cost_estimate - Query cost estimate
query_data_tag_list xs:string(32) query_data_tag_list - Query data tag list
reclaim_wait_time xs:long reclaim_wait_time - Reclaim wait time monitor element
routine_id xs:nonNegativeInteger routine_id - Routine ID
rows_deleted xs:long rows_deleted - Rows deleted monitor element
rows_inserted xs:long rows_inserted - Rows inserted monitor element
rows_modified xs:nonNegativeInteger rows_modified - Rows modified
rows_read xs:nonNegativeInteger rows_read - Rows read
rows_returned xs:nonNegativeInteger rows_returned - Rows returned
rows_updated xs:long rows_updated - Rows updated monitor element
section_number xs:integer section_number - Section number
semantic_env_id xs:long semantic_env_id - Query semantic compilation environment ID monitor element
service_class_id xs:integer service_class_id - Service class
service_class_work_class_id xs:nonNegativeInteger service_class_work_class_id - Service class work class ID monitor element monitor element
service_class_work_action_set_id xs:nonNegativeInteger service_class_work_action_set_id - Service class work action set ID monitor element monitor element
sort_consumer_heap_top xs:long sort_consumer_heap_top - Individual private sort heap consumer high watermark
sort_consumer_shrheap_top xs:long sort_consumer_shrheap_top - Individual shared sort heap consumer high watermark
sort_heap_allocated xs:long sort_heap_allocated - Total Sort Heap Allocated monitor element
sort_heap_top xs:long sort_heap_top - Sort private heap high watermark monitor element
sort_overflows xs:nonNegativeInteger sort_overflows - Sort overflows
sort_shrheap_allocated xs:long sort_shrheap_allocated - Sort Share Heap Currently Allocated monitor element
sort_shrheap_top xs:long sort_shrheap_top - Sort share heap high watermark monitor element
spacemappage_reclaim_wait_time xs:long spacemappage_reclaim_wait_time - Space map page reclaim wait time monitor element
sqlrowsread_threshold_id xs:int sqlrowsread_threshold_id - SQL rows read threshold ID monitor element
sqlrowsread_threshold_value xs:long sqlrowsread_threshold_value - SQL rows read threshold value
sqlrowsread_threshold_violated xs:short (1 = yes, 0 = no) sqlrowsread_threshold_violated - SQL rows read threshold violated
sqlrowsreadinsc_threshold_id xs:int sqlrowsreadinsc_threshold_id - SQL rows read in service threshold ID
sqlrowsreadinsc_threshold_value xs:long sqlrowsreadinsc_threshold_value - SQL rows read in service threshold value
sqlrowsreadinsc_threshold_violated xs:short (1 = yes, 0 = no) sqlrowsreadinsc_threshold_violated - SQL rows read in service threshold violated
sqlrowsreturned_threshold_id xs:int sqlrowsreturned_threshold_id - SQL rows read returned threshold ID
sqlrowsreturned_threshold_value xs:long sqlrowsreturned_threshold_value - SQL rows read returned threshold value
sqlrowsreturned_threshold_violated xs:short (1 = yes, 0 = no) sqlrowsreturned_threshold_violated - SQL rows read returned threshold violated
sqltempspace_threshold_id xs:int sqltempspace_threshold_id - SQL temporary space threshold ID
sqltempspace_threshold_value xs:long sqltempspace_threshold_value - SQL temporary space threshold value
sqltempspace_threshold_violated xs:short (1 = yes, 0 = no) sqltempspace_threshold_violated - SQL temporary space threshold violated
stmt_exec_time xs:nonNegativeInteger stmt_exec_time - Statement execution time
stmt_pkg_cache_id xs:nonNegativeInteger stmt_pkgcache_id - Statement package cache identifier
stmt_text xs:string stmt_text - SQL statement text. If the activity is dynamic SQL or it is static SQL for which the statement text is available, this field contains the first 1024 characters of the statement text. Otherwise, it contains an empty string.
stmtid xs:long stmtid - Query statement ID monitor element
stmtno xs:int stmtno - Statement number monitor element
thresh_violations xs:nonNegativeInteger thresh_violations - Number of threshold violations
total_act_time xs:nonNegativeInteger total_act_time - Total activity time
total_act_wait_time xs:nonNegativeInteger total_act_wait_time - Total activity wait time
total_app_section_executions xs:nonNegativeInteger total_app_section_executions - Total section executions
total_col_executions xs:nonNegativeInteger total_col_executions - Total column-organized executions
total_col_proc_time xs:nonNegativeInteger total_col_proc_time - Total column-organized processing time
total_col_synopsis_executions xs:nonNegativeInteger total_col_synopsis_executions - Total column-organized synopsis table executions monitor element
total_col_synopsis_proc_time xs:nonNegativeInteger total_col_synopsis_proc_time - Total column-organized synopsis table processing time monitor element
total_col_synopsis_time xs:nonNegativeInteger total_col_synopsis_time - Total column-organized synopsis table time monitor element
total_col_time xs:nonNegativeInteger total_col_time - Total column-organized time
total_col_vector_consumers xs:long total_col_vector_consumers - Total columnar_vector consumers
total_cpu_time xs:nonNegativeInteger total_cpu_time - Total CPU time
total_disp_run_queue_time xs:long total_disp_run_queue_time - Total dispatcher run queue time monitor element in microseconds
total_extended_latch_wait_time xs:nonNegativeInteger total_extended_latch_wait_time - Total extended latch wait time monitor element
total_extended_latch_waits xs:nonNegativeInteger total_extended_latch_waits - Total extended latch waits monitor element
total_hash_grpbys xs:long total_hash_grpbys - Total hash group by operations
total_hash_joins xs:long total_hash_joins - Total Hash Joins monitor element
total_hash_loops xs:long total_hash_loops - Total Hash Loops monitor element
total_index_build_proc_time xs:long total_index_build_proc_time - Total non-wait time spent building indexes due to index creation
total_index_build_time xs:long total_index_build_time - Total time spent building indexes due to index creation
total_indexes_built xs:long total_indexes_built - Total number of indexes built
total_olap_funcs xs:long total_olap_funcs - Total OLAP Functions monitor element
total_peas xs:long total_peas - Total partial early aggregations monitor element
total_peds xs:long total_peds - Total partial early distincts monitor element
total_routine_invocations xs:nonNegativeInteger total_routine_invocations - Total routine invocations
total_routine_non_sect_proc_time xs:nonNegativeInteger total_routine_non_sect_proc_time - Non-section processing time
total_routine_non_sect_time xs:nonNegativeInteger total_routine_non_sect_time - Non-section routine execution time
total_routine_time xs:nonNegativeInteger total_routine_time - Total routine time
total_routine_user_code_proc_time xs:nonNegativeInteger total_routine_user_code_proc_time - Total routine user code processing time
total_routine_user_code_time xs:nonNegativeInteger total_routine_user_code_time - Total routine user code time
total_section_proc_time xs:nonNegativeInteger total_section_proc_time - Total section processing time
total_section_sort_proc_time xs:nonNegativeInteger total_section_sort_proc_time - Total section sort processing time
total_section_sort_time xs:nonNegativeInteger total_section_sort_time - Total section sort time.
total_section_sorts xs:nonNegativeInteger total_section_sorts - Total section sorts.
total_section_time xs:nonNegativeInteger total_section_time - Total section time
total_sorts xs:nonNegativeInteger total_sorts - Total Sorts
total_sync_runstats xs:nonNegativeInteger total_sync_runstats - Total synchronous RUNSTATS activities monitor element
tq_sort_heap_rejections xs:long tq_sort_heap_rejections - Table queue sort heap rejections monitor element
tq_sort_heap_requests xs:long tq_sort_heap_requests - Table queue sort heap requests monitor element
tq_tot_send_spills xs:nonNegativeInteger tq_tot_send_spills - Total number of tablequeue buffers overflowed
uow_id xs:nonNegativeInteger uow_id - Unit of work ID
utility_id xs:nonNegativeInteger utility_id - Utility ID
utility_invocation_id xs:hexBinary utility_invocation_id - Utility invocation ID monitor element
wl_work_action_set_id xs:nonNegativeInteger wl_work_action_set_id - Workload work action set identifier
wl_work_class_id xs:nonNegativeInteger wl_work_class_id - Workload work class identifier
wlm_queue_assignments_total xs:nonNegativeInteger wlm_queue_assignments_total - Workload manager total queue assignments
wlm_queue_time_total xs:nonNegativeInteger wlm_queue_time_total - Workload manager total queue time

Usage notes

The MON_GET_ACTIVITY_DETAILS function provides maximum flexibility for formatting output because it returns detailed information for a single activity as an XML document. The XML output includes both descriptive information (for example, statement text) and metrics. The output can be parsed directly by an XML parser, or it can be converted to relational format by the XMLTABLE function as shown in the example.

The metrics reported through this function (for example, CPU usage) are rolled up to the activity periodically during the lifetime of the activity. Therefore, the values reported by this table function reflect the current state of the system at the time of the most recent rollup.

Activity metrics are controlled through the COLLECT ACTIVITY METRICS clause on workloads, or the mon_act_metrics database configuration parameter at the database level. Metrics are collected if the connection that submits the activity is associated with a workload or database for which activity metrics are enabled. If activity metrics are not collected for an activity, all metrics are reported as 0.

The MON_GET_ACTIVITY_DETAILS table function returns one row of data for each member on which the activity exists. No aggregation across members is performed for the metrics. However, aggregation can be achieved through SQL queries.

The schema for the XML document that is returned in the DETAILS column is available in the file sqllib/misc/DB2MonRoutines.xsd. Further details can be found in the file sqllib/misc/DB2MonCommon.xsd.

Example

Investigate a long running query to determine if it is spending its time executing or waiting (for example, blocked on locks or I/O).

Note: The following queries can be combined into one statement and are shown in 2 steps for reasons of clarity. Also, if you want to retrieve the complete text, you could use the executable ID to obtain the statement text from the MON_GET_PKG_CACHE_STMT table function.

  1. First use the WLM_GET_WORKLOAD_OCCURRENCE_ACTIVITIES table function to list activities and their start times.
    SELECT application_handle, 
           activity_id, 
           uow_id, 
           local_start_time 
    FROM TABLE(
       WLM_GET_WORKLOAD_OCCURRENCE_ACTIVITIES(
          cast(NULL as bigint), -1)
    ) AS T
    The following is an example of output from this query.
    APPLICATION_HANDLE   ACTIVITY_ID UOW_ID      LOCAL_START_TIME          
    -------------------- ----------- ----------- --------------------------
                       7           1           2 2008-06-10-10.06.55.675668
                      16           1           7 2008-06-10-10.08.38.613610
    
      2 record(s) selected.
    
  2. Then use the MON_GET_ACTIVITY_DETAILS table function to view the percentage of time that the activity has spent waiting.
    SELECT actmetrics.application_handle,
      actmetrics.activity_id,
      actmetrics.uow_id,
      varchar(actmetrics.stmt_text, 50) as stmt_text,
      actmetrics.total_act_time,
      actmetrics.total_act_wait_time,
      CASE WHEN actmetrics.total_act_time > 0
        THEN DEC((
          FLOAT(actmetrics.total_act_wait_time) / 
          FLOAT(actmetrics.total_act_time)) * 100, 5, 2)
        ELSE NULL
      END AS PERCENTAGE_WAIT_TIME 
    FROM TABLE(MON_GET_ACTIVITY_DETAILS(7, 2, 1, -2)) AS ACTDETAILS,
    XMLTABLE (XMLNAMESPACES( DEFAULT 'http://www.ibm.com/xmlns/prod/db2/mon'),
      '$actmetrics/db2_activity_details' 
      PASSING XMLPARSE(DOCUMENT ACTDETAILS.DETAILS) as "actmetrics"
      COLUMNS "APPLICATION_HANDLE" INTEGER PATH 'application_handle', 
        "ACTIVITY_ID" INTEGER PATH 'activity_id',
        "UOW_ID" INTEGER PATH 'uow_id',
        "STMT_TEXT" VARCHAR(1024) PATH 'stmt_text',
        "TOTAL_ACT_TIME" INTEGER PATH 'activity_metrics/total_act_time',
        "TOTAL_ACT_WAIT_TIME" INTEGER PATH 'activity_metrics/total_act_wait_time'
      ) AS ACTMETRICS;
    

    The following is an example of output from this query.

    APPLICATION_HANDLE ACTIVITY_ID UOW_ID      ... 
    ------------------ ----------- ----------- ... 
                     7           1           2 ... 
    
      1 record(s) selected.
    

    Output for query (continued).

    ... STMT_TEXT                                          ... 
    ... -------------------------------------------------- ... 
    ... select * from syscat.tables optimize for 1 row     ... 

    Output for query (continued).

    ... TOTAL_ACT_TIME TOTAL_ACT_WAIT_TIME PERCENTAGE_WAIT_TIME
    ... -------------- ------------------- --------------------
    ...            459                   0                 0.00

Use the MON_GET_ACTIVITY_DETAILS table function to create a query that captures information about all the activities currently running on a system.

  • Example 1: Run the following command using the command line processor (CLP)
    WITH A1 AS 
       (SELECT * FROM TABLE(wlm_get_workload_occurrence_activities(null, -1)) 
        WHERE activity_id > 0 ) 
    SELECT A1.application_handle, 
      A1.activity_id, 
      A1.uow_id, 
      total_act_time, 
      total_act_wait_time, 
      varchar(actmetrics.stmt_text, 50) AS stmt_text FROM A1, 
    TABLE(MON_GET_ACTIVITY_DETAILS(A1.application_handle, A1.uow_id,A1.activity_id, -1)) 
        AS ACTDETAILS, 
    XMLTABLE (XMLNAMESPACES( DEFAULT 'http://www.ibm.com/xmlns/prod/db2/mon'), 
     '$actmetrics/db2_activity_details' 
     PASSING XMLPARSE(DOCUMENT ACTDETAILS.DETAILS) AS "actmetrics" 
     COLUMNS "STMT_TEXT" VARCHAR(1024) PATH 'stmt_text', 
     "TOTAL_ACT_TIME" INTEGER PATH 'activity_metrics/total_act_time', 
     "TOTAL_ACT_WAIT_TIME" INTEGER PATH 'activity_metrics/total_act_wait_time' ) 
     AS ACTMETRICS

    The following is an example of output from this query:

    APP...HANDLE  A..._ID  UOW_ID  T...ACT_TIME  T...WAIT_TIME  
    ------------  -------  ------  ------------  -------------  
    15            1        5       16            5              
    15            1        3       17            5              
    7             1        49      0             0              
    SQL0445W Value "with A1 as (select * from table(wlm_get_workload
    3 record(s) selected with 1 warning messages printed.

    The following sample continues output from this query:

    ... STMT_TEXT
    ... -------------------------------------------------
    ... select name from sysibm.systables
    ... select * from sysibm.systables
    ... with A1 as (select * from table(wlm_get_workload_o
    _occurrence_" has been truncated. SQLSTATE=01004
    
    3 record(s) selected with 1 warning messages printed.