Dec 26, 2019

Oracle SQL-PLAN based on SQL query

To generate the cost for the query based on single table or a group of table pls follow the below syntax in TOAD / SQL Developer,

Step 1:

EXPLAIN PLAN FOR
select * from ap_suppliers;

Result =>
Explained.

Step 2:

select plan_table_output from table(dbms_xplan.display('plan_table',null,'basic'));

 Result =>
------------------------------------------
| Id  | Operation         | Name         |
------------------------------------------
|   0 | SELECT STATEMENT  |              |
|   1 |  TABLE ACCESS FULL| AP_SUPPLIERS |
------------------------------------------

Step 3:

select plan_table_output from table(dbms_xplan.display_cursor(null,null,'basic'));

 Result =>

EXPLAINED SQL STATEMENT:
------------------------
select plan_table_output from table(dbms_xplan.display('plan_table',null
,'basic'))

Plan hash value: 2137789089

-----------------------------------------------------
| Id  | Operation                         | Name    |
-----------------------------------------------------
|   0 | SELECT STATEMENT                  |         |
|   1 |  COLLECTION ITERATOR PICKLER FETCH| DISPLAY |
-----------------------------------------------------

Useful Workflow Commands

  WFLOAD apps/columbus789 0 Y DOWNLOAD APEXP_FINDEV.wft APEXP Locations: $PO_TOP/patch/115/import/US/porpocha.wft $PO_TOP/patch/115/import/U...