<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Another LatchProfX use case</title>
	<atom:link href="http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/</link>
	<description>Oracle troubleshooting, internals and performance tuning</description>
	<lastBuildDate>Mon, 15 Mar 2010 01:50:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: latch: cache buffers chains latch contention - a better way for finding the hot block &#124; Tanel Poder's blog: Core IT for Geeks and Pros</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-2381</link>
		<dc:creator>latch: cache buffers chains latch contention - a better way for finding the hot block &#124; Tanel Poder's blog: Core IT for Geeks and Pros</dc:creator>
		<pubDate>Thu, 27 Aug 2009 10:04:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-2381</guid>
		<description>[...] http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/" rel="nofollow">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SJois</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-1502</link>
		<dc:creator>SJois</dc:creator>
		<pubDate>Wed, 06 May 2009 13:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-1502</guid>
		<description>Thanks Tanel.. I am looking forward to it.

Thanks,</description>
		<content:encoded><![CDATA[<p>Thanks Tanel.. I am looking forward to it.</p>
<p>Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-1501</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Wed, 06 May 2009 13:23:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-1501</guid>
		<description>The v$session.status = ACTIVE when the session is servicing a user request. Whenever a new request comes in (through TTC layer) then one first thing Oracle does is update session idle bit which says that session is active. The session stays active regardless CPU usage or waits for some events. The session is marked inactive only when the response to application is sent back to client and db call ends.

What you probably meant was v$session_wait.state (statE, not statUS) which shows the wait state, whether you&#039;re waiting for something or not. The statE column is also in v$session starting from 10g, but they&#039;re different. STATE shows whether you&#039;re waiting/not on CPU or working/ON CPU, but STATUS shows whether the session is servicing a user request or not.

Regarding systemstate dumps, yes it&#039;s possible to get &quot;unlucky&quot; so that when the dump is taken the session just happens to be doing something else than the problem operation... this is in case you don&#039;t have a hang but just bad performance. That&#039;s why you should take a few systemstate dumps to see if anything is changing over time. Note that systemstate dump is quite expensive, better use @sw/v$session_wait if just one session is slow and hanganalyze at level 3 if there seems to be a hang affecting multiple sessions.

I will post a little script in my blog for information gathering hopefully today, but what I usually gather first for a problem session is v$session_wait, v$sesstat and exec plan info from v$sql_plan.</description>
		<content:encoded><![CDATA[<p>The v$session.status = ACTIVE when the session is servicing a user request. Whenever a new request comes in (through TTC layer) then one first thing Oracle does is update session idle bit which says that session is active. The session stays active regardless CPU usage or waits for some events. The session is marked inactive only when the response to application is sent back to client and db call ends.</p>
<p>What you probably meant was v$session_wait.state (statE, not statUS) which shows the wait state, whether you&#8217;re waiting for something or not. The statE column is also in v$session starting from 10g, but they&#8217;re different. STATE shows whether you&#8217;re waiting/not on CPU or working/ON CPU, but STATUS shows whether the session is servicing a user request or not.</p>
<p>Regarding systemstate dumps, yes it&#8217;s possible to get &#8220;unlucky&#8221; so that when the dump is taken the session just happens to be doing something else than the problem operation&#8230; this is in case you don&#8217;t have a hang but just bad performance. That&#8217;s why you should take a few systemstate dumps to see if anything is changing over time. Note that systemstate dump is quite expensive, better use @sw/v$session_wait if just one session is slow and hanganalyze at level 3 if there seems to be a hang affecting multiple sessions.</p>
<p>I will post a little script in my blog for information gathering hopefully today, but what I usually gather first for a problem session is v$session_wait, v$sesstat and exec plan info from v$sql_plan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SJois</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-1500</link>
		<dc:creator>SJois</dc:creator>
		<pubDate>Wed, 06 May 2009 13:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-1500</guid>
		<description>Tanel,

I think this explanation answers why I don&#039;t see the same address in the dump file.

I do see in dump , session info shows as last wait..however, I was checking the v$session status which was active. 
From my observation, if the session is waiting 
on anything in the database, the v$session status shows as active ( I might be wrong ).

So is it possible that during the dump duration when it was scannig this session, the session was doing some work? 

Now about next time, when this happens, if I use sw.sql and v$sesstat, I think I should get more info on this issue.
However, do you forsee any other info to be collected - just based on what you have seen?
Your insight is greatly appreciated. Thanks,</description>
		<content:encoded><![CDATA[<p>Tanel,</p>
<p>I think this explanation answers why I don&#8217;t see the same address in the dump file.</p>
<p>I do see in dump , session info shows as last wait..however, I was checking the v$session status which was active.<br />
From my observation, if the session is waiting<br />
on anything in the database, the v$session status shows as active ( I might be wrong ).</p>
<p>So is it possible that during the dump duration when it was scannig this session, the session was doing some work? </p>
<p>Now about next time, when this happens, if I use sw.sql and v$sesstat, I think I should get more info on this issue.<br />
However, do you forsee any other info to be collected &#8211; just based on what you have seen?<br />
Your insight is greatly appreciated. Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-1497</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Tue, 05 May 2009 22:52:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-1497</guid>
		<description>That&#039;s the reason why I asked - I suspected that the session was not actually stuck waiting for the event but you managed to misinterpret the v$session_wait instead. If STATE != WAITING in v$session_wait then ignore whatever the event columns says as you&#039;re not waiting anymore, but burning CPU! The event column just shows the LAST wait waited for, but its not relevant anymore as you&#039;re not waiting anymore.

That&#039;s why I use my sw.sql script which masks the last event name and replaces it with &quot;on cpu&quot; when not waiting. 

And systemstate dump confirms that as well, if you were waiting you&#039;d see &quot;waiting for ...&quot; in there instead of &quot;last wait ...&quot;

I would look into v$sesstat counter of that session (with snapper for example) and see what counters are incrementing (especially whether the execute count is going up) and then see into the execution plan of the prevalent SQL_ID/sql_hash_value in v$session for that session. This may be caused by just a bad execution plan, but snapper would confirm it.</description>
		<content:encoded><![CDATA[<p>That&#8217;s the reason why I asked &#8211; I suspected that the session was not actually stuck waiting for the event but you managed to misinterpret the v$session_wait instead. If STATE != WAITING in v$session_wait then ignore whatever the event columns says as you&#8217;re not waiting anymore, but burning CPU! The event column just shows the LAST wait waited for, but its not relevant anymore as you&#8217;re not waiting anymore.</p>
<p>That&#8217;s why I use my sw.sql script which masks the last event name and replaces it with &#8220;on cpu&#8221; when not waiting. </p>
<p>And systemstate dump confirms that as well, if you were waiting you&#8217;d see &#8220;waiting for &#8230;&#8221; in there instead of &#8220;last wait &#8230;&#8221;</p>
<p>I would look into v$sesstat counter of that session (with snapper for example) and see what counters are incrementing (especially whether the execute count is going up) and then see into the execution plan of the prevalent SQL_ID/sql_hash_value in v$session for that session. This may be caused by just a bad execution plan, but snapper would confirm it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SJois</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-1496</link>
		<dc:creator>SJois</dc:creator>
		<pubDate>Tue, 05 May 2009 21:48:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-1496</guid>
		<description>Tanel, 

Info: This is what I have in my dump file for this latch free waiting session..I did a grep on address 380010668 in the entire dump file and I don&#039;t see any reference to this address. So I am puzzled ..did I use wrong address?

*******************************************

SO: 2760886dd8, type: 4, owner: 276c962000, flag: INIT/-/-/0x00
    (session) trans: 27ef7a0c08, creator: 276c962000, flag: (100041) USR/- BSY/-/-/-/-/-
              DID: 0001-03F0-00000002, short-term DID: 0000-0000-00000000
              txn branch: 0
              oct: 2, prv: 0, sql: 27d892ab90, psql: 27d892ab90, user: 79/XYZUSER
    O/S info: user: xxxeng04, term: , ospid: 25364, machine: xxxxap4p
              program: exxxxeng@xxxxap4p (TNS V1-V3)
    application name: yyyyyy4, hash value=1554640259
    action name: Thread 25 (type T4: Object-Histo, hash value=1445968872
    last wait for &#039;latch free&#039; blocking sess=0x0 seq=30610 wait_time=204
                address=380010668, number=58, tries=0
    temporary object counter: 5

*******************************************</description>
		<content:encoded><![CDATA[<p>Tanel, </p>
<p>Info: This is what I have in my dump file for this latch free waiting session..I did a grep on address 380010668 in the entire dump file and I don&#8217;t see any reference to this address. So I am puzzled ..did I use wrong address?</p>
<p>*******************************************</p>
<p>SO: 2760886dd8, type: 4, owner: 276c962000, flag: INIT/-/-/0&#215;00<br />
    (session) trans: 27ef7a0c08, creator: 276c962000, flag: (100041) USR/- BSY/-/-/-/-/-<br />
              DID: 0001-03F0-00000002, short-term DID: 0000-0000-00000000<br />
              txn branch: 0<br />
              oct: 2, prv: 0, sql: 27d892ab90, psql: 27d892ab90, user: 79/XYZUSER<br />
    O/S info: user: xxxeng04, term: , ospid: 25364, machine: xxxxap4p<br />
              program: exxxxeng@xxxxap4p (TNS V1-V3)<br />
    application name: yyyyyy4, hash value=1554640259<br />
    action name: Thread 25 (type T4: Object-Histo, hash value=1445968872<br />
    last wait for &#8216;latch free&#8217; blocking sess=0&#215;0 seq=30610 wait_time=204<br />
                address=380010668, number=58, tries=0<br />
    temporary object counter: 5</p>
<p>*******************************************</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SJois</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-1495</link>
		<dc:creator>SJois</dc:creator>
		<pubDate>Tue, 05 May 2009 21:39:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-1495</guid>
		<description>Tanel,

Yes, it is system state dump. I checked the session_wait for that particular session and it was latch_free event..latches were &#039;cache buffers chains&#039; and &#039;mostly latch-free SCN&#039;. This session has been running almost about 16 hrs. Again at the system level db was normal. My db version is 9208 on SunOS 64 bit.I think I had seen an example on your site where you were showing how to track back to the latch blocking session.

Thanks,

Thanks,</description>
		<content:encoded><![CDATA[<p>Tanel,</p>
<p>Yes, it is system state dump. I checked the session_wait for that particular session and it was latch_free event..latches were &#8216;cache buffers chains&#8217; and &#8216;mostly latch-free SCN&#8217;. This session has been running almost about 16 hrs. Again at the system level db was normal. My db version is 9208 on SunOS 64 bit.I think I had seen an example on your site where you were showing how to track back to the latch blocking session.</p>
<p>Thanks,</p>
<p>Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-1494</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Tue, 05 May 2009 21:27:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-1494</guid>
		<description>You mean systemstate dump, right?

How did you conclude that you had latching problem for that session?

From systemstate dump you can search for &quot;latch:&quot; or &quot;latch free&quot; (depending on db version and latch type) to find the waiters and latch address and then you can look the latch holder up by that latch address.

But before going there, tell me how exactly (what view, what columns) you concluded that there was a latch free problem in the system?</description>
		<content:encoded><![CDATA[<p>You mean systemstate dump, right?</p>
<p>How did you conclude that you had latching problem for that session?</p>
<p>From systemstate dump you can search for &#8220;latch:&#8221; or &#8220;latch free&#8221; (depending on db version and latch type) to find the waiters and latch address and then you can look the latch holder up by that latch address.</p>
<p>But before going there, tell me how exactly (what view, what columns) you concluded that there was a latch free problem in the system?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SJois</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-1493</link>
		<dc:creator>SJois</dc:creator>
		<pubDate>Tue, 05 May 2009 21:23:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-1493</guid>
		<description>Hi Tanel,

Today I had this issue of latch_free waits for one of the session. I have a database system dump using oradebug dump systemstats. I believe there is a way to locate the latch blocking session from looking at dump file. Can you please guide me how to do this?
I appreciate your help.

Thanks</description>
		<content:encoded><![CDATA[<p>Hi Tanel,</p>
<p>Today I had this issue of latch_free waits for one of the session. I have a database system dump using oradebug dump systemstats. I believe there is a way to locate the latch blocking session from looking at dump file. Can you please guide me how to do this?<br />
I appreciate your help.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/comment-page-1/#comment-1490</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Tue, 05 May 2009 11:33:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/03/20/another-latchprofx-use-case/#comment-1490</guid>
		<description>Hi Muthu,

How did you determine there were long waits for that latch? Did you look into v$session_wait.event perhaps *without* realizing that the state column was not waiting? Unfortunately Oracle doesn&#039;t clear up the last wait event name when going back onto CPU, so that often misleads people (including me, that&#039;s why I use a case statement to remove the wait event name when not waiting anymore in my sw.sql script)

Your tkprof script shows CPU time as big as elapsed time so there should be no significant waits going on (did you enable sql_trace with waits=&gt;true - in that case tkprof should also report total time spent waiting for different events)</description>
		<content:encoded><![CDATA[<p>Hi Muthu,</p>
<p>How did you determine there were long waits for that latch? Did you look into v$session_wait.event perhaps *without* realizing that the state column was not waiting? Unfortunately Oracle doesn&#8217;t clear up the last wait event name when going back onto CPU, so that often misleads people (including me, that&#8217;s why I use a case statement to remove the wait event name when not waiting anymore in my sw.sql script)</p>
<p>Your tkprof script shows CPU time as big as elapsed time so there should be no significant waits going on (did you enable sql_trace with waits=>true &#8211; in that case tkprof should also report total time spent waiting for different events)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
