Thursday, 23 September 2010

Oracle: Check SQL Query Execution Plan

Steps to verify SQL query execution plan:

1. Use below query to explain plan for SQL query
    
    explain plan for <select_query>

    Example:     explain plan for select 1 from dual;

2. Viewing plan using below query

     SELECT * FROM   TABLE(DBMS_XPLAN.DISPLAY);

For more detail : http://www.oracle-base.com/articles/9i/DBMS_XPLAN.php