> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lwops.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 8.5. DB2

### 8.5.1. 授权

执行如下命令创建zbxtest用户用于监控

```text theme={null}
groupadd zbxtest
useradd -g zbxtest zbxtest
echo 123456 | passwd --stdin zbxtest
db2 grant execute on function SYSPROC.MON_GET_DATABASE to user zbxtest
db2 grant execute on function SYSPROC.MON_GET_CONNECTION to user zbxtest
db2 grant execute on function SYSPROC.MON_GET_ACTIVITY to user zbxtest
db2 grant execute on function SYSPROC.MON_GET_TABLESPACE to user zbxtest
db2 grant execute on function SYSPROC.SNAP_GET_DB to user zbxtest
db2 grant execute on function SYSPROC.SNAP_GET_APPL to user zbxtest
db2 grant execute on function SYSPROC.SNAP_GET_DBM to user zbxtest

db2 grant select on table sysibmadm.BP_HITRATIO to user zbxtest
db2 grant select on table sysibmadm.log_utilization to user zbxtest
db2 grant select on table sysibmadm.snapdb to user zbxtest
db2 grant select on table syscat.tables to user zbxtest
db2 grant select on table sysibmadm.db_history to user zbxtest
```

### 8.5.2. 对象添加

![8.5. DB2 操作截图 1](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/db2/image-01.png)
