Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    84

    Unanswered: 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

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5

  3. #3
    Join Date
    Feb 2007
    Posts
    84
    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

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

Posting Permissions

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