Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2007
    Posts
    66

    Unanswered: Danger of using Kill -9

    HI all,

    I know Kill -9 is dangerous at times and I have seen cases when the db2 was brought down by kill -9 when it was issued on an application pid.

    db2agent process is spawned by the parent db2ipccm(listener) which inturn links to db2sysc.So,does that mean Kill -9 on a db2agent process kills all the parent processes too at times??

    I know kill -9 should be the last resort.So do you think plain kill or kill -1 can be used in general case.Please explain??

    Thanks

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    DB2 gives you an easy way to stop an agent through the FORCE command. You should not have to "kill" an agent.

    Andy

  3. #3
    Join Date
    Jun 2007
    Posts
    66
    yeah ,I use force applications in the general scenario.But at times some of them have to be killed as force app might not work for some threads.

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    I have not had a problem with FORCE. I have to sometimes wait a while until the force actually completes. This is usually because a unit of work needs to be rolled back. Remember that FORCE is asynchronous. The effects are not immediate.

    Andy

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    There are some threads that cannot be cancelled by the force command. I have found problems with certain Replication processes and with a write suspend command (both of which were hung). But I don't recall any remote application that could not be cancelled with force command.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  6. #6
    Join Date
    Jun 2007
    Posts
    66
    You are right. I faced the same issues.In cases like that kill -9 sometimes might bring down db2 as it might act on db2sysc .Also in cases of executing shell scripts which has db2 commands inside it , you might face the same problem.

    Any thoughts??

  7. #7
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    A kill -9 cannot even be intercepted by the process and it is shut down hard. When the DB2 engine detects that a process like a db2agent is missing, it doesn't know what's going on and it will (usually) shut itself down completely before it starts to corrupt something.

    A db2agent is a db2sysc process. When a new agent is spawned, a db2sysc process is started and that process renames itself to db2agent. So when you kill an agent, you kill a db2sysc process. (Note that this may be different on different platforms and DB2 versions.)

    Shell scripts cannot suffer from this particular issue - the process model prevents that. In a shell, all DB2 commands are executed through a db2bp (db2 background process). When the db2bp goes away (kill -9 or whatever), the DB2 engine only notices that a client application crashed, rolls back any in-flight transactions and continues on.

    p.s: If you have some sort of serious problem, you may want to have a look at the db2_kill command.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  8. #8
    Join Date
    Jun 2007
    Posts
    66
    Thanks a lot..Good information

Posting Permissions

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