Home » RDBMS Server » Performance Tuning » Currently Executing statement not available in Trace file- Oracle 10g
Currently Executing statement not available in Trace file- Oracle 10g [message #260387] Sun, 19 August 2007 07:35 Go to next message
orasaket
Messages: 70
Registered: November 2006
Member
Hi,

I am using Oracle 10g R2 on Linux.

I am tracing session(tkprof) which is executing procedure with many sql queries and DML statements in it.

In the start of the procedure we have a problematic sql statement.

By the time i start tracing the session, the sql query is fired and when i open the trace file i found all the statements excluding the first one, which started EXECUTING by the time i start tracing.

I can not change to code to put dbm_lock.sleep before, or execute immediate 'alter session.. or execute the query from outside

However since many times i faced this problem, i want to know, Is it a normal behavoir of SQL tracing that, currently executing is not recorded in the Trace file? Is there any way around to get it recorded in the trace file?

Thanks and Regards,
OraSaket.
Re: Currently Executing statement not available in Trace file- Oracle 10g [message #260399 is a reply to message #260387] Sun, 19 August 2007 09:48 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Is it a normal behavoir of SQL tracing that, currently executing is not recorded in the Trace file?

Yes
Quote:
Is there any way around to get it recorded in the trace file?

Start the trace before the query starts to execute.

Regards
Michel
Re: Currently Executing statement not available in Trace file- Oracle 10g [message #260406 is a reply to message #260387] Sun, 19 August 2007 10:33 Go to previous messageGo to next message
orasaket
Messages: 70
Registered: November 2006
Member
Thanks Michel.

I wasn't knowing this

In fact i was thinking that i am missing something at my end while enabling the trace.

Regards,
OraSaket
Re: Currently Executing statement not available in Trace file- Oracle 10g [message #260420 is a reply to message #260406] Sun, 19 August 2007 12:34 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If you have a look at trace file you see there are lines for
- parse
- execute
- fetches
and between them for waits and at the end, for execution plan
If you start the trace after the parse you don't have parse lines and so on.
tkprof ignores a SQL statement if the trace is not complete for it.

Regards
Michel
Re: Currently Executing statement not available in Trace file- Oracle 10g [message #260438 is a reply to message #260420] Sun, 19 August 2007 22:00 Go to previous message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
If the problem is important enough, you can also ask the DBA to switch tracing on for the entire database.

Ross Leishman
Previous Topic: Currently executing statement for Oracle Job- Oracle 10g
Next Topic: How to implement SQL changes when tuning
Goto Forum:
  


Current Time: Sat Dec 03 18:27:06 CST 2016

Total time taken to generate the page: 0.05331 seconds