<?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: Cache Buffers Chains and Latch Spelunking</title>
	<atom:link href="http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/</link>
	<description>Jeremy's Oracle Resources and Ramblings</description>
	<lastBuildDate>Wed, 03 Mar 2010 03:35:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alan Kendall</title>
		<link>http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/comment-page-1/#comment-843</link>
		<dc:creator>Alan Kendall</dc:creator>
		<pubDate>Thu, 20 Mar 2008 23:37:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/#comment-843</guid>
		<description>I have been using caching the objects with high reads in the keep cache and the objects with the high writes in the default cache.  The problem is diminished but not eliminated. You can identify what is causing the buffer_busy waits with the following two sqls. If statistics_level=typical, then buffer_busy waits will be accumulated in v$segment_statistics since startup (9i on).

In 10g and 11g, dba_hist_seg_stat keeps hourly deltas of v$segment_statistics and you can identify what causes the buffer_busy waits by object each hour.

SQL&gt; @buffer_busy
Object                   Buffer Busy Waits
------------------------ -----------------
JOB                                     69
STEP                                    76
RATIONS_PK                              85
CBASE_PROPERTIES1_S                    157
STEP_PK                                165
JOB_INSTANCE_PK                        188
PARTITION_PK                           189
STEP_INSTANCE_PK                       190
JOB_PK                                 224
PARTITION_INSTANCE_PK                  233
JOB_INSTANCE                           248
STEP_INSTANCE                          422
PARTITION_INSTANCE                     458
G_REGISTRATIONS_PK                     508

