Hi Tom,
Just wanted to share the metalink update with you and to seek few conceptual clarifications.
<METALINK>
17-AUG-05 11:16:07 GMT
Ok - the systemstate shows PROCESS 17 to be one the CPU:-
last wait for 'latch free' blocking sess=0x0 seq=36011 wait_time=2
address=3331c968, number=62, tries=0
temporary object counter: 0
This is ospid: 2304, so the errorstack should tell me something...
PROCESS 17 is running SELECT COUNT(*) FROM JOB_PARAMETERS continuously (like , millions of times!)
Stack is:-
_ksdxcb+626 CALLreg 00000000 699B890 11 3 699B840 699B93C
_ssthreadruncallbac CALLrel _ksdxcb+0
k+53
..1.16_4.filter.81+ CALLrel _kdstgr+0 E3D1F64
578
_qergsFetch+379 CALL??? 00000000
..1.3_1.filter.30+5 CALL??? 00000000 36B1E588 554CA8 699BE38 2
62
_opifch+76 CALLrel _opifch2+0 89 5 699BF70
_opiefn0+314 CALLrel _opifch+0 4E 6 699C270
_opipls+2338 CALLrel _opiefn0+0 4E 6 699C270 0 0 0 0 0 0 0
..1.1_1.filter.34+1 CALLreg 00000000 66 6 699CA9C
356
_rpidrus.43+153 CALLrel _opiodr+0 66 6 699CA9C 42
_skgmstack+113 CALLreg 00000000 699C5F4
It is called off here:-
----- PL/SQL Call Stack -----
object line object
handle number name
36BC8228 201 procedure WEBC_DATA.SPCSBULKDOWNLOAD
36BD5AB0 1 anonymous block
Hi,
Ok - You need to look at WEBC_DATA.SPCSBULKDOWNLOAD specifically the call to select count(*) from job_parameters
and why is is running it continuously - if you look at the trace file you sent
me, it contains 1.6Gb of lines which are just continuous calls of this SQL. It
looks to be that some logic in the code in your app is the problem. I would sugg
est, if it is designed to spin continuously in the SQL call then at least some f
orm of small sleep is put in there as there is no need to run it hundreds of tim
es per second.
To give you an idea of the number of times it is called. I split the trace file up into 360M chunks. in the last of them I saw this SQL was run
1896909 times.
</METALINK>
To provide you the background, I followed the strategy as listed in thread ("Spawn Jobs from a Procedure that run in parallel")
</code>
http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:10498431232211 <code>
But I forgot to add dbms_lock.sleep. From the update above, it seems it was a costly mistake. But why is dbms_lock.sleep required at all. Why not simply call
loop
select count(*) into l_cnt from job_parameters;
exit when (l_cnt = 0);
end loop;
How can and Why should calling it a million times lead to library latch contention? Wouldn't this query always be soft parsed?
Looking forward to your feedback to the questions asked and to as always many implicit questions, which we may not even be aware of.
Thanks