Forum OpenACS Q&A: Re: explain in oracle?

Collapse
3: Re: explain in oracle? (response to 2)
Posted by jerry arns on
Here is how you can trace what queries are done by your client software.

First, enable trace on your client session. To do so, you must find the SID and session# of your client session.
How ? You may query the v$session view or look in the Instance tab of Oracle Entreprise Manager.
Then, logon in SQL*Plus as sysdba and issue an:

EXECUTE dbms_system.set_sql_trace_in_session(SID, session#,TRUE)

When you want to stop tracing:
EXECUTE dbms_system.set_sql_trace_in_session(SID, session#,FALSE)

You will find your trace in the user_dump_dest directory.

You may now process your trace file with TKPROF. It's a binary, run it from a command line, with option EXPLAIN=YES.

That's it. Edit the file you got from tkprof and look at stats.