Archive

Posts Tagged ‘autotrace’

How to trace a SQL session

October 21, 2010 Leave a comment

To trace an SQL session in SQL*Plus you need to set autotrace on:

SQL> set autotrace on

Setting autotrace allows to display some statistics and/or a query execution plan for DML statements.

set autotrace on Shows the execution plan as well as statistics of the statement.
set autotrace on explain Displays the execution plan only.
set autotrace on statistics Displays the statistics only.
set autotrace traceonly Displays the execution plan and the statistics (as set autotrace on does), but doesn’t print a query’s result.
set autotrace off Disables all autotrace
Categories: oracle, SQL*Plus Tags: , ,