All -
I found the following query to figure out the sid and serial number to kill a session. I use it whenever I need to do so. However, I wrote an Oracle package that I've found does not show me the username and program when I run the query. Is there a way I can specify the program name or the username in this query so I can easily decipher which session I want?
Thanks,
ivalum21
SELECT
p.spid "Thread ID",
s.sid "Session ID",
s.serial# "Serial Num",
b.name "Background Process",
s.sql_id "SQL ID",
s.username "Session User",
s.osuser "OS User",
s.status "Status",
s.program "Program"
FROM
v$process p,
v$bgprocess b,
v$session s
WHERE s.status = 'ACTIVE'
AND s.paddr = p.addr
AND b.paddr(+) = p.addr
AND b.name IS NULL
ORDER BY s.username ;
Edited by: ivalum21 on Aug 27, 2009 3:48 PM