MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Determining run time of DB2 SQL query

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Fri Dec 15, 2017 9:52 am    Post subject: Determining run time of DB2 SQL query Reply with quote

I have a SQL query and wants to determine the approximate run times of the query. Can I do it using QMF or SPUFI or any other tools. Please let me know your suggestions.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Fri Dec 15, 2017 11:15 am    Post subject: Reply with quote

manu,

You need to have auditing turned to able to see the stats or if your shop has "DB2 Query Monitor" product, then you can simply look at the EXEC COUNT column which stores the number of times a the SQL statement has executed

https://www.ibm.com/support/knowledgecenter/en/SSAURY_3.2.0/topics/cqmucon_opsumcols.html
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Fri Dec 15, 2017 12:02 pm    Post subject: Reply with quote

In the past Auditing was very expensive for CPU in our shop.
This is a little rough, but it will get the job done.

If the time does not have to be 100% perfect you could do something like this:
Code:


    SELECT CURRENT TIMESTAMP, 'START', 'YOUR SQL NAME' 
    FROM SYSIBM.SYSDUMMY1;

    YOUR SQL

   SELECT CURRENT TIMESTAMP, 'END', 'YOUR SQL NAME' 
    FROM SYSIBM.SYSDUMMY1;



Load the Timestamp info in a table and query the delta for your jobs.(you can write the insert)
Just a thought
_________________
Thanks,
NASCAR9
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Fri Dec 15, 2017 12:26 pm    Post subject: Reply with quote

NASCAR9,

I think OP wanted to check if a particular Query is run by ANY user from anywhere (TSO, BATCH, SPUFI, QMF, Program....)
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Mon Dec 18, 2017 9:41 am    Post subject: Reply with quote

Kolusu and NASCAR9

Thanks for you inputs on this. I will review and get back if needed. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group