MON_GET_ROUTINE_DETAILS table function - get aggregated routine execution metrics as an XML document

The MON_GET_ROUTINE_DETAILS table function returns aggregated execution metrics for procedures, external functions, compiled functions, compiled triggers, and anonymous blocks invoked since the database was activated.

The metrics are returned in an XML document.

Authorization

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

Default PUBLIC privilege

None

Syntax

Read syntax diagramSkip visual syntax diagramMON_GET_ROUTINE_DETAILS(routine_type ,routine_schema,routine_module_name,routine_name ,member)

The schema is SYSPROC.

Routine parameters

routine_type
An input parameter of type CHAR(2) that specifies the type of routine or compiled trigger for which data is returned:
  • "P" for a procedure
  • "SP" for the specific name of a procedure
  • "F" for a compiled function
  • "SF" for the specific name of a compiled function
  • "T" for a compiled trigger
  • "C" for an anonymous block
If the "P", "F"', "T", or "C" routine type is specified and no input name is specified, all routines of the given type will be returned. If the routine type is "SP" or "SF", the specific name of the routine must be provided.

All routines of all types will be returned if the routine type is NULL, an empty string, or blanks.

routine_schema
An input parameter of type VARCHAR(128) that specifies the schema for the routine or trigger. For dynamically prepared compound SQL statements and PL/SQL anonymous blocks, the schema can be determined using the MON_GET_SECTION_ROUTINES table function. Use NULL or an empty string to return the routines and triggers in all schemas. This parameter is case sensitive.
routine_module_name
An input parameter of type VARCHAR(128) that specifies the name of the module for the input routine, if applicable. Use NULL or an empty string to return the routines in all modules. This parameter is case sensitive.
routine_name
An input parameter of type VARCHAR(128) that specifies the name of the routine. If the input parameter is "SP" or "SF", the specific name of the routine should be provided. For dynamically prepared compound SQL statements and PL/SQL anonymous blocks, the name can be determined using the MON_GET_SECTION_ROUTINES table function. Use NULL or an empty string to return all routines matching the other input parameters. This parameter is case sensitive.
member
An input parameter of type INTEGER that specifies a valid member 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 implicitly set.

Information returned

Table 1. Information returned for MON_GET_ROUTINE_DETAILS
Column name Data type Description or corresponding monitor element
ROUTINE_TYPE CHAR(1) routine_type - Routine type monitor element
ROUTINE_SCHEMA VARCHAR(128) routine_schema - Routine schema monitor element
ROUTINE_MODULE_NAME VARCHAR(128) routine_module_name - Routine module name monitor element
ROUTINE_NAME VARCHAR(128) routine_name - Routine name monitor element
SPECIFIC_NAME VARCHAR(128) specific_name - Specific name monitor element
DYN_COMPOUND_EXEC_ID VARCHAR(32) FOR BIT DATA dyn_compound_exec_id - Dynamic compound statement executable identifier monitor element
MEMBER SMALLINT member - Database member monitor element
ROUTINE_ID INTEGER routine_id - Routine ID monitor element
SUBROUTINE_ID INTEGER subroutine_id - Subroutine identifier monitor element
LIB_ID BIGINT lib_id - Library identifier monitor element
DETAILS BLOB(1M) XML document that contains the monitor information for the routine. 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_routine xmlns="http://www.ibm.com/xmlns/prod/db2/mon" release="100102000">
   <routine_type>P</routine_type>
   <routine_schema>TEST</routine_schema>
   <routine_module></routine_module>
   <routine_name>PROC1</routine_name>
   ...
   <system_metrics release="100102000">
      <act_aborted_total>5</act_aborted_total>
   </system_metrics>
