Created
March 21, 2012 00:07
-
-
Save fabriciocolombo/2142817 to your computer and use it in GitHub Desktop.
Kill Oracle sessions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* List all session, except background processes*/ | |
| SELECT s.username, | |
| s.osuser, | |
| s.sid, | |
| s.serial#, | |
| p.spid, | |
| s.status, | |
| s.machine, | |
| s.program, | |
| TO_CHAR(s.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time | |
| FROM v$session s | |
| inner join v$process p | |
| on s.paddr = p.addr | |
| WHERE s.status = 'ACTIVE' | |
| and s.type <> 'BACKGROUND'; | |
| /* Kill one specific session*/ | |
| ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment