OS process kill from Oracle - ?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: OS process kill from Oracle - ?

  1. #1
    Join Date
    Nov 2000
    Posts
    22
    Hello all.
    Is there anyone who have some script
    or doc on how to kill os process from
    SQL or PL/SQL procedure.

    I know i can use extproc, and someone told
    me i can use jave stored procedure,
    but what is the best way - and how to do it ?

    thanks.

  2. #2
    Join Date
    Jul 2000
    Posts
    243
    look at [url]http://128.121.241.221/Pipelines/DBA/archives/orashut.htm[/url]

    the name of the doc is "Killing an Oracle Session"

  3. #3
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    you can get the pid for the sid from the v$process, then kill the session using the sid and make sure that the process had been terminated, if not terminate them using kill -9 pid

    Check this thread also:http://dbasupport.com/forums/showthread.php?threadid=7481

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  4. #4
    Join Date
    Jul 2000
    Posts
    243
    sambavan

    correct me if i am wrong, but as far as i know the unix process may be connected to more hen one oracle process. so, when kiling a process in unix you can create a youeself a problem. you do not kill a process at the os level unless you know for a act that it is supporting only the oracle process you need to kill, and it i not likely that a unix process supports only one oracle user process.

    please correct me if i am wrong

  5. #5
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    If the system was under the dedicated server option then it is one process perconnection. On the MTS server option, you are correctm at that time you want to kill the session and not the process. Since he did not mention the type of setup, I gave both. Yeah, I was not clear. Sorry about that.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  6. #6
    Join Date
    Nov 2000
    Posts
    22
    Thank you for the answers , but ...
    I know exactly how to kill process in oracle (alter system)
    and in unix (kill -9),
    but the problem is that i want to write a pl/sql
    procedure that kills unix process - i pass the pid
    as a parameter and it will go to OS and 'kill -9'
    the process there !.
    Why ?
    Because in some situations oracle only marks the session
    for kill and does not actually kill the process
    in OS for hours - in example when replication
    between two nodes is stuck the only solution
    to resume the snapshot jobs is to kill processes
    in unix and not in oracle.
    Please help me if anyone knows the solution.

    thanks.

  7. #7
    Join Date
    Oct 2000
    Posts
    42
    I have never done this maybe someone else can help. Spool your result from the v$session and your ps -ef |grep oracle_$sid. Use the diff command to compare the PID differences. Spool the difference to another file and kill all the PID from there.

    Oisaya

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