</db2_routine>
See sqllib/misc/DB2MonRoutines.xsd for the full schema.
Table 2. Detailed metrics returned for MON_GET_ROUTINE_DETAILS
Element name Data type Description or corresponding monitor element
act_aborted_total xs:long act_aborted_total - Total aborted activities
act_completed_total xs:long act_completed_total - Total completed activities
act_rejected_total xs:long act_rejected_total - Total rejected activities
act_rqsts_total xs:long act_rqsts_total - Total activity requests
adm_bypass_act_total xs:long Reserved for future use.
adm_overflows xs:long Reserved for future use.
app_rqsts_completed_total xs:long app_rqsts_completed_total - Total application requests completed
appl_section_inserts xs:nonNegativeInteger appl_section_inserts - Insert count for SQL workspace monitor element
appl_section_lookups xs:nonNegativeInteger appl_section_lookups - SQL workspace access count monitor element
audit_events_total xs:long audit_events_total - Total audit events
audit_file_write_wait_time xs:long audit_file_write_wait_time - Audit file write wait time
audit_file_writes_total xs:long audit_file_writes_total - Total audit files written
audit_subsystem_wait_time xs:long audit_subsystem_wait_time - Audit subsystem wait time
audit_subsystem_waits_total xs:long audit_subsystem_waits_total - Total audit subsystem waits
binds_precompiles xs:long binds_precompiles - Binds/Precompiles Attempted monitor element
call_sql_stmts xs:long call_sql_stmts - CALL SQL statements executed monitor element
cat_cache_inserts xs:long cat_cache_inserts - Catalog cache inserts
cat_cache_lookups xs:long cat_cache_lookups - Catalog cache lookups
cf_wait_time xs:long cf_wait_time - cluster caching facility wait time
cf_waits xs:long cf_waits - Number of cluster caching facility waits
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 buffer exit wait time
comm_exit_waits xs:long comm_exit_waits - Communication buffer exit number of waits
ddl_sql_stmts xs:long ddl_sql_stmts - Data Definition Language (DDL) SQL Statements monitor element
deadlocks xs:long deadlocks - Deadlocks detected
diaglog_write_wait_time xs:long diaglog_write_wait_time - Diagnostic log file write wait time
diaglog_writes_total xs:long diaglog_writes_total - Total diagnostic log file writes
direct_read_reqs xs:long direct_read_reqs - Direct read requests
direct_read_time xs:long direct_read_time - Direct read time
direct_reads xs:long direct_reads - Direct reads from database
direct_write_reqs xs:long direct_write_reqs - Direct write requests
direct_write_time xs:long direct_write_time - Direct write time
direct_writes xs:long direct_writes - Direct writes to database
disabled_peds xs:long disabled_peds - Disabled partial early distincts
dyn_compound_exec_id xs:hexBinary(32) dyn_compound_exec_id - Dynamic compound statement executable identifier monitor element
dynamic_sql_stmts xs:long dynamic_sql_stmts - Dynamic SQL Statements Attempted monitor element
evmon_wait_time xs:long evmon_wait_time - Event monitor wait time
evmon_waits_total xs:long evmon_waits_total - Event monitor total waits
exec_list_cleanup_time xs:dateTime exec_list_cleanup_time - Execution list cleanup time monitor element
exec_list_mem_exceeded xs:string(1) exec_list_mem_exceeded - Execution list memory exceeded monitor element
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
failed_sql_stmts xs:long failed_sql_stmts - Failed Statement Operations monitor element
fcm_message_recv_volume xs:long fcm_message_recv_volume - FCM message received volume
fcm_message_recv_wait_time xs:long fcm_message_recv_wait_time - FCM message received 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:long fcm_message_recvs_total - Total FCM message receives
fcm_message_send_volume xs:long fcm_message_send_volume - FCM message send volume
fcm_message_send_wait_time xs:long 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:long fcm_message_sends_total - Total FCM message sends
fcm_recv_volume xs:long fcm_recv_volume - FCM received volume
fcm_recv_wait_time xs:long fcm_recv_wait_time - FCM received 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:long fcm_recvs_total - FCM receives total
fcm_send_volume xs:long fcm_send_volume - FCM send volume
fcm_send_wait_time xs:long fcm_send_wait_time - FCM send wait time
fcm_sends_total xs:long fcm_sends_total - FCM sends total
fcm_tq_recv_volume xs:long fcm_tq_recv_volume - FCM table queue received volume
fcm_tq_recv_wait_time xs:long fcm_tq_recv_wait_time - FCM table queue received 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:long fcm_tq_recvs_total - FCM table queue receives total
fcm_tq_send_volume xs:long fcm_tq_send_volume - FCM table queue send volume
fcm_tq_send_wait_time xs:long fcm_tq_send_wait_time - FCM table queue send wait time
fcm_tq_sends_total xs:long fcm_tq_sends_total - FCM table queue send totaltime
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:long ida_recv_volume - Total data volume received
ida_recv_wait_time xs:long ida_recv_wait_time - Time spent waiting to receive data
ida_recvs_total xs:long ida_recvs_total - Number of times data received
ida_send_volume xs:long ida_send_volume - Total data volume sent
ida_send_wait_time xs:long ida_send_wait_time - Time spent waiting to send data
ida_sends_total xs:long ida_sends_total - Number of times data sent
implicit_rebinds xs:long implicit_rebinds - number of implicit rebinds monitor element
int_commits xs:long int_commits - Internal commits
int_rollbacks xs:long int_rollbacks - Internal rollbacks
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
lib_id xs:long lib_id - Library identifier monitor element
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
lock_escals xs:long lock_escals - Number of lock escalations
lock_escals_global xs:long lock_escals_global - Number of global lock escalations
lock_escals_locklist xs:long llock_escals_locklist - Number of locklist lock escalations
lock_escals_maxlocks xs:long lock_escals_maxlocks - Number of maxlocks lock escalations
lock_timeouts xs:long lock_timeouts - Number of lock timeouts
lock_timeouts_global xs:long lock_timeouts_global - Lock timeouts global
lock_wait_time xs:long lock_wait_time - Time waited on locks
lock_wait_time_global xs:long lock_wait_time_global - Lock wait time global
lock_waits xs:long lock_waits - Lock waits
lock_waits_global xs:long lock_waits_global - Lock waits global
log_buffer_wait_time xs:long log_buffer_wait_time - Log buffer wait time
log_disk_wait_time xs:long log_disk_wait_time - Log disk wait time
log_disk_waits_total xs:long log_disk_waits_total - Total log disk waits
member xs:short member - Database member monitor element
merge_sql_stmts xs:long merge_sql_stmts - Merge SQL statements executed monitor element
num_log_buffer_full xs:long num_log_buffer_full - Number of times full log buffer caused agents to wait
num_lw_thresh_exceeded xs:long num_lw_thresh_exceeded - Number of lock wait thresholds exceeded
olap_func_overflows xs:long olap_func_overflows - OLAP Function Overflows monitor element
pkg_cache_inserts xs:long pkg_cache_inserts - Package cache inserts
pkg_cache_lookups xs:long pkg_cache_lookups - Package cache lookups
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 monitor element
pool_col_gbp_invalid_pages xs:nonNegativeInteger pool_col_gbp_invalid_pages - Buffer pool column-organized GBP invalid data pages monitor element
pool_col_gbp_l_reads xs:nonNegativeInteger pool_col_gbp_l_reads - Buffer pool column-organized GBP logical reads monitor element
pool_col_gbp_p_reads xs:nonNegativeInteger pool_col_gbp_p_reads - Buffer pool column-organized GBP physical reads monitor element
pool_col_l_reads xs:nonNegativeInteger pool_col_l_reads - Buffer pool column-organized logical reads monitor element
pool_col_lbp_pages_found xs:nonNegativeInteger pool_col_lbp_pages_found - Buffer pool column-organized LBP pages found monitor element
pool_col_p_reads xs:nonNegativeInteger pool_col_p_reads - Buffer pool column-organized physical reads monitor element
pool_col_writes xs:nonNegativeInteger pool_col_writes - Buffer pool column-organized writes monitor element
pool_data_gbp_indep_pages_found_in_lbp xs:long pool_data_gbp_indep_pages_found_in_lbp - Group buffer pool independent data pages found in local buffer pool
pool_data_gbp_invalid_pages xs:long pool_data_gbp_invalid_pages - Group buffer pool invalid data pages
pool_data_gbp_l_reads xs:long pool_data_gbp_l_reads - Group buffer pool data logical reads
pool_data_gbp_p_reads xs:long pool_data_gbp_p_reads - Group buffer pool data physical reads
pool_data_l_reads xs:long 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
pool_data_p_reads xs:long pool_data_p_reads - Buffer pool data physical reads
pool_data_writes xs:long pool_data_writes - Buffer pool data writes
pool_failed_async_col_reqs xs:nonNegativeInteger pool_failed_async_col_reqs - Failed column-organized prefetch requests monitor element
pool_failed_async_data_reqs xs:long pool_failed_async_data_reqs - Failed data prefetch requests
pool_failed_async_index_reqs xs:long pool_failed_async_index_reqs - Failed index prefetch requests
pool_failed_async_other_reqs xs:long pool_failed_async_other_reqs - Failed non-prefetch requestss
pool_failed_async_temp_data_reqs xs:long pool_failed_async_temp_data_reqs - Failed data prefetch requests for temporary table spaces
pool_failed_async_temp_index_reqs xs:long pool_failed_async_temp_index_reqs - Failed index prefetch requests for temporary table spaces
pool_failed_async_temp_xda_reqs xs:long pool_failed_async_temp_xda_reqs - Failed XDA prefetch requests for temporary table spaces
pool_failed_async_xda_reqs xs:long pool_failed_async_xda_reqs - Failed XDA prefetch requests
pool_failed_async_temp_col_reqs xs:nonNegativeInteger pool_failed_async_temp_col_reqs - Failed column-organized temporary prefetch requests monitor element
pool_index_gbp_indep_pages_found_in_lbp xs:long pool_index_gbp_indep_pages_found_in_lbp - Group buffer pool independent index pages found in local buffer pool
pool_index_gbp_invalid_pages xs:long pool_index_gbp_invalid_pages - Group buffer pool invalid index pages
pool_index_gbp_l_reads xs:long pool_index_gbp_l_reads - Group buffer pool index logical reads
pool_index_gbp_p_reads xs:long pool_index_gbp_p_reads - Group buffer pool index physical reads
pool_index_l_reads xs:long 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
pool_index_p_reads xs:long pool_index_p_reads - Buffer pool index physical reads
pool_index_writes xs:long pool_index_writes - Buffer pool index writes
pool_queued_async_col_pages xs:nonNegativeInteger pool_queued_async_col_pages - Column-organized page prefetch requests monitor element
pool_queued_async_col_reqs xs:nonNegativeInteger pool_queued_async_col_reqs - Column-organized prefetch requests monitor element
pool_queued_async_data_pages xs:long pool_queued_async_data_pages - Data pages prefetch requests
pool_queued_async_data_reqs xs:long pool_queued_async_data_reqs - Data prefetch requests
pool_queued_async_index_pages xs:long pool_queued_async_index_pages - Index pages prefetch requests
pool_queued_async_index_reqs xs:long pool_queued_async_index_reqs - Index prefetch requests
pool_queued_async_other_reqs xs:long pool_queued_async_other_reqs - Other requests handled by prefetchers
pool_queued_async_xda_pages xs:long pool_queued_async_xda_pages - XDA pages prefetch requests
pool_queued_async_xda_reqs xs:long pool_queued_async_xda_reqs - XDA prefetch requests
pool_queued_async_temp_data_pages xs:long pool_queued_async_temp_data_pages - Data pages prefetch requests for temporary table spaces
pool_queued_async_temp_data_reqs xs:long pool_queued_async_temp_data_reqs - Data prefetch requests for temporary table spaces
pool_queued_async_temp_index_pages xs:long pool_queued_async_temp_index_pages - Index pages prefetch requests for temporary table spaces
pool_queued_async_temp_index_reqs xs:long pool_queued_async_temp_index_reqs - Index prefetch requests for temporary table spaces
pool_queued_async_temp_xda_pages xs:long pool_queued_async_temp_xda_pages - XDA data pages prefetch requests for temporary table spaces
pool_queued_async_temp_xda_reqs xs:long pool_queued_async_temp_xda_reqs - XDA data prefetch requests for temporary table spaces
pool_queued_async_temp_col_reqs xs:nonNegativeInteger pool_queued_async_temp_col_reqs - Column-organized temporary prefetch requests monitor element
pool_queued_async_temp_col_pages xs:nonNegativeInteger pool_queued_async_temp_col_pages - Column-organized page temporary prefetch requests monitor element
pool_read_time xs:long 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 monitor element
pool_temp_col_p_reads xs:nonNegativeInteger pool_temp_col_p_reads - Buffer pool column-organized temporary physical reads monitor element
pool_temp_data_l_reads xs:long pool_temp_data_l_reads - Buffer pool temporary data logical reads
pool_temp_data_p_reads xs:long pool_temp_data_p_reads - Buffer pool temporary data physical reads
pool_temp_index_l_reads xs:long pool_temp_index_l_reads - Buffer pool temporary index logical reads
pool_temp_index_p_reads xs:long pool_temp_index_p_reads - Buffer pool temporary index physical reads
pool_temp_xda_l_reads xs:long pool_temp_xda_l_reads - Buffer pool temporary XDA data logical reads
pool_temp_xda_p_reads xs:long pool_temp_xda_p_reads - Buffer pool temporary XDA data physical reads
pool_write_time xs:long pool_write_time - Total buffer pool physical write time
pool_xda_gbp_indep_pages_found_in_lbp xs:long pool_xda_gbp_indep_pages_found_in_lbp - Group buffer pool XDA independent pages found in local buffer pool
pool_xda_gbp_invalid_pages xs:long pool_xda_gbp_invalid_pages - Group buffer pool invalid XDA data pages
pool_xda_gbp_l_reads xs:long pool_xda_gbp_l_reads - Group buffer pool XDA data logical read requests
pool_xda_gbp_p_reads xs:long pool_xda_gbp_p_reads - Group buffer pool XDA data physical read requests
pool_xda_l_reads xs:long pool_xda_l_reads - Buffer Pool XDA Data Logical Reads
pool_xda_lbp_pages_found xs:long pool_xda_lbp_pages_found - Local buffer pool XDA data pages found
pool_xda_p_reads xs:long pool_xda_p_reads - Buffer pool XDA data physical reads
pool_xda_writes xs:long 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:long 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
post_threshold_peds xs:long post_threshold_peds - Partial early distincts threshold
post_threshold_sorts xs:long post_threshold_sorts - Post threshold sorts
prefetch_wait_time xs:long prefetch_wait_time - Time waited for prefetch
prefetch_waits xs:long prefetch_waits - Prefetcher wait count
fcm_tq_send_waits_total xs:nonNegativeInteger fcm_tq_send_waits_total - Number of times spent waiting to send the next buffer monitor element
reclaim_wait_time xs:long reclaim_wait_time - Reclaim wait time
routine_id xs:int routine_id - Routine ID monitor element
routine_module_name xs:string(128) routine_module_name - Routine module name monitor element
routine_name xs:string(128) routine_name - Routine name monitor element
routine_schema xs:string(128) routine_schema - Routine schema monitor element
routine_type xs:string(1) routine_type - Routine type monitor element
rows_deleted xs:long rows_deleted - Rows deleted monitor element
rows_inserted xs:long rows_inserted - Rows inserted monitor element
rows_modified xs:long rows_modified - Rows modified
rows_read xs:long rows_read - Rows read
rows_returned xs:long rows_returned - Rows returned
rows_updated xs:long rows_updated - Rows updated monitor element
rqsts_completed_total xs:long rqsts_completed_total - Total requests completed
select_sql_stmts xs:long select_sql_stmts - Select SQL Statements Executed monitor element
sort_overflows xs:long sort_overflows - Sort overflows
spacemappage_reclaim_wait_time xs:long spacemappage_reclaim_wait_time - Space map page reclaim wait time
specific_name xs:string(128) specific_name - Specific name monitor element
static_sql_stmts xs:long static_sql_stmts - Static SQL Statements Attempted monitor element
subroutine_id xs:int subroutine_id - Subroutine identifier monitor element
thresh_violations xs:long thresh_violations - Number of threshold violations
total_act_time xs:long total_act_time - Total activity time
total_act_wait_time xs:long total_act_wait_time - Total activity wait time
total_app_commits xs:long total_app_commits - Total application commits
total_app_rollbacks xs:long total_app_rollbacks - Total application rollbacks
total_app_rqst_time xs:long total_app_rqst_time - Total application request time
total_app_section_executions xs:long total_app_section_executions - Total application section executions
total_backup_proc_time xs:long total_backup_proc_time - Total non-wait time for online backups
total_backup_time xs:long total_backup_time - Total elapsed time for online backups
total_backups xs:long total_backups - Total backups
total_col_executions xs:nonNegativeInteger total_col_executions - Total column-organized executions monitor element
total_col_proc_time xs:nonNegativeInteger total_col_proc_time - Total column-organized processing time monitor element
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 monitor element
total_col_vector_consumers xs:long total_col_vector_consumers - Total columnar_vector consumers
total_commit_proc_time xs:long total_commit_proc_time - Total commits processing time
total_commit_time xs:long total_commit_time - Total commit time
total_compilations xs:long total_compilations - Total compilations
total_compile_proc_time xs:long total_compile_proc_time - Total compile processing time
total_compile_time xs:long total_compile_time - Total compile time
total_cpu_time xs:long total_cpu_time - Total CPU time .
total_disp_run_queue_time xs:long total_disp_run_queue_time - Total dispatcher run queue time
total_extended_latch_waits xs:long ttotal_extended_latch_waits - Total extended latch waits
total_extended_latch_wait_time xs:long total_extended_latch_wait_time - Total extended latch wait time
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_implicit_compilations xs:long total_implicit_compilations - Total implicit complications
total_implicit_compile_proc_time xs:long total_implicit_compile_proc_time - Total implicit compile processing time
total_implicit_compile_time xs:long total_implicit_compile_time - Total implicit compile time
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_load_proc_time xs:long total_load_proc_time - Total load processing time
total_load_time xs:long total_load_time - Total load time
total_loads xs:long total_loads - Total loads
total_nested_invocations xs:long total_nested_invocations - Total nested invocations monitor element
total_olap_funcs xs:long total_olap_funcs - Total OLAP Functions monitor element
total_peas xs:long total_peas - Total partial early aggregations
total_peds xs:long total_peds - Total partial early distincts
total_reorg_proc_time xs:long total_reorg_proc_time - Total reorganization processing time
total_reorg_time xs:long total_reorg_time - Total reorganization time
total_reorgs xs:long total_reorgs - Total reorganizations
total_rollback_proc_time xs:long total_rollback_proc_time - Total rollback processing time
total_rollback_time xs:long total_rollback_time - Total rollback time
total_routine_coord_time xs:long total_routine_coord_time - Total routine coordinator time monitor element
total_routine_invocations xs:long total_routine_invocations - Total routine invocations . The total number of times a routine was invoked by this routine.
total_routine_time xs:long total_routine_time - Total routine time .
total_routine_user_code_time xs:long total_routine_user_code_time - Total routine user code time
total_routine_user_code_proc_time xs:long total_routine_user_code_proc_time - Total routine user code processing time
total_rqst_time xs:long total_rqst_time - Total request time .
total_runstats xs:long total_runstats - Total runtime statistics
total_runstats_proc_time xs:long total_runstats_proc_time - Total runtime statistics processing time
total_runstats_time xs:long total_runstats_time - Total runtime statistics
total_section_proc_time xs:long total_section_proc_time - Total section processing time
total_section_sort_proc_time xs:long total_section_sort_proc_time - Total section sort processing time
total_section_sort_time xs:long total_section_sort_time - Total section sort time
total_section_sorts xs:long total_section_sorts - Total section sorts
total_section_time xs:long total_section_time - Total section time
total_sorts xs:long total_sorts - Total sorts
total_stats_fabrication_proc_time xs:long total_stats_fabrication_proc_time - Total statistics fabrication processing time
total_stats_fabrication_time xs:long total_stats_fabrication_time - Total statistics fabrication time
total_stats_fabrications xs:long total_stats_fabrications - Total statistics fabrications
total_sync_runstats_proc_time xs:long total_sync_runstats_proc_time - Total synchronous RUNSTATS processing time
total_sync_runstats xs:long total_sync_runstats - Total synchronous RUNSTATS activities
total_sync_runstats_time xs:long total_sync_runstats_time - Total synchronous RUNSTATS time
total_times_routine_invoked xs:long total_times_routine_invoked - Total routine invoked occurrences monitor element
total_wait_time xs:long total_wait_time - Total wait time
tq_sort_heap_rejections xs:long tq_sort_heap_rejections - Table queue sort heap rejections
tq_sort_heap_requests xs:long tq_sort_heap_requests - Table queue sort heap requests
tq_tot_send_spills xs:long tq_tot_send_spills - Total number of table queue buffers overflowed
uid_sql_stmts xs:long uid_sql_stmts - Update/Insert/Delete SQL Statements Executed monitor element
wlm_queue_assignments_total xs:long wlm_queue_assignments_total - Workload manager total queue assignments
wlm_queue_time_total xs:long wlm_queue_time_total - Workload manager total queue time
xquery_stmts xs:long xquery_stmts - XQuery Statements Attempted monitor element

