/* ************************************************ */
/*                                                  */
/* Author            : Rick Kupcunas                */
/*                   : rick@kupcunas.com            */
/* Name		     : qep_3.sql                    */
/*     @C:\rkupcuna05_ora\OracleDBA\SQL\qep_3.sql      */
/* Original          : 2009-Oct-01                  */
/*                                                  */
/* This script will:                                */
/*   Generate the explain plan for the SQL tested   */
/*                                                  */
/* To run perform the following:                    */
/*  1. replace my initials 'RWK' with your initials */
/*                                                  */
/* Note: run as the "system" user                   */
/*                                                  */
/* Note: Output will be stored in 'qep_3.rslt'      */
/*                                                  */
/* ************************************************ */

spool qep_3.rslt;

select decode(id,0, '',
    LPAD(' ',2*(LEVEL-1))||level||'.'||position)||' '||
    operation||' '||options||' '||object_name||' '||
    object_type||' '||
    DECODE(id, 0 ,'Cost = '||position) "Query Plan"
        from PLAN_TABLE
    connect by prior id = parent_id and 
        statement_id = 'RWK'
    start with id = 0 and statement_id = 'RWK';
        

spool off;










