DB2 Version 9.7 for Linux, UNIX, and Windows

AM_GET_RPT procedure - Retrieve activity monitor data

The AM_GET_RPT procedure returns activity monitor data for a report.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-AM_GET_RPT--(--partition--,--report_id--,--appl_filter--,---->

>--max_number--)-----------------------------------------------><

The schema is SYSPROC.

Procedure parameters

partition
An input argument of type INTEGER that specifies a database partition number. Valid values are -2 (denoting all database partitions) and the database partition number of any existing database partition.
report_id
An input argument of type INTEGER that specifies a unique report ID.
appl_filter
An input argument of type CLOB(32K) that specifies an application filter. An application filter is a search condition involving any or all of the three columns AGENT_ID, APPL_NAME, and PRIMARY_AUTH_ID, where AGENT_ID and PRIMARY_AUTH_ID are integers, and APPL_NAME is a character string. If the argument is null or an empty string, no filtering is performed.
max_number
An input argument of type INTEGER that specifies the maximum number of applications, statements, or transactions that are to be displayed. If the argument is null, all applications, statements, and transactions will be displayed.

Authorization

  • SYSMON authority
  • EXECUTE privilege on the AM_GET_RPT procedure.

Example

CALL SYSPROC.AM_GET_RPT(-2, 18, 
   CAST('AGENT_ID=29 AND PRIMARY_AUTH_ID <> ''dbuser'' AND APPL_NAME LIKE ''db2%'''
       AS CLOB(32K)), 100)

Usage note

The result set returned is different for each report id. This procedure is intended to support the Activity Monitor graphical tool. To build reports that can be parsed, snapshot administrative SQL routines and views should be used instead. To use this procedure, the DFT_MON_LOCK monitor switch must be turned on.