Home » RDBMS Server » Performance Tuning » Generate the execution plan for a stored procedure !!
Generate the execution plan for a stored procedure !! [message #159422] Sun, 19 February 2006 01:31 Go to next message
AlinaC
Messages: 45
Registered: November 2005
Location: India
Member


How we can generate the execution plan for a stored procedure by its name?

Regards,

Alina
Re: Generate the execution plan for a stored procedure !! [message #159460 is a reply to message #159422] Sun, 19 February 2006 20:14 Go to previous message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
I don't believe that it is possible.

The procedural components of PL/SQL do not require a plan, but the embedded SQL statements do. To get the EXPLAIN PLAN of each of these, you have to cut them out into a separate file and explain them. When you do this, you must place a colon ':' before each of the PL/SQL variables in the SQL, otherwise the parser will think they are columns that do not exist.

An easier way is to trace (SQL Trace) a run of the procedure (assuming it is performing well enough to actually finish). Then use TK*Prof to read the trace file. It will show you the plan for every SQL. See the Oracle Utilities Manual for good instructions on using SQL Trace and TK*Prof.
_____________
Ross Leishman
Previous Topic: help with outer join
Next Topic: fragmented tables and indexes
Goto Forum:
  


Current Time: Sat Nov 23 14:41:52 CST 2024