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 > db2 list applications - show last time an execution took place

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-10, 10:59
rockycj rockycj is offline
Registered User
 
Join Date: Feb 2007
Posts: 73
db2 list applications - show last time an execution took place

I'm using DB2 V9.1. When you look at the list of application currently running by running "db2 list applications", I would like to see the last time an execution took place. Want to be able to find the stale jobs out there instead of running "db2 force applications all" to all of the jobs.

There is these commands that I found:
To get more detailed information from list applications:

db2 list applications for database {dbName} show detail

There is a Status Change Time, but I'm wondering what that really tells me? I want to know what time an execution last took place and weed out the stale jobs.

Can anyone help me with a command or an SQL?
Thank you.

CC
Reply With Quote
  #2 (permalink)  
Old 06-08-10, 11:07
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Reply With Quote
  #3 (permalink)  
Old 06-08-10, 14:13
rockycj rockycj is offline
Registered User
 
Join Date: Feb 2007
Posts: 73
Does the STATUS_CHANGE_TIME mean that is the last time the job was active or changed status, I'm assuming?


SELECT SUBSTR(DB_NAME,1,8) AS DB_NAME,
AGENT_ID,
SUBSTR(APPL_NAME,1,10) AS APPL_NAME,
APPL_STATUS ,
STATUS_CHANGE_TIME
FROM TABLE(SNAP_GET_APPL_INFO(CAST(NULL AS VARCHAR(128)),-1)) AS T


Is this any different than running db2 list applications for database {dbName} show detail?


Thank you.



CC
Reply With Quote
  #4 (permalink)  
Old 06-08-10, 14:33
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I gave you two views to join to get the information:

Code:
select SUBSTR(i.DB_NAME,1,8) AS DB_NAME,
i.AGENT_ID,
SUBSTR(i.APPL_NAME,1,10) AS APPL_NAME,
i.APPL_STATUS ,
a.uow_start_time,
a.uow_stop_time,
a.appl_idle_time 
from sysibmadm.SNAPAPPL_INFO as i 
inner join sysibmadm.SNAPAPPL as a on (i.agent_id = a.agent_id)
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