How To Kill/terminate A Session In Oracle - Synametrics Technologies
Maybe your like
WinSQL » Knowledge base
Document information
| Document ID: | 768 |
|---|---|
| Subject: | How to kill/terminate a session in Oracle |
| Creation date: | 7/29/09 2:57 PM |
| Last modified on: | 7/29/09 2:57 PM |
Sessions can be killed from within WinSQL using the ALTER SYSTEM KILL SESSION syntax.
First identify the offending session as follows:
SELECT s.sid, s.serial#, s.osuser, s.program FROM v$session s;
This query will result in a similar result.| SID | SERIAL# | OSUSER | PROGRAM |
|---|---|---|---|
| 1 | 1 | SYSTEM | ORACLE.EXE |
| 2 | 1 | SYSTEM | ORACLE.EXE |
| 3 | 1 | SYSTEM | ORACLE.EXE |
| 4 | 1 | SYSTEM | ORACLE.EXE |
| 32 | 45 | SCOTT | WINSQL.EXE |
| 37 | 501 | SYSTEM | WINSQL.EXE |
The SID and SERIAL# values of the relevant session can then be substituted into the following statement:
ALTER SYSTEM KILL SESSION 'sid,serial#'In some situations the Oracle.exe is not able to kill the session immediately. In these cases the session will be "marked for kill". It will then be killed as soon as possible.
Issuing the ALTER SYSTEM KILL SESSION command is the only safe way to kill an Oracle session. If the marked session persists for some time you may consider killing the process at the operating system level. However, this is not recommended as it is dangerous and can lead to instance failures.
It is possible to force the kill by adding the IMMEDIATE keyword:
ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATEUser comments
Posted by no good on 11/12/15 1:24 AMI can't kill the active session using the IMMEDIATE keyword
Posted by vasan on 3/5/11 12:13 AMi am not a DBA. so i could not kill the session as the session is hanged. please tell me how to kill an user session
Posted by harsha on 2/18/13 7:28 AMhow to know,which session is for which operation?
Add a comment to this document
Do you have a helpful tip related to this document that you'd like to share with other users?
Important: This area is reserved for useful tips. Therefore, do not post any questions here. Instead, use our public forums to post questions. Your Name Email Hide my email address CaptchaTag » How To Kill Session In Oracle
-
Terminating Sessions And Cleaning Up Processes - Oracle
-
Alter System Kill Session - Oracle Base
-
ALTER SYSTEM KILL SESSION Tips - Burleson Consulting
-
How To Kill All Active And Inactive Oracle Sessions For User
-
Why And How To Kill A Session In Oracle - Toad World Blog
-
How To Kill Session In Oracle Database Using Alter System Kill Session
-
Alter System Kill Session Tips In Oracle - IT Tutorial
-
How To Kill A Session In Oracle Database - DBACLASS
-
How To Kill An Oracle Database Session - Ex Libris Knowledge Center
-
How Do You Kill A Session In Oracle? - Quora
-
Oracle -- How To Kill Sessions For Replicate - Qlik Community
-
How To Kill Session In Oracle 19c - OracleDBWorld
-
Performing Common System Tasks For Oracle DB Instances
-
Oracle DBA - How To Find And Kill Sessions - RazorSQL