473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Retrieve SQL statements Info from MON_GET_PKG_CACHE_STMT

DB2 Level: DB2 v9.7.0.9
OS:
Linux xxx.xxxx.com 2.6.32-431.20.3.el6.x86_64 #1 SMP Fri Jun 6 18:30:54 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

I’m running this query to retrieve info about the current Dynamic SQL in the package cache.. :

DECIMAL(100*(FLOAT(TOTAL_CPU_TIME)/SUM_TAB.SUM_CPU),5,2) AS PCT_TOT_CPU, NUM_EXECUTIONS, STMT_EXEC_TIME, DECIMAL(100*(FLOAT(STMT_EXEC_TIME)/SUM_TAB.SUM_EXEC),5,2) AS PC

T_TOT_EXEC FROM TABLE(MON_GET_PKG_CACHE_STMT ( 'D', NULL, NULL, -2)) AS T, SUM_TAB ORDER BY ROWS_READ DESC FETCH FIRST 15 ROWS ONLY WITH UR;



The results looks like this:

INSERT_TIMESTAMP STATEMENT ROWS_READ PCT_TOT_RR TOTAL_CPU_TIME PCT_TOT_CPU NUM_EXECUTIONS STMT_EXEC_TIME PCT_TOT_EXEC

-------------------------- ---------- -------------------- ---------- -------------------- ----------- -------------------- -------------------- ------------

2015-01-23-03.03.02.765094 select m.c 46773278079 83.56 20991569835 27.73 93769 21308997 26.70



As you can see this Statement was executed 9376... Does this means the SQL statement was entered into the Package cache at 2015-01-23-03.03: AM this morning and since than it has executed over 93,000 times! Right now is 3:55 PM, which means around 13 hours that many times was executed!



I need to get some scope on what the duration is that this data represents.

According to DB2 9.7 Doc. for MON_GET_PKG_CACHE_STMT table function (http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.sql.rtn.doc/doc/r0055017.html?cp=SSEPGG_9.7.0%2F3-6-1-3-9-25) they’re saying:



insert_timestamp - Insert timestamp monitor element

The time when the statement or section was inserted into the cache. For dynamic sql snapshots this represents the time when the statement entered the cache. For MON_GET_PKG_CACHE_STMT, MON_GET_PKG_CACHE_STMT_DETAILS and the package cache event monitor, the value is more granular and represents the time when an individual section for this statement was inserted into the cache....



Also, is there a way I can find out when was the last time this SQL statement was executed?
Jan 26 '15 #1
0 1295

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Koen Van Herck | last post by:
For debugging/logging purposes, I have a function def Log(msg): print '%s.%s: %s' % (cls, method, msg) I call this function from a class method, and I would like to retrieve the name of the...
2
by: M Shafaat | last post by:
Hi, I want to develop an application with menus. I want to make only one event handler method which handles a whole group of menu items by firstly identifying which MenuItem sends the click event...
2
by: Torben Jensen | last post by:
Hi, Does anyone have experience in retrieveing useraccount information like eg. name, lastname, phonenumber, adress etc from Active Directory from an asp.net application? Perhaps standard...
0
by: S.Mark | last post by:
Is there a way to capture Microsoft SQL Server's PRINT statement in stored procedures with ADO .Net I found this KB article but it apply only on ADO and not ADO .NET...
13
by: Ashley Bryant | last post by:
I'm just starting my first 2.0 site with the new membership features and am having some trouble with profiles. I have my providers set up and working fine and profile data is being written to the...
1
by: bubblegum | last post by:
I am working on a script that will retrieve process info from a Linux, a Windows, a Suse and a Solaris hosts. I run this script from a RedHat 2.6 machine. The first problem I have is how to get...
0
by: buzdugans | last post by:
How to retrieve info about Network Interface Card under JAVA or other language
0
by: Robert Bravery | last post by:
Hi all, Using VS 2005 and MSSQL 2005. I created a view with the following: select Brandid , products = left(o.list, len(o.list)-2) from lstBrand cross apply ( select Convert(varchar(200),...
1
by: Mido Moonlite | last post by:
Hi, i've created a linked table in my access database (with DoCmd.TransferDatabase). But how can i retrieve the info about that table? i'd like to know where the path of the original database...
2
by: Alvin Alvin | last post by:
I have an asp page and i want to know the employee info with out using log in page. I am using the following code to retrieve the current user: Dim currentADUser As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.