Home » Developer & Programmer » Reports & Discoverer » How to kill session?
How to kill session? [message #88899] Thu, 05 June 2003 02:11 Go to next message
MinhTuan
Messages: 2
Registered: June 2002
Junior Member
How to kill a procedure when it's executing?
What are command, methol... to do it?
Re: How to kill session? [message #88901 is a reply to message #88899] Thu, 05 June 2003 06:12 Go to previous messageGo to next message
rana
Messages: 12
Registered: July 2002
Junior Member
Hi,

connect as system/******* to your database .

==== killing a locked session

select 'alter system kill session '||''''||sid||','||serial#||'''',substr(machine,1,40) PC from v$session where sid in (select distinct session_id from v$locked_object).

This will give you all the locked sessions with kill session script and its related machine name. You just copy and paste the output line for which you want to kill with a semi colon mark. from machine name you can recognise the session you want to kill

For example copy this part only not whiole line

alter system kill session '20,120';

reply will be system altered. means ur session is killed

====== Killing any session

similary if you want to kill any session then
run this

select 'alter system kill session '||''''||sid||','||serial#||'''',substr(machine,1,40) PC from v$session;

This will give you all the locked sessions with kill session script and its related machine name. You just copy and paste the output line for which you want to kill with a semi colon mark. from machine name you can recognise the session you want to kill
example
alter system kill session '20,120';

hope this will help your purpose

reagrds
RANA
Re: How to kill session? [message #88903 is a reply to message #88899] Thu, 05 June 2003 09:02 Go to previous message
AnotherBlue
Messages: 28
Registered: July 2001
Junior Member
1. check locked session

step_1 :
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-- and b.object_name like 'OE%'

step_2 :
select sid, serial# from v$session
where sid =140

2.
alter system kill session '140,2829'

if it is not release then

step_1 :

SELECT p.SPID, s.sid, s.serial#
FROM V$SESSION s, V$PROCESS p
WHERE p.ADDR = s.PADDR AND
s.SID =140;

step_2 : uses system command

/usr/local/bin/top --check locked spid

kill -9 spid
Previous Topic: How can we Run developer 2000 forms on different screen resolution
Next Topic: print report in one page
Goto Forum:
  


Current Time: Sat Nov 23 20:32:13 CST 2024