Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: STAT from trace
That's not true. The STAT lines in the 10046 trace have nothing to do with
parsing. But you must close the cursor for them to be written to the trace.
If you are using sqlplus, either close the trace or the session, otherwise
sqlplus keeps the cursor for the most recent sql open.
Here is an exctract from a trace where I execute the same sql twice in a row. You can even see the "alter session command".
PARSING IN CURSOR #1 len=84 dep=0 uid=31 oct=3 lid=31 tim=926359
hv=1785040157 ad='313afe4'
select t1.d1, t1.d2, t2.d1, t2.d2
from t1, t2
where t2.fk1=t1.pk1
and t2.d2 = 499
END OF STMT
PARSE #1:c=200,e=258,p=25,cr=401,cu=6,mis=1,r=0,dep=0,og=4,tim=926361
EXEC #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=926362
FETCH #1:c=0,e=2,p=2,cr=2,cu=0,mis=0,r=0,dep=0,og=4,tim=926364 STAT #1 id=1 cnt=0 pid=0 pos=0 obj=0 op='HASH JOIN ' STAT #1 id=2 cnt=0 pid=1 pos=1 obj=134295 op='TABLE ACCESS BY INDEX ROWID T2 ' STAT #1 id=3 cnt=1 pid=2 pos=1 obj=134372 op='INDEX RANGE SCAN ' STAT #1 id=4 cnt=0 pid=1 pos=2 obj=134293 op='TABLE ACCESS FULL T1 ' =====================
WAIT #1: nam='SQL*Net message from client' ela= 1021 p1=1413697536 p2=1 p3=0 WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1413697536 p2=1 p3=0 WAIT #1: nam='SQL*Net message from client' ela= 0 p1=1413697536 p2=1 p3=0 =====================
EXEC #1:c=1,e=1,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=4,tim=929377 WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1413697536 p2=1 p3=0 WAIT #1: nam='SQL*Net message from client' ela= 0 p1=1413697536 p2=1 p3=0 WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1413697536 p2=1 p3=0 WAIT #1: nam='SQL*Net message from client' ela= 0 p1=1413697536 p2=1 p3=0 =====================
and t2.d2 = 499
END OF STMT
PARSE #1:c=3,e=3,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=929382
EXEC #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=929383
WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1413697536 p2=1 p3=0
FETCH #1:c=1,e=1,p=0,cr=2,cu=0,mis=0,r=0,dep=0,og=4,tim=929384
WAIT #1: nam='SQL*Net message from client' ela= 0 p1=1413697536 p2=1 p3=0 STAT #1 id=1 cnt=0 pid=0 pos=0 obj=0 op='HASH JOIN ' STAT #1 id=2 cnt=0 pid=1 pos=1 obj=134295 op='TABLE ACCESS BY INDEX ROWID T2 ' STAT #1 id=3 cnt=1 pid=2 pos=1 obj=134372 op='INDEX RANGE SCAN ' STAT #1 id=4 cnt=0 pid=1 pos=2 obj=134293 op='TABLE ACCESS FULL T1 ' WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1413697536 p2=1 p3=0 WAIT #1: nam='SQL*Net message from client' ela= 0 p1=1413697536 p2=1 p3=0 =====================
EXEC #1:c=2,e=2,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=4,tim=929391 WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1413697536 p2=1 p3=0 WAIT #1: nam='SQL*Net message from client' ela= 0 p1=1413697536 p2=1 p3=0 WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1413697536 p2=1 p3=0*** 2003-10-01 09:40:14.219
At 08:54 AM 10/1/2003, you wrote:
>Hi!
>
>This is the problem, that everything else was identical. If you executed
>exactly the same query again, it didn't get hard parsed anymore, thus no
>STAT lines were generated. Either flush shared pool or just add some bogus
>comment using /* */ into your query to get parsing and STAT lines.
>
>Tanel.
>----- Original Message -----
>To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
>Sent: Wednesday, October 01, 2003 4:34 PM
>
>
> > I was creating some trace files yesterday and came across one of these
> > problems that shows up occasionally (then I forget about it).
> >
> > When I ran my query using ALTER SESSION SET sql_trace=true (sqlplus;
> > 8.1.7.4), I got the STAT line in the trace and the associated 'row source'
> > information after running tkprof.
> >
> > When I ran my query using ALTER SESSION SET EVENTS '10046 trace name
>context
> > forever, level 8' (or with dbms_system.set_ev), there were no STAT entries
> > for my query. There were some for some of the recursive queries.
> >
> > Everything else was identical.
> >
Wolfgang Breitling
Oracle7, 8, 8i, 9i OCP DBA
Centrex Consulting Corporation
http://www.centrexcc.com
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Wolfgang Breitling INET: breitliw_at_centrexcc.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- 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 Oct 01 2003 - 11:49:32 CDT