Thanks for the question, Srikanth.
Asked: June 10, 2016 - 7:07 pm UTC
Last updated: June 13, 2016 - 11:01 am UTC
Version: 11g
Viewed 1000+ times
You Asked
Hello,
I have a question on performance tuning. Please help me.
In 1st scenario, I have a procedure which was working fine till yesterday but suddenly it is performing slowly.
In 2nd scenario, the procedure performance is degrading slowly day by day
What are the initial steps I need to take, to overcome these issues?
Thanks in advance!!!!
and Connor said...
In either case, the key is knowing *where* the slow down is occurring. If a PL/SQL procedure consists of a single SQL, then its obvious, but often they have many, or call other procedures etc.
So firstly, run a trace
exec dbms_monitor.session_trace_enable(waits=>true);
exec your_plsql_proc;
exec dbms_monitor.session_trace_disable;
and then run tkprof on the resulting trace file. That now gives you a breakdown of where the time was lost.
The most typical cause for a sudden slow down is normally a poorly running SQL.
For slowly degrading performance, a common cause is looping structures, so on day 1, you loop around something 1 time, 2 times on day 2 etc etc....
But the trace is the key. If the trace does not reveal anything (for example, the plsql code does little or no SQL), then look at the pl/sql profiler to get similar information about the plsql code itself.
Rating
(2 ratings)
Is this answer out of date? If it is, please let us know via a Comment