If I want to kill an Oracle database session, in a UNIX environment, I usually do it like this:
1. I take the sessions SPID from an sql like this one:
SELECT ses.sid,
ses.username,
ses.status,
pr.spid
FROM v$session ses, v$process pr
WHERE ses.paddr = pr.addr
Or with any other method to see the sessions SID and SPID.
Note down the SPID for the respective SID
2. Connect to the OS with a terminal and run the following command:
kill -9 noted_spid
The thing is that every session in the database is a process in the OS, on a DEDICATED server. So it can be killed from the OS directly.
And for Windows SO we can use:
ReplyDelete>orakill
>orakill sid spid
ReplyDeleteWe can obtain sid and spid from sql described by AndreiM.
But if we have a session that is killed and doesn't have a spid and we try to killed using the kill command:
ReplyDeletealter system kill session 'sid,serial#';
and this doens't work?:)
How can we kill it?