Professional Documents
Culture Documents
Slow SQL
Slow SQL
Slow SQL
te from "$session where usern!me # $%&'($) SI* S+%+E ,,,, ,,,,,,,,,,,,,,,,,, --./ 0%I+IN1 23-2 0%I+E* 4NO0N +I5E 2) Session --./ indic!tes th!t it is w!iting for something !nd therefore not working let6s study the st!te of session 23-2 in the out7ut which shows th!t it w!ited for some known !mount of time e!rlier8 +he im7ort!nt 7oint is th!t session 23-2 is not waiting for !nything right now me!ning th!t it6s working 7roducti"ely8 let6s see wh!t the session 9--./) is w!iting for8 +h!t inform!tion is re!dily !"!il!:le in the EVENT column in the s!me V$SESSION "iew8 select sid st!te e"ent from "$session where usern!me # $%&'($) SI* S+%+E EVEN+ ,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,, 23-2 0%I+E* 4NO0N +I5E SQL;Net mess!ge from client --./ 0!iting en<: += > row lock contention .) session --./ is w!iting right now for !n e"ent:?en<ueue? +he session is w!iting :ec!use it w!nts to lock one or more rows :ut !nother session h!s !lre!dy 7l!ced locks on the row or rows8 @ou must look !t the S+%+E column first to determine whether the session is w!iting or working !nd then ins7ect the EVEN+ column Bow long the session is w!iting CSECONDS_IN_WAIT,WAIT_TIME tells the inform!tion 8 Output: SI* S+%+E *escri7tion
-)
A)
,,,,, ,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,, 23-2 0orking L!st w!ited 2D2E secs for SQL;Net mess!ge from client --./ 0!iting So f!r F.- secs for en<: += > row lock contention .2D3 0!iting So f!r A.E3 secs for SQL;Net mess!ge from client