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 > Need script to send email if application is in waiting more than 10 hours

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-10, 07:03
surbhi_gt1 surbhi_gt1 is offline
Registered User
 
Join Date: Apr 2009
Posts: 11
Need script to send email if application is in waiting more than 10 hours

Hi,

As per our current requirement we need to implement a script which will send eamil alert about the applications which are in UOW waiting state for around 10 hours.

Currenlty ia m trying to use

db2 list applications show detail command and from the output we have to compare the status change time stamp to the current timestamp.

But i am unable to compare it.

Does anybody has better idea about it ?

Thanks
Reply With Quote
  #2 (permalink)  
Old 01-05-10, 08:48
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What DB2 version and OS are you using?

Andy
Reply With Quote
  #3 (permalink)  
Old 01-05-10, 10:30
surbhi_gt1 surbhi_gt1 is offline
Registered User
 
Join Date: Apr 2009
Posts: 11
We are at db2 9.1 FP4 .
Reply With Quote
  #4 (permalink)  
Old 01-05-10, 10:45
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You could use the administrative views to calculate the result set:

select * from sysibmadm.applications where appl_status = 'UOWWAIT' and snapshot_timestamp - status_change_time >= 100000


Andy
Reply With Quote
  #5 (permalink)  
Old 01-05-10, 12:10
surbhi_gt1 surbhi_gt1 is offline
Registered User
 
Join Date: Apr 2009
Posts: 11
Thanks for quick reply...
Reply With Quote
  #6 (permalink)  
Old 01-27-10, 09:46
surbhi_gt1 surbhi_gt1 is offline
Registered User
 
Join Date: Apr 2009
Posts: 11
Just one more query :

Is 100000 is difference in seconds ?
If yes then for 10 hour it should be 10X60X60=36000 .

Please correct me if i am wrong.

Thanks
Reply With Quote
  #7 (permalink)  
Old 01-27-10, 10:02
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Subtracting Date and time values result in a "time duration". Look it up in the manual.

Andy
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