Saturday, June 2, 2007

How to Kill Oracle Session

Get All Lock Objects by Using Following Query

SELECT a.object_id, a.session_id, b.object_name
FROM v$locked_object a, dba_objects b
WHERE a.object_id = b.object_id


Get Session id From below Query by Passing session _id (get From Above query)

For example i got 67 from above query

SELECT SID, serial#,SID||','||serial# "session id", username, command, schemaname, osuser, machine, terminal
FROM v$session
WHERE SID = 67;

I got 93,10383 from above query
Pass Session Id In below query

ALTER system kill session '93,10383'