Usage notes

Use the MON_GET_ROUTINE_DETAILS table function to identify the most expensive routines on the database server.

This table function returns one row of metrics for each routine or trigger and each member that matches the input arguments. Input argument values are complementary. Metrics returned are aggregates of all executions of the routine on that member. No aggregation across members is performed. However, an aggregation across members is possible through SQL queries (as shown in the Examples section). If a routine executes subroutines, the work done in the subroutines is included in the metrics of the parent routine.

Routine monitoring data collection must be explicitly enabled using the mon_rtn_data database configuration parameter. If this configuration parameter is set to NONE, no information is returned.

The counters and time-spent monitor elements returned by this table function are controlled with the COLLECT REQUEST METRICS clause on service classes and the mon_req_metrics database configuration parameter at the database level. If neither control is enabled, the counters and time-spent monitor elements reported are 0.

When the package for a dynamically prepared compound SQL statement has been removed from the package cache, information for this routine will no longer be reported by MON_GET_ROUTINE_DETAILS function. Similarly, when a routine is dropped, information about the routine is no longer be reported.

Any routines that were not executed during the previous 24 hour period are pruned from memory and not returned.

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

List where time was spent during the processing of the TEST.PROC1 stored procedure, identifying the top 5 areas where time is spent.
   SELECT B.* FROM TABLE(MON_GET_ROUTINE_DETAILS('P','TEST',NULL,'PROC1', -1)) 
     AS A, TABLE(MON_FORMAT_XML_TIMES_BY_ROW(A.DETAILS)) AS B
     ORDER BY TOTAL_TIME_VALUE DESC FETCH FIRST 5 ROWS ONLY
returns
METRIC_NAME                       TOTAL_TIME_VALUE COUNT PARENT_METRIC_NAME
--------------------------------- ---------------- ----- ------------------
TOTAL_RQST_TIME                               1055     0 -
TOTAL_ROUTINE_USER_CODE_PROC_TIME              673     0 TOTAL_RQST_TIME
TOTAL_WAIT_TIME                                317     - TOTAL_RQST_TIME
POOL_READ_TIME                                 236   142 TOTAL_WAIT_TIME
DIRECT_READ_TIME                                81    39 TOTAL_WAIT_TIME

  5 record(s) selected.