OceanBase Database allows you to terminate tenant sessions by using the KILL statement.
Syntax for the SQL statement:
KILL [CONNECTION] 'session_id';
Notes:
You can execute the
KILLstatement to terminate only one session at a time.If you have the
PROCESSprivilege, you can view all sessions. If you have theSUPERprivilege, you can terminate all sessions and statements one by one. Otherwise, you can view and terminate only the sessions and statements that you have initiated. An administrator can terminate all sessions and statements one by one.Note
For more information about how to view privileges in Oracle mode, see View user privileges . If you do not have the required privileges, contact the administrator to obtain the privileges. For more information, see Modify user privileges.
For more information about how to view your privileges in MySQL mode, see View user privileges. If you do not have the required privileges, contact the administrator to obtain the privileges. For more information, see Modify user privileges.
Sample statement for terminating a specified session:
obclient> KILL session_id;
or
obclient> KILL CONNECTION session_id;
You can execute the SHOW PROCESSLISTstatement to obtain the value of the session_id field.
For more information about the KILL statement, see KILL in SQL Reference (MySQL Mode), or KILL in SQL Reference (Oracle Mode).