Title: RE: Trace file with tkprof

> -----Original Message-----
> From: Chuan Zhang [mailto:[EMAIL PROTECTED]]
>
> Is there any way to get the same execution statistics between
> the finished sql statement and interrupted sql statement?
>
> Supposed table A have ten million rows.
>
> If select A.a, A.b from A where ..., in sqlplus session,
> actually the returned could be millions. I could not wait for
> all the selected rows coming out. I have to interrupte it in
> the process. Could I still get the same execution statistics
> in trace file?
>
> The same happened to "set autotrace on" in sqlplus session. I
> could only see the execution plan at the end of execution.


Would "set autotrace traceonly explain" or "set autotrace traceonly explain statistics" do what you need?
From the SQL*Plus manual, SET command:
AUTOT[RACE] {ON|OFF|TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]

Displays a report on the execution of successful SQL DML statements (SELECT, INSERT, UPDATE or DELETE). The report can include execution statistics and the query execution path.

OFF does not display a trace report. ON displays a trace report. TRACEONLY displays a trace report, but does not print query data, if any. EXPLAIN shows the query execution path by performing an EXPLAIN PLAN. STATISTICS displays SQL statement statistics. Information about EXPLAIN PLAN is documented in the Oracle9i SQL Reference manual.

Using ON or TRACEONLY with no explicit options defaults to EXPLAIN STATISTICS.

The TRACEONLY option may be useful to suppress the query data of large queries. If STATISTICS is specified, SQL*Plus still fetches the query data from the server, however, the data is not displayed.

The AUTOTRACE report is printed after the statement has successfully completed.

Information about Execution Plans and the statistics is documented in the Oracle9i Performance Guide and Reference manual.

When SQL*Plus produces a STATISTICS report, a second connection to the database is automatically created. This connection is closed when the STATISTICS option is set to OFF, or you log out of SQL*Plus.

Reply via email to