Help Center/
GaussDB/
Developer Guide(Centralized_2.x)/
SQL Reference/
SQL Syntax/
ALTER SYSTEM KILL SESSION
Updated on 2023-10-23 GMT+08:00
ALTER SYSTEM KILL SESSION
Function
ALTER SYSTEM KILL SESSION ends a session.
Precautions
None
Syntax
ALTER SYSTEM KILL SESSION 'session_sid, serial' [ IMMEDIATE ];
Parameter Description
- session_sid, serial
Specifies the SID and SERIAL of a session (To obtain the values, see the example.)
- IMMEDIATE
Specifies that a session will be ended instantly after the statement is executed.
Examples
-- Query session information. openGauss=# SELECT sa.sessionid AS sid,0::integer AS serial#,ad.rolname AS username FROM pg_stat_get_activity(NULL) AS sa LEFT JOIN pg_authid ad ON(sa.usesysid = ad.oid)WHERE sa.application_name <> 'JobScheduler'; sid | serial# | username -----------------+---------+---------- 140131075880720 | 0 | omm 140131025549072 | 0 | omm 140131073779472 | 0 | omm 140131071678224 | 0 | omm 140131125774096 | 0 | 140131127875344 | 0 | 140131113629456 | 0 | 140131094742800 | 0 | (8 rows) -- End the session whose SID is 140131075880720. openGauss=# ALTER SYSTEM KILL SESSION '140131075880720,0' IMMEDIATE;
Parent topic: SQL Syntax
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot