Get Plan via SQL*Plus Autotrace

You need to have a PLAN_TABLE created before running this, see here how to do this.
log into sqlplus as SYS

@$ORACLE_HOME/sqlplus/admin/plustrce.sql
grant plustrace to public;

then

set autotrace on
select table_name from user_tables where table_name like '%E';

will give you something like

TABLE_NAME
------------------------------
(data)

379 rows selected.


Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=CHOOSE
   1    0   NESTED LOOPS
   2    1     NESTED LOOPS (OUTER)
   3    2       NESTED LOOPS (OUTER)
   4    3         NESTED LOOPS (OUTER)
   5    4           NESTED LOOPS (OUTER)
   6    5             NESTED LOOPS
   7    6               TABLE ACCESS (BY INDEX ROWID) OF 'OBJ$'
   8    7                 INDEX (RANGE SCAN) OF 'I_OBJ2' (UNIQUE)
   9    6               TABLE ACCESS (CLUSTER) OF 'TAB$'
  10    9                 INDEX (UNIQUE SCAN) OF 'I_OBJ#' (NON-UNIQUE)
  11    5             TABLE ACCESS (BY INDEX ROWID) OF 'OBJ$'
  12   11               INDEX (UNIQUE SCAN) OF 'I_OBJ1' (UNIQUE)
  13    4           INDEX (UNIQUE SCAN) OF 'I_OBJ1' (UNIQUE)
  14    3         TABLE ACCESS (CLUSTER) OF 'USER$'
  15   14           INDEX (UNIQUE SCAN) OF 'I_USER#' (NON-UNIQUE)
  16    2       TABLE ACCESS (CLUSTER) OF 'SEG$'
  17   16         INDEX (UNIQUE SCAN) OF 'I_FILE#_BLOCK#' (NON-UNIQUE)
  18    1     TABLE ACCESS (CLUSTER) OF 'TS$'
  19   18       INDEX (UNIQUE SCAN) OF 'I_TS#' (NON-UNIQUE)

Statistics
----------------------------------------------------------
        324  recursive calls
          0  db block gets
       6062  consistent gets
        562  physical reads
          0  redo size
       8084  bytes sent via SQL*Net to client
        451  bytes received via SQL*Net from client
         27  SQL*Net roundtrips to/from client
         11  sorts (memory)
          0  sorts (disk)
        379  rows processed

AUTOTRACE Options

SET AUTOTRACE OFF           - switch AUTOTRACE OFF
SET AUTOTRACE ON EXPLAIN    - show only the optimizer execution path
SET AUTOTRACE ON STATISTICS - show only the execution statistics
SET AUTOTRACE ON            - show both the optimizer execution path
                              and execution statistics
SET AUTOTRACE TRACEONLY     - like SET AUTOTRACE ON, but suppress output
Comments (0)