Kill Session Process
Kill Session Process
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SELECT B.Owner, B.Object_Name, A.Oracle_Username, A.OS_User_Name
FROM V$Locked_Object A, All_Objects B
WHERE A.Object_ID = B.Object_ID;
select
c.owner,
c.object_name,
c.object_type,
b.sid,
b.serial#,
b.status,
b.osuser,
b.machine
from
v$locked_object a ,
v$session b,
dba_objects c
where
b.sid = a.session_id
and
a.object_id = c.object_id;
SELECT s.sid,
l.lock_type,
l.mode_held,
l.mode_requested,
l.lock_id1,
'alter system kill session '''|| s.sid|| ','|| s.serial#|| ''' immediate;'
kill_sid
FROM dba_lock_internal l,
v$session s
WHERE s.sid = l.session_id
AND UPPER(l.lock_id1) LIKE '%XXARB_ITEM_WARRANTY_EXT_PK%'
AND l.lock_type = 'Body Definition Lock'
/
Example:
Example:
4)
SQL> alter system kill session '887,11037' immediate;
alter system kill session '887,11037' immediate
*
ERROR at line 1:
ORA-00031: session marked for kill
It will take some time and kill the seeion to confirm please run the below step 5
5)SQL> @/ptsadmin/common/OHSMON/sessiondetails.sql
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
(3:14:45 PM) aruna.Dba: In some situations the Oracle.exe is not able to kill the
session immediately.�
In these cases the session will be "marked for kill". It will then be killed as
soon as possible.