Win NT/2000 is a thread based Operating System and not process based Operating System like Unix. Oracle user and background processes are not multiple processes but, threads with in oracle.exe process. 'orakill' is oracle provided utility to kill a particular resource intensive thread under oracle.exe process. For help type in at the DOS prompt C:\>orakill /?
The following query can be used to get the sid, thread id of a particular resource intensive thread.
SQL> select sid, spid as thread, osuser, s.program
2 from sys.v_$process p, sys.v_$session s
3 where p.addr = s.paddr;
SID THREAD OSUSER PROGRAM
-------- --------- --------------- -------------------------------------
1 000C5 UNKNOWN ORACLE73.EXE
2 0013F UNKNOWN ORACLE73.EXE
3 00140 UNKNOWN ORACLE73.EXE
4 0005F UNKNOWN ORACLE73.EXE
5 0011C UNKNOWN ORACLE73.EXE
6 0009A UNKNOWN ORACLE73.EXE
12 00148 SYSTEM D:\ORANT805\agentbin\DBSNMP.EXE
18 001FC scott SQLPLUS.EXE
9 001F2 adam C:\WINNT\Profiles\All Users\Start Menu\AFF_PFC.LNK
36 00206 mark SVRMGR.EXE
31 000E1 cathy AFFAIRS.EXE
15 00204 Julie C:\Documents and Settings\julie\Start Menu\Programs\AFFS.lnk
Say the query from user scott is consuming lot resources and it can be killed by running orakill utility as follows.
C:\>orakill 18 001FC
[Edited by sreddy on 03-29-2001 at 10:49 AM]
What\'s the difference between your method and:
SQL>select username, sid, serial#, status from v$session;
SQL> alter system kill session \'22,155\';
SQL> system altered
well alter system command sometimes takes time to kill a session, it\'s not immediate (sometimes yes depends how the resources are hold up I guess)
Orakill kills the OS thread straight away
Answer to your Q for my tip on how to kill NT process :
Diffrenece is :
If you kill from sqlplus it kills your connection from database and releases Database resources and its not going to release OS resources and all you are going to get is a message saying your session has been killed when you tried to access database.
If you kill using \'orakill\' it kills the OS process and relaeses OS resources.
If I could just in here please...
What is the best way to determine which thread at is the one causing the resource overload?
So that you could use the above proceedure to kill it.
Note the SID used as a parameter for orakill is the system identifier and not session identifier. Hence to kill a session use orakill test 406 where \'test\' is the instance to target, and \'406\' is the thread as derived from the query submitted in the tip.
[Edited by uday on 05-10-2001 at 01:51 PM]
Without going into SQL, how do you found out the threads directly from NT????
Detect/Kill hung sessions in NT
Hi, as a follow up of this thread I want to ask a question to a problem I was looking for solution:
We noticed that INACTIVE sessions that hung up ( i.e. because the user turn off his PC), in Oracle under Unix are eliminated in a few minutes, but in Oracle under NT this do not happens, and they dissapear just when they get the Idle_Time limit.
We think that is an OS (or maybe SqlNet) issue, which don't realise that isn't a connection between the oracle session and the remote user.
Any ideas? Some parameter to setup? Any script to check 'real' connections?
If you're referring too ACTIVE connections by saying REAL than you can use the following to list the ACTIVE sessions:
select p.spid THREADID, s.username, s.program,s.status,s.paddr
from v$process p, v$session s
I have tried by ORAKILL, but I got the following error. and unable to kill the process.
Firstly I have query for the process by the following query.
1 select sid, spid as thread, osuser, s.program
2 from sys.v_$process p, sys.v_$session s
3* where p.addr = s.paddr
1 193 SYSTEM ORACLE.EXE
2 263 SYSTEM ORACLE.EXE
3 267 SYSTEM ORACLE.EXE
4 216 SYSTEM ORACLE.EXE
5 254 SYSTEM ORACLE.EXE
6 259 SYSTEM ORACLE.EXE
13 113 DOMAIN\Administrator SQLPLUSW.EXE
Then I have tried to kill the process 13 and thread 113 by the following commands -
Microsoft(R) Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.
C:\>orakill 13 113
Could not attach to Oracle instance 13: err = 2
and got the above error "Could not attach to Oracle instance 13: err = 2 "
Thanks & Regards
Click Here to Expand Forum to Full Width