描述
对于show processlist
语句:
- show processlist用于展示当前session list,与mysql展示有少许不同。
- 普通用户默认只能看到当前用户下所有session的相关信息, 且不能看到其所在cluster信息。
- observer的超级管理员
root@sys
、proxy的超级管理员root@proxysys
可以show所有cluster、tenant下的session。
示例
proxy
OceanBase (admin@oceanbase)> show processlist;
+-------+--------+-------+--------------------+-----------+-------------+-------------------+-------------------+------+------+
| Id | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
+-------+--------+-------+--------------------+-----------+-------------+-------------------+-------------------+------+------+
| 10001 | sys | admin | 10.125.111.4:65152 | oceanbase | 69 | 1 | MCS_ACTIVE_READER | 2891 | 2891 |
+-------+--------+-------+--------------------+-----------+-------------+-------------------+-------------------+------+------+
1 row in set (0.01 sec)
OceanBase (root@oceanbase)> show processlist;
+-------+--------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
| Id | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
+-------+--------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
| 10001 | sys | admin | 10.125.111.4:65152 | oceanbase | 69 | 1 | MCS_KEEP_ALIVE | 2891 | 2891 |
| 10002 | sys | root | 100.69.111.180:56747 | oceanbase | 67 | 1 | MCS_ACTIVE_READER | 2900 | 2891 |
+-------+--------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
2 rows in set (0.01 sec)
OceanBase (root@proxysys@oceanbase)> show processlist;
+-------+------------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
| Id | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
+-------+------------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
| 10001 | sys | admin | 10.125.111.4:65152 | oceanbase | 70 | 1 | MCS_KEEP_ALIVE | 2891 | 2891 |
| 10003 | proxysys | root | 100.69.111.180:56765 | NULL | 6 | 0 | MCS_ACTIVE_READER | 2900 | 2891 |
+-------+------------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
2 rows in set (0.01 sec)
mysql
+-------+------+----------------------------------------------+----------------------+---------+------+----------------------+----------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+------+----------------------------------------------+----------------------+---------+------+----------------------+----------------------------------------------+
| 15481 | root | OceanBase111012.sqa.bjb.bja.tbsite.net:43946 | haijing_zhj_unittest | Sleep | 2 | | NULL |
| 15483 | root | OceanBase111012.sqa.bjb.bja.tbsite.net:43949 | NULL | Query | 0 | NULL | show processlist |
+-------+------+----------------------------------------------+----------------------+---------+------+----------------------+----------------------------------------------+
2 rows in set (0.01 sec)