Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Timed statistics and SQL_TRACE for already running session
This should do it; (works for me - I'm on 8.1.6.3)
as system/manager...
select sid,serial# from v$session where ...(to get process you want to
enable trace for);
exec dbms_system.set_sql_trace_in_session(<sid>,<serial#>,true);
exec
dbms_system.set_bool_param_in_session(<sid>,<serial#>,'timed_statistics',tru
e);
Have user run query. Get trace file from udump dir and run tkprof. All stats and timings are there. Thanks for the pointer to this great system procedure Jonathan!
-----Original Message-----
Lewis
Sent: Wednesday, August 08, 2001 1:56 PM
To: Multiple recipients of list ORACLE-L
Which version of Oracle.
>From 8.1.6 onwards, dbms_system contains
a call similar to set_sql_trace_in_session
which is name something like:
set_boll_param_in_session. Describe
dbms_system to check the proper
nmame and parms.
Jonathan Lewis
Seminars on getting the best out of Oracle Last few places available for Sept 10th/11th See http://www.jlcomp.demon.co.uk/seminar.html
-----Original Message-----
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
Date: 08 August 2001 16:29
|
|I used the following syntax/package to run a trace on a user's
already
|running
|session.
|
|EXECUTE dbms_system.set_sql_trace_in_session(8,12,TRUE);
|
|I then ran tkprof on the resulting trace file. It all worked fairly
well
|but
|I didn't get any times on any of the statements that executed.
|
|Is there a way to use timed_statistics with this package?
|Or must I turn on timed statistics for the entire database?
|
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jonathan Lewis INET: jonathan_at_jlcomp.demon.co.uk Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Glenn Travis INET: c-glenn.travis_at_wcom.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Aug 08 2001 - 14:25:24 CDT
![]() |
![]() |