Wednesday, March 28, 2007

XPLAN PLANS Made Easy

Found this on David Aldridge's blog ... http://oraclesponge.wordpress.com

he DBMS_XPLAN supplied package gives results that are so much more usable than the old "set autotrace traceonly explain", or any manual method of reading the plan_table, that the only thing holding me back from using it more often was the lengthy syntax.

No more: I have created views to save my aching fingers. Feel free to use them, modify them, whatever for your own purposes -- just don't blame me if they break something ;)

create or replace view xplan_basic as
select * from table(dbms_xplan.display('plan_table',null,'BASIC'));*

create or replace view xplan_typical as
select * from table(dbms_xplan.display('plan_table',null,'TYPICAL'));

create or replace view xplan_parallel as
select * from table(dbms_xplan.display('plan_table',null,'ALL'));

create or replace view xplan_serial as
select * from table(dbms_xplan.display('plan_table',null,'SERIAL'));

I am now a mere "select * from xplan_parallel" away from my execution plans.

Thanks David.