Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    272

    Unanswered: Long running queries

    Environment: Single partitioned environment
    DB2 running on AIX 6.1
    DB2 Version : 9.5 FP4

    Is there any way to capture the applications [snapshot of applications] which are hitting database and are running for more than 15 seconds. It shouldn't include the applications which are getting finished in less than 15 seconds?

    If there is any direct way to have the snapshots of those applications captured, please do let us know. Your help in this regard would be much appreciated.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Consider using the DB2 workload manager: http://publib.boulder.ibm.com/infoce.../c0052599.html
    Last edited by n_i; 02-25-13 at 11:49. Reason: wrong link
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Mar 2003
    Posts
    280
    Quote Originally Posted by blazer789 View Post
    Environment: Single partitioned environment
    DB2 running on AIX 6.1
    DB2 Version : 9.5 FP4

    Is there any way to capture the applications [snapshot of applications] which are hitting database and are running for more than 15 seconds. It shouldn't include the applications which are getting finished in less than 15 seconds?

    If there is any direct way to have the snapshots of those applications captured, please do let us know. Your help in this regard would be much appreciated.
    Check out SYSIBMADM.SNAPAPPL.UOW_STOP_TIME

    Example:
    Code:
    select 
        x.agent_id, 
        substr(z.corr_TOKEN,1,12) as ip,
        cast(y.stmt_text as varchar(800)) as stmt, 
        x.locks_held, 
        x.APPL_IDLE_TIME, 
        x.UOW_START_TIME 
    from sysibmadm.SNAPAPPL x 
    join sysibmadm.snapstmt y 
        on x.agent_id = y.agent_id 
    join sysibmadm.SNAPAPPL_INFO z
        on x.agent_id = z.agent_id
    where UOW_STOP_TIME is null
      and TIMESTAMPDIFF(2,CHAR(current_timestamp - x.UOW_START_TIME)) > 15
    order by UOW_START_TIME;
    --
    Lennart

Posting Permissions

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