User Permissions for IBM DB2 LUW

The monitoring user needs SYSMON authority and connection privileges to monitor. This user must be a part of the sysmon_group.

To generate an execution plan, you must create the associated EXPLAIN tables in the schema.

DB2 >= 9.7

For complete Database Visibility functionality, the following monitoring switches of the DB2 server need to be enabled: "TIMESTAMP".

To enable the "TIMESTAMP" monitoring switch, enter:

update dbm cfg using dft_mon_timestamp on;
update db cfg using mon_act_metrics BASE
Privileges
grant select on SYSIBMADM.MON_CURRENT_SQL to user DBMon_Agent_User
grant select on SYSIBMADM.MON_LOCKWAITS to user DBMon_Agent_User
grant execute on function SYSPROC.MON_GET_CONNECTION to user DBMon_Agent_User
grant execute on function SYSPROC.MON_GET_PKG_CACHE_STMT to user DBMon_Agent_User
(version 10.5 and above) grant execute on function SYSPROC.MON_GET_TRANSACTION_LOG to DBMon_Agent_User
(version 10.5 and above) grant execute on function SYSPROC.MON_GET_DATABASE to DBMon_Agent_User

Replace DBMon_Agent_User with the user name under which you run the Database Visibility Agent.

DB2 9.5

For complete Database Visibility functionality, the following monitoring switches of the DB2 server need to be enabled: "STATEMENT", and "TIMESTAMP".

To enable these monitoring switches, enter:

update dbm cfg using dft_mon_stmt on;
update dbm cfg using dft_mon_timestamp on;
Privileges
grant select on SYSIBMADM.SNAPSTMT to user DBMon_Agent_User 
grant select on SYSIBMADM.SNAPAPPL_INFO to user DBMon_Agent_User 
grant select on table SYSIBMADM.ENV_PROD_INFO to user DBMon_Agent_User 

where DBMon_Agent_User is the user name under which you run the Database Visibility Agent.

User Permissions When restrict_access is Set to YES

If your database has the restrict_access parameter set to YES, you must grant these privileges:

grant select on SYSIBMADM.MON_CURRENT_SQL to user DBMon_Agent_User;
grant select on SYSIBMADM.MON_LOCKWAITS to user DBMon_Agent_User;
grant execute on function SYSPROC.MON_GET_CONNECTION to user DBMon_Agent_User;
grant select on SYSIBMADM.SNAPAPPL_INFO to user DBMon_Agent_User;
grant EXECUTE on function SYSPROC.MON_GET_PKG_CACHE_STMT to user DBMon_Agent_User;
grant execute on function SYSPROC.MON_GET_TRANSACTION_LOG to user DBMon_Agent_User;
grant EXECUTE on package NULLID.SQLC2K26 to user DBMon_Agent_User;
grant select on SYSIBM.SYSDUMMY1 to user DBMon_Agent_User;
grant select on SYSIBMADM.ENV_PROD_INFO to user DBMon_Agent_User;
grant select on SYSIBMADM.ENV_SYS_RESOURCES to user DBMon_Agent_User;
grant execute on function SYSPROC.SNAP_GET_STMT(varchar(),Integer) to user DBMon_Agent_User;
grant select on SYSCAT.STATEMENTS to user DBMon_Agent_User;
grant select on SYSIBMADM.DBCFG to user DBMon_Agent_User;
grant execute on function SYSPROC.SNAP_GET_DB(varchar(),Integer) to user DBMon_Agent_User;
grant EXECUTE on package NULLID.SYSSH200 to user DBMon_Agent_User;
grant select on SYSIBMADM.ENV_SYS_RESOURCESto user DBMon_Agent_User;
grant select on SYSCAT.DBAUTH to user DBMon_Agent_User;
grant execute on function SYSPROC.SNAP_GET_DBM(Integer) to user DBMon_Agent_User;
grant select on syscat.schemata to user DBMon_Agent_User;

Replace DBMon_Agent_User with the user name under which you run the Database Visibility Agent.