Sunday 29 May 2011

How to generate the SQL execution plan for a current SQL run by a session

From 10g onwards, generating the SQL execution plan for a current session has become easire. Simply get the SQL_ID and SQL_CHILD_PLAN from v$session view and feed it in the below statement:

select * from table(dbms_xplan.display_cursor('&SQL_ID','&SQL_CHILD_NUMBER'));



And you will have you execution plan generated on your screen which is being used by the session running an SQL statment.

No comments:

Post a Comment