Generate Explain Plan

Many times DBA came across the scenario, where one has to see the actual execution plan of the SQL. 

Using below steps, you will be able to generate execution plan for any SQL statement.

You have to use syntax “EXPLAIN PLAN FOR SQL STATEMENT”.

SQL> EXPLAIN PLAN FOR SELECT * FROM EMP; --Table Name

Execute below statement to see the execution plan of the SQL statement.

SQL> SELECT PLAN_TABLE_OUTPUT FROM TABLE(dbms_xplan.display());

You may analyze the plan and make relevant changes.

Disclaimer: 

This is an independent personal blog and is not affiliated with, sponsored by, or endorsed by Oracle Corporation. The views, explanations, and experiences expressed here are the author’s own. Commands, scripts, and procedures may be based on Oracle’s official documentation and are provided for educational and reference purposes only. Always test and validate them before use in a Live/Production environment. Sample output shown in this article was generated during the author’s own testing and may vary depending on the environment.

Please read full Disclaimer.