描述

    对于show processlist语句:

    • show processlist用于展示当前session list,与mysql展示有少许不同。
    • 普通用户默认只能看到当前用户下所有session的相关信息, 且不能看到其所在cluster信息。
    • observer的超级管理员root@sys、proxy的超级管理员root@proxysys可以show所有cluster、tenant下的session。

    示例

    1. proxy
    2. OceanBase (admin@oceanbase)> show processlist;
    3. +-------+--------+-------+--------------------+-----------+-------------+-------------------+-------------------+------+------+
    4. | Id | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
    5. +-------+--------+-------+--------------------+-----------+-------------+-------------------+-------------------+------+------+
    6. | 10001 | sys | admin | 10.125.111.4:65152 | oceanbase | 69 | 1 | MCS_ACTIVE_READER | 2891 | 2891 |
    7. +-------+--------+-------+--------------------+-----------+-------------+-------------------+-------------------+------+------+
    8. 1 row in set (0.01 sec)
    9. OceanBase (root@oceanbase)> show processlist;
    10. +-------+--------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
    11. | Id | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
    12. +-------+--------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
    13. | 10001 | sys | admin | 10.125.111.4:65152 | oceanbase | 69 | 1 | MCS_KEEP_ALIVE | 2891 | 2891 |
    14. | 10002 | sys | root | 100.69.111.180:56747 | oceanbase | 67 | 1 | MCS_ACTIVE_READER | 2900 | 2891 |
    15. +-------+--------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
    16. 2 rows in set (0.01 sec)
    17. OceanBase (root@proxysys@oceanbase)> show processlist;
    18. +-------+------------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
    19. | Id | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
    20. +-------+------------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
    21. | 10001 | sys | admin | 10.125.111.4:65152 | oceanbase | 70 | 1 | MCS_KEEP_ALIVE | 2891 | 2891 |
    22. | 10003 | proxysys | root | 100.69.111.180:56765 | NULL | 6 | 0 | MCS_ACTIVE_READER | 2900 | 2891 |
    23. +-------+------------+-------+----------------------+-----------+-------------+-------------------+-------------------+------+------+
    24. 2 rows in set (0.01 sec)
    1. mysql
    2. +-------+------+----------------------------------------------+----------------------+---------+------+----------------------+----------------------------------------------+
    3. | Id | User | Host | db | Command | Time | State | Info |
    4. +-------+------+----------------------------------------------+----------------------+---------+------+----------------------+----------------------------------------------+
    5. | 15481 | root | OceanBase111012.sqa.bjb.bja.tbsite.net:43946 | haijing_zhj_unittest | Sleep | 2 | | NULL |
    6. | 15483 | root | OceanBase111012.sqa.bjb.bja.tbsite.net:43949 | NULL | Query | 0 | NULL | show processlist |
    7. +-------+------+----------------------------------------------+----------------------+---------+------+----------------------+----------------------------------------------+
    8. 2 rows in set (0.01 sec)