描述

该语句用来强制结束 session。

格式

  1. session_stmt:
  2. KILL [CONNECTION] session_id;
  3. session_id:
  4. INT_VALUE

参数解释

参数

描述

session_id

要结束 session 的编号

示例

  • 强制结束编号为 3221502221和 3221750376 的 session。
  1. OceanBase(admin@test)>show processlist;
  2. +------------+-------+---------------------+------+---------+------+--------+----------------------------------+
  3. | Id | User | Host | db | Command | Time | State | Info |
  4. +------------+-------+---------------------+------+---------+------+--------+----------------------------------+
  5. | 3221502221 | admin | 100.xx.xx.xx:44775 | test | Sleep | 10 | SLEEP | NULL |
  6. | 3221502083 | admin | 100.xx.xx.xx:44720 | test | Query | 0 | ACTIVE | show processlist |
  7. | 3221502317 | NULL | 100.xx.xx.xx:41414 | test | Query | 0 | ACTIVE | REMOTE/DISTRIBUTE PLAN EXECUTING |
  8. | 3221750377 | NULL | 100.xx.xx.xx:41414 | test | Query | 0 | ACTIVE | REMOTE/DISTRIBUTE PLAN EXECUTING |
  9. | 3221750376 | admin | 100.xx.xx.xx:43783 | test | Sleep | 4 | SLEEP | NULL |
  10. +------------+-------+---------------------+------+---------+------+--------+----------------------------------+
  11. 5 rows in set (0.04 sec)
  12. OceanBase(admin@test)>kill 3221502221;
  13. Query OK, 0 rows affected (0.00 sec)
  14. OceanBase(admin@test)>kill connection 3221750376;
  15. Query OK, 0 rows affected (0.05 sec)