Created
September 6, 2010 21:03
-
-
Save rponte/567512 to your computer and use it in GitHub Desktop.
listing and killing oracle sessions
This file contains 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
-- comando para listar usuarios conectados no oracle | |
SELECT s.username, s.program, s.logon_time | |
FROM v$session s, v$process p, sys.v_$sess_io si | |
WHERE s.paddr = p.addr(+) | |
AND si.sid(+) = s.sid | |
AND s.username = 'MEU_USUARIO'; | |
-- Kill oracle sessions | |
-- http://www.oracle-base.com/articles/misc/KillingOracleSessions.php | |
SELECT s.inst_id, | |
s.sid, | |
s.serial#, | |
p.spid, | |
s.username, | |
s.program | |
FROM gv$session s | |
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id | |
WHERE s.type != 'BACKGROUND' AND s.username = 'SYSPDVWEB_TEST'; | |
alter system disconnect session 'sid,serial' IMMEDIATE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment