Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Slow log

1 view
Skip to first unread message

iavian

unread,
May 10, 2008, 9:15:00 PM5/10/08
to
How to log all the queries that takes more than n seconds .. like
mysql show query log

Mladen Gogala

unread,
May 11, 2008, 2:29:27 PM5/11/08
to
On Sat, 10 May 2008 18:15:00 -0700, iavian wrote:

> How to log all the queries that takes more than n seconds .. like mysql
> show query log

FGA (fine-grained auditing) might be helpful. Also, you may write
a script that will query V$SQL and extract SQL by the elapsed time.
However, querying that table hits the library cache latch every time.
Don't do it too often.

--
Mladen Gogala
http://mgogala.freehostia.com

Mark D Powell

unread,
May 11, 2008, 4:17:24 PM5/11/08
to


Statspack will catpure heavy hitter SQL depending on the selected
level of the snapshots you take. With 10g the AWR processes also
capture heavy hitter SQL though these two options may not capture all
SQL you want it is probably from a practical point of view good
enough.

You can use the trace facility to trace specific tasks of interest.
While possible I would not set it on to trace every session connected
to the database as this will generate way too much data most of which
you will not care about.

HTH -- Mark D Powell --

0 new messages