Saturday, July 12, 2008

To see explain plan of oracle query

There are two ways to view explain plan

1. Go to sql prompt

set autotrace traceonly explain
select 1 from dual
set autotrace off

2. Go to sql prompt
EXPLAIN PLAN FOR
select 1 from dual

and then select from DBMS_XPLAN.DISPLAY table that stores the explain plan for last executed query

SELECT * FROM table(DBMS_XPLAN.DISPLAY);

Sphere: Related Content

0 comments: