473,406 Members | 2,549 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,406 software developers and data experts.

DB2 equivalent to Oracle:Trace or SQL Profiler?

Does anyone know what the DB2 equivalent is for Oracle:Trace or SQl Server
Profiler ?

Thanks
Gary
Nov 12 '05 #1
9 11130
What do they do? there is a db2trc command, but it's for problem
determination. Performance data can be gathered with the snaphot and
event monitors. DB2 v8 also ships with a memory visualizer. DB2 Query
Patroller can trap SQL from users (to schedule it later, or just if you
want to know what ad hoc SQL is sent).

GDCII wrote:
Does anyone know what the DB2 equivalent is for Oracle:Trace or SQl Server
Profiler ?

Thanks
Gary


Nov 12 '05 #2
Gary,

Take a look at the statement event monitor and tell me whether that's
what you are looking for. If you need to profile SQL Procedures I can help.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #3
In oracle, one can set sql_trace for a particular session identified
by sid. There is option flag to show the bind variables/values, waits
etc. Is there any mechanism of doing that using DB2 selectively for an
applid or agentid?

Thanks,
DA.

Serge Rielau <sr*****@ca.eye-be-em.com> wrote in message news:<c0**********@hanover.torolab.ibm.com>...
Gary,

Take a look at the statement event monitor and tell me whether that's
what you are looking for. If you need to profile SQL Procedures I can help.

Cheers
Serge

Nov 12 '05 #4
Take a look at event monitors.
E.g the statement event monitor. It won't tell you the bind values, but
it will tell you all kinds of other interesting stuff such as CPU time,
I/O, sorts, etc...

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #5
Hey Serge,

I think a nice addition to DB2 would be the capabaility to do some kind of
tracing on a statement and then have it show like a explain plan.
But this time instead with estimated values, the true values.

We sometimes noticed that the explain plan and estimates there is not what
the we have in actuality. By having functionality like this
one could then look at the explain plan with true values to determine what
one might need to do to help the optimizer choose a better plan or where
something else might need to be done to further optimize it.

Thanks.

"Serge Rielau" <sr*****@ca.eye-be-em.com> wrote in message
news:c1**********@hanover.torolab.ibm.com...
Take a look at event monitors.
E.g the statement event monitor. It won't tell you the bind values, but
it will tell you all kinds of other interesting stuff such as CPU time,
I/O, sorts, etc...

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #6
Erik,

Indeed. Such a facility is part of the LEO project (after all a learning
optimizer must do the bean-counting before it can learn).

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #7
Thanks Serge,

The information is indeed very helpful. I am able to set the event for
a particular applid and trace the stements issued.

Will there be an enhancement (or is it already there) to show the path
the optimizer really took executing the statements. (I am looking for
something similar to sql_trace, "set events 10046 .., level n" in
oracle).

Note: I can extract the SQLs from dbevmon output and do the explain.
But this doesn't gaurantee that the plan generated when doing explain
is same as the one while executing the dynamic statement (something
might have changed by then).

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

Serge Rielau <sr*****@ca.eye-be-em.com> wrote in message news:<c1**********@hanover.torolab.ibm.com>...
Erik,

Indeed. Such a facility is part of the LEO project (after all a learning
optimizer must do the bean-counting before it can learn).

Cheers
Serge

Nov 12 '05 #8
Hey Serge,

Great, so when will this go into a version? :-)

"Serge Rielau" <sr*****@ca.eye-be-em.com> wrote in message
news:c1**********@hanover.torolab.ibm.com...
Erik,

Indeed. Such a facility is part of the LEO project (after all a learning
optimizer must do the bean-counting before it can learn).

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #9
If you monitored a dynamic statement you get its text delivered in the
event monitor. That can be passed into either db2expln or, via EXPLAIN
PLAN FOR to db2exfmt. As long as you haven't run runstats in between you
should be fine.

If you want to capture dynamic sql statements as they get executed take
a look at:
SET CURRENT EXPLAIN MODE = YES

You can then use db2exfmt to get the plans and they will be guranteed to
be the ones executed.

Cheers
Serge

PS: I can't speak for others, but my knowledge of Oracle is limited.
Best explain the feature you are referring to. While I enjoy perusing
competitor's docs I often can't afford the time :-(

PPS: To answer Erik's question: I don't know. And if I knew I could only
tell you it were in Stinger.

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alex Smith | last post by:
Hi all, I have an application that uses Oracle's JDBC thin driver 9.0.x to have a nice, friendly chat with 8.1.x database. During this exchange the server rudely interrupts the conversation and...
13
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports...
2
by: Oxmard | last post by:
Armed with my new O'Reilly book Optimizing Oracle Performance I have been trying to get a better understanding of how Oracle works. The book makes the statement, " A database cal with dep=n + 1...
1
by: Terry Coccoli | last post by:
After opening up a ticket with a 3rd party vendor to find out what SQL they use behind the scenes, they advised and gave me instructions on running an Oracle trace. Basically, they told me to...
3
by: serge | last post by:
What is the MS SQL Profiler equivalent in DB2 8.2? Thank you
0
by: petro | last post by:
I am trying to deploy an asp.net application to my web server. My application uses system.data.oledb to connect to an oracle database. On my development machine I have the oracle client 10g...
5
by: petro | last post by:
Hello all, My asp.net web application works on my machine but I get the following error on our test web server, There is only one oracle home on the test server. Does anyone know how to resolve...
4
by: BookerW | last post by:
I am not sure which forum I should post this on, but here is the problem. I have a front end web application(VB) on asp,net 1.1 framework. Inside of the code, I have the following lines to...
2
by: Vinod Sadanandan | last post by:
All, Below listed are the new features in Oracle 11g ,please join me in this discussion to generate a testcase and analyze each of the listed features . Precompilers:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.