If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Danger of using Kill -9

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-07-07, 12:46
nivasreddy007 nivasreddy007 is offline
Registered User
 
Join Date: Jun 2007
Posts: 66
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
Reply With Quote
  #2 (permalink)  
Old 12-07-07, 12:50
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
DB2 gives you an easy way to stop an agent through the FORCE command. You should not have to "kill" an agent.

Andy
Reply With Quote
  #3 (permalink)  
Old 12-07-07, 12:53
nivasreddy007 nivasreddy007 is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 12-07-07, 13:00
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #5 (permalink)  
Old 12-07-07, 18:19
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #6 (permalink)  
Old 12-07-07, 18:37
nivasreddy007 nivasreddy007 is offline
Registered User
 
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??
Reply With Quote
  #7 (permalink)  
Old 12-08-07, 07:17
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #8 (permalink)  
Old 12-10-07, 11:49
nivasreddy007 nivasreddy007 is offline
Registered User
 
Join Date: Jun 2007
Posts: 66
Thanks a lot..Good information
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On