buffer_busy.sql:
-- Must have statistics_level=typical
col &quot;Object&quot; format a30
set numwidth 12
set lines 132
set pages 50
select * from(
select DECODE(GROUPING(a.object_name), 1, &#039;All Objects&#039;,
      a.object_name) AS &quot;Object&quot;,
sum(case when a.statistic_name = &#039;buffer busy waits&#039; 
then a.value else null end) &quot;Buffer Busy Waits&quot;,
sum(case when a.statistic_name = &#039;physical reads&#039; 
then a.value else null end) &quot;Physical_Reads&quot;,
sum(case when a.statistic_name = &#039;physical writes&#039; 
then a.value else null end) &quot;Physical_writes&quot;,
sum(case when a.statistic_name = &#039;logical reads&#039; 
then a.value else null end) &quot;Logical Reads&quot;
from v$segment_statistics a
where a.owner like upper(&#039;%&#039;)
group by rollup(a.object_name)) b
where  b.&quot;Buffer Busy Waits&quot;&gt;0
order by 2
/
clear columns
ttitle off

In 10g and 11g the following works great:

SQL&gt; @dba_hist_buffer_busy
BEGIN_INTERVAL_  BUFFER_BUSY NAME
--------------- ------------ --------------------------
19-MAR-08 02.00          432 CONTENT.IDX_ECM_CONTENT_ID
19-MAR-08 02.00          247 CONTENT.IDX_ECM_CONTENT_ID
19-MAR-08 09.00           42 SITE.BATCH_STEP_INSTANCE
19-MAR-08 09.00           43 SITE.BATCH_STEP_INSTANCE
19-MAR-08 04.00         1427 SITE.BATCH_JOB_PK

dba_hist_buffer_busy.sql:
set pages 50
column name format a40
set lines 130
column begin_interval_time format a15
set wrap off
select begin_interval_time,BUFFER_BUSY_WAITS_DELTA buffer_busy,
PHYSICAL_WRITES_DELTA writes,
ROW_LOCK_WAITS_DELTA row_locks,
owner&#124;&#124;&#039;.&#039;&#124;&#124;object_name name
from dba_hist_seg_stat dhss,dba_objects do ,sys.wRM$_SNAPSHOT ws
where begin_interval_time &gt; sysdate-10
and dhss.BUFFER_BUSY_WAITS_DELTA&gt;1
and do.object_id=dhss.obj#
and ws.snap_id=dhss.snap_id
-- to find largest order by BUFFER_BUSY_WAITS_DELTA
order by begin_interval_time
/</description>
		<content:encoded><![CDATA[<p>I have been using caching the objects with high reads in the keep cache and the objects with the high writes in the default cache.  The problem is diminished but not eliminated. You can identify what is causing the buffer_busy waits with the following two sqls. If statistics_level=typical, then buffer_busy waits will be accumulated in v$segment_statistics since startup (9i on).</p>
<p>In 10g and 11g, dba_hist_seg_stat keeps hourly deltas of v$segment_statistics and you can identify what causes the buffer_busy waits by object each hour.</p>
<p>SQL&gt; @buffer_busy<br />
Object                   Buffer Busy Waits<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
JOB                                     69<br />
STEP                                    76<br />
RATIONS_PK                              85<br />
CBASE_PROPERTIES1_S                    157<br />
STEP_PK                                165<br />
JOB_INSTANCE_PK                        188<br />
PARTITION_PK                           189<br />
STEP_INSTANCE_PK                       190<br />
JOB_PK                                 224<br />
PARTITION_INSTANCE_PK                  233<br />
JOB_INSTANCE                           248<br />
STEP_INSTANCE                          422<br />
PARTITION_INSTANCE                     458<br />
G_REGISTRATIONS_PK                     508</p>
<p>buffer_busy.sql:<br />
&#8211; Must have statistics_level=typical<br />
col &#8220;Object&#8221; format a30<br />
set numwidth 12<br />
set lines 132<br />
set pages 50<br />
select * from(<br />
select DECODE(GROUPING(a.object_name), 1, &#8216;All Objects&#8217;,<br />
      a.object_name) AS &#8220;Object&#8221;,<br />
sum(case when a.statistic_name = &#8216;buffer busy waits&#8217;<br />
then a.value else null end) &#8220;Buffer Busy Waits&#8221;,<br />
sum(case when a.statistic_name = &#8216;physical reads&#8217;<br />
then a.value else null end) &#8220;Physical_Reads&#8221;,<br />
sum(case when a.statistic_name = &#8216;physical writes&#8217;<br />
then a.value else null end) &#8220;Physical_writes&#8221;,<br />
sum(case when a.statistic_name = &#8216;logical reads&#8217;<br />
then a.value else null end) &#8220;Logical Reads&#8221;<br />
from v$segment_statistics a<br />
where a.owner like upper(&#8216;%&#8217;)<br />
group by rollup(a.object_name)) b<br />
where  b.&#8221;Buffer Busy Waits&#8221;&gt;0<br />
order by 2<br />
/<br />
clear columns<br />
ttitle off</p>
<p>In 10g and 11g the following works great:</p>
<p>SQL&gt; @dba_hist_buffer_busy<br />
BEGIN_INTERVAL_  BUFFER_BUSY NAME<br />
&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
19-MAR-08 02.00          432 CONTENT.IDX_ECM_CONTENT_ID<br />
19-MAR-08 02.00          247 CONTENT.IDX_ECM_CONTENT_ID<br />
19-MAR-08 09.00           42 SITE.BATCH_STEP_INSTANCE<br />
19-MAR-08 09.00           43 SITE.BATCH_STEP_INSTANCE<br />
19-MAR-08 04.00         1427 SITE.BATCH_JOB_PK</p>
<p>dba_hist_buffer_busy.sql:<br />
set pages 50<br />
column name format a40<br />
set lines 130<br />
column begin_interval_time format a15<br />
set wrap off<br />
select begin_interval_time,BUFFER_BUSY_WAITS_DELTA buffer_busy,<br />
PHYSICAL_WRITES_DELTA writes,<br />
ROW_LOCK_WAITS_DELTA row_locks,<br />
owner||&#8217;.'||object_name name<br />
from dba_hist_seg_stat dhss,dba_objects do ,sys.wRM$_SNAPSHOT ws<br />
where begin_interval_time &gt; sysdate-10<br />
and dhss.BUFFER_BUSY_WAITS_DELTA&gt;1<br />
and do.object_id=dhss.obj#<br />
and ws.snap_id=dhss.snap_id<br />
&#8211; to find largest order by BUFFER_BUSY_WAITS_DELTA<br />
order by begin_interval_time<br />
/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: psyprus</title>
		<link>http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/comment-page-1/#comment-814</link>
		<dc:creator>psyprus</dc:creator>
		<pubDate>Tue, 15 Jan 2008 23:10:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/#comment-814</guid>
		<description>I heard of a hidden parameter _db_block_hash_buckets that help with busy buffers and latch contention.  

Have you used it before?   What are your thoughts?</description>
		<content:encoded><![CDATA[<p>I heard of a hidden parameter _db_block_hash_buckets that help with busy buffers and latch contention.  </p>
<p>Have you used it before?   What are your thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/comment-page-1/#comment-754</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Fri, 14 Sep 2007 13:03:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/#comment-754</guid>
		<description>Oops - thanks for the link.  I did join on data_object_id in the first example but had changed it in the second SQL statement (at the end of the post) while playing around with how it reported on partitions... and I forgot to change it back before writing the post.  However I didn&#039;t know the bits from Lewis&#039; post about rollback segs, global temp tables and free blocks.  

I don&#039;t want to eliminate free blocks because I&#039;m looking for contention and would be interested seeing any objects that ever had blocks on the latch chain.  However I guess I could get rid of rollback and temp for now...  although honestly I should probably outer join them in - but I&#039;ll leave that for a future update.  I&#039;m updating the post now!

Also, your link to Lewis&#039; page led me to a few other great posts so I&#039;ve added them to the bottom of the post.  Thanks again!</description>
		<content:encoded><![CDATA[<p>Oops &#8211; thanks for the link.  I did join on data_object_id in the first example but had changed it in the second SQL statement (at the end of the post) while playing around with how it reported on partitions&#8230; and I forgot to change it back before writing the post.  However I didn&#8217;t know the bits from Lewis&#8217; post about rollback segs, global temp tables and free blocks.  </p>
<p>I don&#8217;t want to eliminate free blocks because I&#8217;m looking for contention and would be interested seeing any objects that ever had blocks on the latch chain.  However I guess I could get rid of rollback and temp for now&#8230;  although honestly I should probably outer join them in &#8211; but I&#8217;ll leave that for a future update.  I&#8217;m updating the post now!</p>
<p>Also, your link to Lewis&#8217; page led me to a few other great posts so I&#8217;ve added them to the bottom of the post.  Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yas</title>
		<link>http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/comment-page-1/#comment-753</link>
		<dc:creator>Yas</dc:creator>
		<pubDate>Fri, 14 Sep 2007 08:23:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardentperf.com/2007/09/13/cache-buffers-chains-and-latch-spelunking/#comment-753</guid>
		<description>Jeremy, look at this &lt;a href=&quot;http://jonathanlewis.wordpress.com/2006/11/02/but-its-in-the-manual/&quot; rel=&quot;nofollow&quot;&gt;post of Jonathan Lewis&lt;/a&gt; about joining v$bh to dba_objects. He talks about some important points, like using data_object_id and not object_id.</description>
		<content:encoded><![CDATA[<p>Jeremy, look at this <a href="http://jonathanlewis.wordpress.com/2006/11/02/but-its-in-the-manual/" rel="nofollow">post of Jonathan Lewis</a> about joining v$bh to dba_objects. He talks about some important points, like using data_object_id and not object_id.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
