DB2 10.5 for Linux, UNIX, and Windows

ENV_GET_DB2_SYSTEM_RESOURCES table function - Return DB2 system information

The ENV_GET_DB2_SYSTEM_RESOURCES table function returns CPU usage and DB2® process information for specified members in the current instance.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-ENV_GET_DB2_SYSTEM_RESOURCES--(--member--)------------------><

The schema is SYSPROC.

Table function parameters

member
An input argument 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 database members. If the NULL value is specified, -1 is set implicitly.

Authorization

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

Default PUBLIC privilege

None

Example

SELECT VARCHAR(db2_process_name, 20) AS NAME, CPU_USER, CPU_SYSTEM
  FROM TABLE(ENV_GET_DB2_SYSTEM_RESOURCES(-2))
This query returns the following output:
NAME                           CPU_USER CPU_SYSTEM
------------------------------ -------- ----------
db2fmp                               14          9
db2sysc                           11752        541
db2syscr                             13          8
db2fmp                               24         14

4 record(s) selected.

Information returned

Table 1. Information returned by the ENV_GET_DB2_SYSTEM_RESOURCES table function
Column name Data type Description
MEMBER SMALLINT member - Database member monitor element
DB2_PROCESS_NAME VARCHAR(128) db2_process_name - DB2 process name monitor element
DB2_PROCESS_ID BIGINT db2_process_id - DB2 process ID monitor element
CPU_USER BIGINT cpu_user - Non-kernel processing time monitor element
CPU_SYSTEM BIGINT cpu_system - Kernel time monitor element