Unix Technical Forum

Monitoring Stored Procedure Usage

This is a discussion on Monitoring Stored Procedure Usage within the DB2 forums, part of the Database Server Software category; --> Hi I want to see how often individual stored procedures are being called. Does anybody have any ideas how ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 10:48 AM
Tim Jacobs
 
Posts: n/a
Default Monitoring Stored Procedure Usage

Hi
I want to see how often individual stored procedures are being called.
Does anybody have any ideas how I could achieve this? (Running 7.2 on
Solaris)
Thanks
Tim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 10:48 AM
Larry Menard
 
Posts: n/a
Default Re: Monitoring Stored Procedure Usage

The first thing I can think of would be a Statement Event Monitor.
--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of All Things Natural


"Tim Jacobs" <tim.jacobs@t-systems.co.uk> wrote in message
news:62f6e8bf.0307010548.36b7d4b4@posting.google.c om...
> Hi
> I want to see how often individual stored procedures are being called.
> Does anybody have any ideas how I could achieve this? (Running 7.2 on
> Solaris)
> Thanks
> Tim



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 10:49 AM
Evan Smith
 
Posts: n/a
Default Re: Monitoring Stored Procedure Usage

Having done (or at least valiantly attempted to do) this several
times, there are a couple things you need to know about. The statement
monitor will provide you access to all of the SQL calls going into the
database. If you're using SQL stored procedures you will not see the
stored procedure name, but rather the package associated with that
name in the event monitor output. You'll have to massage the output
and correlate the pkgnames with the actual SP name to get an idea of
what's being called when.

If you're using Java stored procs as we are, you may be out of luck.
(If someone knows any different, please speak up!) Since there is no
package associated with a Java stored proc, the only thing that you'll
see in the event monitor output is the raw SQL statements executed by
the Java SPs. You'll manually have to correlate those SQL statements
back to the Java source code to get an idea of executions of the
stored procs. So far this has proved to be pretty tedious. If your SQL
is unique and readily identifiable and only called from one SP, then
this might not be so bad.

Hope this helps!

Evan


"Larry Menard" <lmenard@ca.ibm.com> wrote in message news:<bds6jt$99c$1@hanover.torolab.ibm.com>...
> The first thing I can think of would be a Statement Event Monitor.
> --
> Larry Menard
> IBM Workstation Database (DB2) Performance Team
> Defender of Geese and of All Things Natural
>
>
> "Tim Jacobs" <tim.jacobs@t-systems.co.uk> wrote in message
> news:62f6e8bf.0307010548.36b7d4b4@posting.google.c om...
> > Hi
> > I want to see how often individual stored procedures are being called.
> > Does anybody have any ideas how I could achieve this? (Running 7.2 on
> > Solaris)
> > Thanks
> > Tim

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 10:49 AM
Tim Jacobs
 
Posts: n/a
Default Re: Monitoring Stored Procedure Usage

Thanks guys, that's useful.
Tim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-26-2008, 10:49 AM
Sean McKeough
 
Posts: n/a
Default Re: Monitoring Stored Procedure Usage

Not helpful on v7...but for anyone interested in v8, call is a compiled
statement, so with the statement evmon you'll actually get the call
statement (complete with proc name) in the evmon output.

Tim Jacobs wrote:

> Hi
> I want to see how often individual stored procedures are being called.
> Does anybody have any ideas how I could achieve this? (Running 7.2 on
> Solaris)
> Thanks
> Tim


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-26-2008, 10:50 AM
Evan Smith
 
Posts: n/a
Default Re: Monitoring Stored Procedure Usage

Sean McKeough <mckeough@nospam.ca.ibm.com> wrote in message news:<bdump5$5uk$2@hanover.torolab.ibm.com>...
> Not helpful on v7...but for anyone interested in v8, call is a compiled
> statement, so with the statement evmon you'll actually get the call
> statement (complete with proc name) in the evmon output.


Even on Java SPs?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-26-2008, 10:50 AM
Sean McKeough
 
Posts: n/a
Default Re: Monitoring Stored Procedure Usage

Yep...in v7 call wasn't compled, so the call sql was never recorded by
the compiler, but now in the dynamic sql case it should be there...

Evan Smith wrote:

> Sean McKeough <mckeough@nospam.ca.ibm.com> wrote in message news:<bdump5$5uk$2@hanover.torolab.ibm.com>...
>
>>Not helpful on v7...but for anyone interested in v8, call is a compiled
>>statement, so with the statement evmon you'll actually get the call
>>statement (complete with proc name) in the evmon output.

>
>
> Even on Java SPs?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:29 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com