Wednesday, November 24, 2010

explain plan

Explain plan


steps:-

1. create plan table (global temporary table)
  sqlplus / as sysdba
 @?/rdbms/admin/catplan

2. populate plan table
   Note : 235530.1
   SQL> explain plan for
             

3. Displaying The Execution Plan

SQL> set linesize 150 
>  select plan_table_output from table(dbms_xplan.display('PLAN_TABLE',null,'ALL'));

Or > select * from  table(dbms_xplan.display('plan_table',null,'serial'));

Or > select * from table(dbms_xplan.display);
 
Or >  @?/rdbms/admin/utlxpls

Or > select * from table(dbms_xplan.display(null, null));

Or  > select plan_table_output from table(dbms_xplan.display('plan_table',null,'advanced'));

  More details can be found in $ORACLE_HOME/rdbms/admin/dbmsxpln.sql

Hope this helps. Regards Rupam