Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Does EXEC do a FETCH?
I've been spending some time on my system trying to do time accounting by
comparing output from sqlnet trace files and 10046 traces. While doing this,
I've realized I don't understand what is going on with the EXEC and FETCH
calls with simple SELECT statements. (this is on a 10.2.0.3 db RedHat 2.6.9)
I ran a simple test case which returned a single record. From looking at the 10046 trace it appears as though the data is sent to the client before the FETCH call. Huh? Is the initial FETCH actually coupled with the EXEC and just broken out in the trace file at a later time?
So after the EXEC, a packet is sent to the client followed by a FETCH of one record (r=1). After getting confirmation back from the client (message from client wait), sqlplus does its final FETCH confirming no more data, and sends this to the client (message to client). The client then responds with the next sql to parse.
Looking at the sqlnet trace (level=SUPPORT), I see the following packets:
So the data is sent from the server to the client prior to the initial FETCH. The second FETCH confirms no more data and that is sent to the client after the FETCH.
I am wondering if the initial EXEC actually does EXEC and FETCH, and the explicit FETCH call is just bookkeeping, not the real work. Maybe the Oracle kernal changed the way it does its work, but the 10046 display hasn't been adjusted accordingly.
Has anyone else seen this? Are there any other explanations?
Thanks.
Henry
-- http://www.freelists.org/webpage/oracle-lReceived on Fri Jul 13 2007 - 13:15:09 CDT
![]() |
![]() |