Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: explain in tkprof

Re: explain in tkprof

From: Charles Hooper <hooperc2000_at_yahoo.com>
Date: Wed, 01 Aug 2007 09:59:58 -0700
Message-ID: <1185987598.650719.320370@i38g2000prf.googlegroups.com>


On Aug 1, 12:14 pm, Eugene <epi..._at_gmail.com> wrote:
> Hi all,
> I am running Oracle 8.1.6.3 on Win NT4 and having a prblem displaying
> explain plan in tkprof.
> -----------------------------------------------------------------------
> set oracle_sid=sid
> tkprof ora00128.trc tk_out.txt sort=exeela,fchela explain=sys/
> pass_at_my_db;
> -----------------------------------------------------------------------
> I am getting an output file just fine, but w/out explain plan.
> File has the fillowing error it:ORA-12154: TNS:could not resolve
> service name,
> I can login using same usernam/pass in SQL*Plus however.
>
> Thanks,
> Eugene

David Fitzjarrell likely provided the answer that you need.

There is an interesting comment in Tom Kyte's "Expert Oracle One on One" book, pages 461-62, that relate to the use of EXPLAIN with TKPROF:
"I prefer to never use the EXPLAIN= however and would recommend the same for you. The reason is that the explain plan query may differ radically from the actual query used at run time. The only plan than can be trusted is the plan saved in the trace file itself."

If the "Row Source Operation" heading appears in the TKPROF output, that is the real plan. If it does not, directly open the trace file and search for "STAT #" (without the quotes). The STAT lines only print when the cursor is closed.

Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. Received on Wed Aug 01 2007 - 11:59:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US