Home > oracle, SQL*Plus > How to trace a SQL session

How to trace a SQL session

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
Advertisements
Categories: oracle, SQL*Plus Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: