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 > Informix > killing a process "gently"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-23-04, 17:24
WiccaChic WiccaChic is offline
Registered User
 
Join Date: Jan 2004
Posts: 71
killing a process "gently"

Is there a way to kill an informix process in a graceful manner? Does onmode -z take into account what is going on with a job and wait until its in a "good place" before killing it?
Reply With Quote
  #2 (permalink)  
Old 02-24-04, 00:41
ladwig ladwig is offline
Registered User
 
Join Date: May 2002
Location: Osnabrueck Germany
Posts: 59
Hi,
onmode -z is the best way to clear an informix process.
onmode -z <session_id>

This is similar to Unix kill -9 <pid> interrupt signalling. Onmode takes care about the trasactions in progress condition too, if so it will judge the stage of the transaction, and tries to commit, if possible. But in most of the cases it rolls back the transactions. Such cases it may take a longer period to terminate a session.
__________________
Juergen Ladwig
Reply With Quote
  #3 (permalink)  
Old 02-24-04, 01:42
vpshriyan vpshriyan is offline
Registered User
 
Join Date: Nov 2003
Location: Mumbai, India
Posts: 92
Hi,

Look here for the original post dated Dec 12, 2003:
http://www.tek-tips.com/viewthread.c...PID=179&page=4

I request all forum members, while copying solutions given by others, at least give credit to the original poster.

Regards,
Shriyan
Reply With Quote
  #4 (permalink)  
Old 02-24-04, 04:47
vpshriyan vpshriyan is offline
Registered User
 
Join Date: Nov 2003
Location: Mumbai, India
Posts: 92
Hi,

If you were not able to get inside tek-tips.com page containing the subject with earlier URL here is the exact pointer to that page:

http://www.tek-tips.com/gviewthread....179/qid/728199

Regards,
Shriyan
Reply With Quote
  #5 (permalink)  
Old 02-24-04, 06:33
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Quote:
Originally posted by vpshriyan
Hi,

If you were not able to get inside tek-tips.com page containing the subject with earlier URL here is the exact pointer to that page:

http://www.tek-tips.com/gviewthread....179/qid/728199

Regards,
Shriyan
Hi Shriyan,

Thanks for the post. How can we do the above in a script. For eg. i take a daily dbexport of my database through cron. On most of the occasssions some sessions are connected to the database and so the dbexport fails. Do you have an automated script which will check for open sessions & delete them before doing a dbexport.

Best Regards,

Lloyd
Reply With Quote
  #6 (permalink)  
Old 02-24-04, 06:56
vpshriyan vpshriyan is offline
Registered User
 
Join Date: Nov 2003
Location: Mumbai, India
Posts: 92
Hi Lloyd,

One of the primary requirement for successful execution of dbexport job
is that it needs a database access in exclusive mode. A DBA need to monitor active sessions and plan dbexport job according to the least traffic situation in the database. A automated (batch process) may result in havoc of active sessions, should such batch process kill all those active sessions!

Anyway, you may fall upon steps outlined below to automate it.
1. output to aa.cmd without headings select 'onmode -z '||sid from sysmaster:syssessions ;
2. Run aa.cmd
3. Wait for some time. (example: sleep 10) Let the engine commit/rollback those active sessions having transactions.
4. Check for any remaining active sessions: select count(*) from sysmaster:syssessions;
5. If any sessions are active repeat steps 1 to 4
6. dbexport -d <database> -ss ...

Regards,
Shriyan
Reply With Quote
  #7 (permalink)  
Old 02-24-04, 07:18
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Quote:
Originally posted by vpshriyan
Hi Lloyd,

One of the primary requirement for successful execution of dbexport job
is that it needs a database access in exclusive mode. A DBA need to monitor active sessions and plan dbexport job according to the least traffic situation in the database. A automated (batch process) may result in havoc of active sessions, should such batch process kill all those active sessions!

Anyway, you may fall upon steps outlined below to automate it.
1. output to aa.cmd without headings select 'onmode -z '||sid from sysmaster:syssessions ;
2. Run aa.cmd
3. Wait for some time. (example: sleep 10) Let the engine commit/rollback those active sessions having transactions.
4. Check for any remaining active sessions: select count(*) from sysmaster:syssessions;
5. If any sessions are active repeat steps 1 to 4
6. dbexport -d <database> -ss ...

Regards,
Shriyan
Hi Shriyan,

Thanks once again for your prompt reply. I will work on the below steps.

Best Regards,

Lloyd
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