codecamp

OceanBase KILL

描述

该语句用来终止一个会话。

说明 
如果您拥有 PROCESS 权限,则您可以查看所有会话。如果您拥有 SUPER 权限,您可以终止所有会话和语句。否则,您只能查看和终止您自己的会话和语句。

格式

KILL [CONNECTION | QUERY] 'sessionid'

参数解释

参数

描述

KILL

与 KILL CONNECTION 一样,可终止给定的threadid。

KILL CONNECTION

与不含修改符的KILL一样,可终止给定的threadid。

KILL QUERY

可终止连接当前正在执行的语句,但是会保持连接的原状。

示例

  • 终止 sessionid 为 3221638213 的会话连接当前正在执行的语句后,再终止该会话。

OceanBase(admin@test)>show processlist;
+------------+-------+--------------------+------+---------+------+--------+------------------+
| Id         | User  | Host               | db   | Command | Time | State  | Info             |
+------------+-------+--------------------+------+---------+------+--------+------------------+
| 3221638212 | admin | 1.11.111.127:11161 | test | Query   |    0 | ACTIVE | show processlist |
| 3221638213 | admin | 1.11.111.127:11161 | test | Query   |    0 | ACTIVE | select "abcedfg" |
+------------+-------+--------------------+------+---------+------+--------+------------------+
1 row in set (0.03 sec)

OceanBase(admin@test)>kill query 3221638213;
Query OK, 0 rows affected (0.01 sec)

OceanBase(admin@test)>kill 3221638212;
Query OK, 0 rows affected (0.01 sec)
OceanBase GRANT
OceanBase REVOKE
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

OceanBase 控制台指南

OceanBase ODC 使用指南

OceanBase Web 版 ODC

OceanBase 客户端版 ODC

OceanBase Connector/J 开发者指南

OceanBase 什么是OceanBase Connector/J

OceanBase SQL 参考(MySQL 模式)

OceanBase SQL 参考(Oracle 模式)

OceanBase 基本元素

OceanBase 数据库对象

OceanBase 函数

OceanBase 单行函数

OceanBase 返回数字的字符串函数

OceanBase 通用比较函数

OceanBase 编码解码函数

OceanBase SQL 调优指南

OceanBase 相关协议

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }