How do I get the explain plan oracle?
Can someone please explain a bit about explain plan, and how does one get the explain plan for a query. Also, if there is any sql script which can be used as a utility for this, that would be great.
To get the explain plan oracle, you can use the package DBMS_XPLAN:
SQL> explain plan for select * from dual;
Explained
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 2 | 2 |
| 1 | TABLE ACCESS FULL | DUAL | 1 | 2 | 2 |
--------------------------------------------------------------------
Note: cpu costing is off