Saari Development

Ali Rizvi's Technical Blog as a Professional Software Development Engineer

Oracle: Explain Plan from SQLPlus

leave a comment »

I have been spoiled by simple way for getting a explain plan from MySQL and web tools for oracle.

Today somebody asked me how to get an explain plan from oracle command line sqlplus and I discovered it is a little painful. Here is what I found out:

explain plan for select * from shiny_complex_table;

select
  substr (lpad(' ', level-1) || operation || ' (' || options || ')',1,30 ) "Operation",
  object_name                                                              "Object"
from
  plan_table
start with id = 0
connect by prior id=parent_id;

Reference: http://www.adp-gmbh.ch/ora/explainplan.html

Advertisements

Written by imsaar

October 13, 2009 at 2:32 am

Posted in database, oracle

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: