Privileges for viewing DB2 metrics data
To monitor the DB2 resources, a DB2 user must have specific privileges to view data for some attributes of the DB2 agent. Without these privileges, the DB2 agent dashboard does not show the monitoring data that the agent collects for these attributes.
The following table contains the required privileges for the attributes according to key
performance indicators that are used in the dashboard. Also, the table provides the commands for
granting these privileges to the default user (for Window systems) and to the instance owner user
(for LINUX and AIX systems).
Important: Before you run the commands in the DB2 console
for granting privileges, run the following command to connect to the database: connect to
database_name. For Windows systems, run the commands for the default user (system). For
LINUX and AIX systems, run the commands for the instance owner user, for example,
db2inst1.
Key performance indicator | Privileges required | DB2 command for granting privileges |
---|---|---|
Log used (%) | On the SYSIBMADM.LOG_UTILIZATION administrative view, one of the following
privileges is required:
|
GRANT SELECT ON SYSIBMADM.LOG_UTILIZATION TO USER system |
Transactions per min | On the SYSIBMADM.SNAPDB administrative view, one of the following privileges
is required:
|
GRANT SELECT ON SYSIBMADM.SNAPDB TO USER system |
CPU Usage (ms) | On the SYSPROC.SNAP_GET_APPL administrative view, one of the following
privileges is required:
|
GRANT EXECUTE ON FUNCTION SYSPROC.SNAP_GET_APPL(VARCHAR(),INTEGER) TO USER system |
Usage(%) | EXECUTE privilege on the SYSPROC.MON_GET_TABLESPACE function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TABLESPACE(VARCHAR(),INTEGER) TO USER system |
CPU Usage by instance (Y-axis) (Available in DB2 Version 10, or later) |
Privileges required:
|
Run the following commands:
|
Total memory allocated (Y-axis) | EXECUTE privilege on the SYSPROC.ADMIN_GET_DBP_MEM_USAGE function | GRANT EXECUTE ON FUNCTION SYSPROC.ADMIN_GET_DBP_MEM_USAGE() TO USER system |
Memory used by instance (Y-axis) | EXECUTE privilege on the SYSPROC.ADMIN_GET_DBP_MEM_USAGE function | GRANT EXECUTE ON FUNCTION SYSPROC.ADMIN_GET_DBP_MEM_USAGE() TO USER system |
Logical read per min | EXECUTE privilege on the SYSPROC.MON_GET_BUFFERPOOL function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_BUFFERPOOL(VARCHAR(),INTEGER) TO USER system |
prefetch ratio | On the SYSIBMADM.MON_BP_UTILIZATION administrative view, one of the following
privileges is required:
|
GRANT SELECT ON SYSIBMADM.MON_BP_UTILIZATION TO USER system |
Asynch write ratio | EXECUTE privilege on the SYSPROC.MON_GET_BUFFERPOOL function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_BUFFERPOOL(VARCHAR(),INTEGER) TO USER system |
Longest Waiting Time | EXECUTE privilege on the SYSPROC.MON_GET_PKG_CACHE_STMT function. | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT(CHAR(),VARCHAR(), CLOB(),INTEGER) TO USER system |
Statements | EXECUTE privilege on the SYSPROC.MON_GET_PKG_CACHE_STMT function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT(CHAR(),VARCHAR(), CLOB(),INTEGER) TO USER system |
Type | EXECUTE privilege on the SYSPROC.MON_GET_PKG_CACHE_STMT function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT(CHAR(),VARCHAR(), CLOB(),INTEGER) TO USER system |
Locks Wait | EXECUTE privilege on the SYSPROC.MON_GET_PKG_CACHE_STMT function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT(CHAR(),VARCHAR(), CLOB(),INTEGER) TO USER system |
Active state | EXECUTE privilege on the SYSPROC.MON_GET_PKG_CACHE_STMT function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT(CHAR(),VARCHAR(), CLOB(),INTEGER) TO USER system |
Start time | EXECUTE privilege on the SYSPROC.MON_GET_PKG_CACHE_STMT function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT(CHAR(),VARCHAR(), CLOB(),INTEGER) TO USER system |
Duration | EXECUTE privilege on the SYSPROC.MON_GET_PKG_CACHE_STMT function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT(CHAR(),VARCHAR(), CLOB(),INTEGER) TO USER system |
Execution ID | EXECUTE privilege on the SYSPROC.MON_GET_PKG_CACHE_STMT function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT(CHAR(),VARCHAR(), CLOB(),INTEGER) TO USER system |
Content type | EXECUTE privilege on the SYSPROC.MON_GET_TABLESPACE function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TABLESPACE(VARCHAR(),INTEGER) TO USER system |
AS | EXECUTE privilege on the SYSPROC.MON_GET_TABLESPACE function | GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TABLESPACE(VARCHAR(),INTEGER) TO USER system |
Table Spaces | On the SYSIBMADM.SNAPTAB, SYSIBMADM.ADMINTABINFO and SYSCAT.TABLES
administrative views, one of the following privileges is required:
|
Run the following commands:
|
Data Obj Size | On the SYSIBMADM.SNAPTAB, SYSIBMADM.ADMINTABINFO and SYSCAT.TABLES
administrative views, one of the following privileges is required:
|
Run the following commands:
|
Index Obj Size | On the SYSIBMADM.SNAPTAB, SYSIBMADM.ADMINTABINFO and SYSCAT.TABLES
administrative views, one of the following privileges is required:
|
Run the following commands:
|
XML Obj | On the SYSIBMADM.SNAPTAB, SYSIBMADM.ADMINTABINFO and SYSCAT.TABLES
administrative views, one of the following privileges is required:
|
Run the following commands:
|
LOB Obj | On the SYSIBMADM.SNAPTAB, SYSIBMADM.ADMINTABINFO and SYSCAT.TABLES
administrative views, one of the following privileges is required:
|
Run the following commands:
|