DBAsupport.com Forums - Powered by vBulletin
Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: How to kill Oracle Process on Win NT/2000

Hybrid View

  1. #1
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    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
    7 00101
    8 000C0
    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]
    Reddy,Sam

  2. #2
    Join Date
    Aug 2000
    Posts
    462
    sreddy,

    What\'s the difference between your method and:

    SQL>select username, sid, serial#, status from v$session;

    username_____SID______SERIAL#________STATUS
    ----------------------------------------------------------
    SCOTT________22________155___________ACTIVE
    .
    .
    .

    SQL> alter system kill session \'22,155\';
    SQL> system altered



  3. #3
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    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

  4. #4
    Join Date
    Feb 2001
    Posts
    163
    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.

    sreddy

  5. #5
    Join Date
    Apr 2001
    Posts
    1
    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.

  6. #6
    Join Date
    May 2001
    Posts
    1

    Wink SID???

    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]

  7. #7
    Join Date
    May 2001
    Location
    Melbourne
    Posts
    5

    Post Without SQL

    Without going into SQL, how do you found out the threads directly from NT????

    =====================
    http://come.to/BlackBeauty
    =====================

  8. #8
    Join Date
    Jul 2001
    Posts
    1

    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?

    TIA.
    Gus!

  9. #9
    Join Date
    Aug 2001
    Posts
    8
    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
    where p.addr=s.paddr
    and s.status='ACTIVE';

  10. #10
    Join Date
    May 2001
    Posts
    25
    Dear friends..

    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
    SQL>/
    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
    7 233
    8 250
    9 257
    10 290
    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

    C:\>

    and got the above error "Could not attach to Oracle instance 13: err = 2 "

    Please advise.

    Thanks & Regards
    Naresh


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width