Site icon Database Tutorials

Displaying Execution Plans With sqlplus

 

We can also display the execution plan with sqlplus. For this we can use the explain plan tool with sqlplus.

To use the Explain plan tool, the PLAN_TABLE table must be present under the corresponding schema. Some tools, such as Toad, will automatically create this table when you first view the execution plan. You can also create this table as below.

Display the execution plan of the query:

When we run the “set autotrace traceonly explain” command before the query runs as above, the query will no longer produce output and only the execution plan will be displayed.

Exit mobile version