<?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: AWR mining</title>
	<atom:link href="/2011/06/21/awr-mining/feed/" rel="self" type="application/rss+xml" />
	<link>http://dboptimizer.com/2011/06/21/awr-mining/</link>
	<description>database performance, SQL tuning and data visualizatoin</description>
	<lastBuildDate>Sat, 03 Mar 2018 05:02:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6</generator>
	<item>
		<title>By: DB Optimizer &#187; Tuning Blog Entries</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-692</link>
		<dc:creator>DB Optimizer &#187; Tuning Blog Entries</dc:creator>
		<pubDate>Thu, 20 Oct 2011 17:12:13 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-692</guid>
		<description><![CDATA[[...] AWR mining [...]]]></description>
		<content:encoded><![CDATA[<p>[...] AWR mining [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Gagne</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-421</link>
		<dc:creator>Alan Gagne</dc:creator>
		<pubDate>Fri, 01 Jul 2011 15:48:42 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-421</guid>
		<description><![CDATA[&lt;blockquote cite=&quot;#commentbody-420&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;#comment-420&quot; rel=&quot;nofollow&quot;&gt;Alan Gagne&lt;/a&gt; :&lt;/strong&gt;
You might want to look at MOD(b.snap_id,step)=0 to remove the data spikes from database restarts.
&lt;/blockquote&gt;
Sorry feeble mind looking at old scripts.
I am using startup_time from dba_hist_snapshot on 10.2.
b.startup_time = e.startup_time]]></description>
		<content:encoded><![CDATA[<blockquote cite="#commentbody-420"><p>
<strong><a href="#comment-420" rel="nofollow">Alan Gagne</a> :</strong><br />
You might want to look at MOD(b.snap_id,step)=0 to remove the data spikes from database restarts.
</p></blockquote>
<p>Sorry feeble mind looking at old scripts.<br />
I am using startup_time from dba_hist_snapshot on 10.2.<br />
b.startup_time = e.startup_time</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Gagne</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-420</link>
		<dc:creator>Alan Gagne</dc:creator>
		<pubDate>Fri, 01 Jul 2011 15:04:17 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-420</guid>
		<description><![CDATA[You might want to look at MOD(b.snap_id,step)=0 to remove the data spikes from database restarts.]]></description>
		<content:encoded><![CDATA[<p>You might want to look at MOD(b.snap_id,step)=0 to remove the data spikes from database restarts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Hailey</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-414</link>
		<dc:creator>Kyle Hailey</dc:creator>
		<pubDate>Wed, 22 Jun 2011 21:04:59 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-414</guid>
		<description><![CDATA[One thing to keep in mind: the &quot;metric&quot; tables have already computed values such as rates and deltas which are read to be used. On the other hand the standard Oracle statistic tables such as dba_hist_sysstat and db_hist_system_event have the cumlative values since database startup and require deltas to be calculated.
DBA_HIST_SYSMETRIC_SUMMARY is cool as it already has max, min, avg, std etc:
SQL&gt; desc DBA_HIST_SYSMETRIC_SUMMARY
 Name
 ------------------------------------
 SNAP_ID
 DBID
 INSTANCE_NUMBER
 BEGIN_TIME
 END_TIME
 INTSIZE
 GROUP_ID
 METRIC_ID
 METRIC_NAME
 METRIC_UNIT
 NUM_INTERVAL
 MINVAL
 MAXVAL
 AVERAGE
 STANDARD_DEVIATION
 SUM_SQUARES
where as dba_hist_sysstat is not so much fun
SQL&gt; desc dba_hist_sysstat
 Name
 ----------------------------
 SNAP_ID
 DBID
 INSTANCE_NUMBER
 STAT_ID
 STAT_NAME
 VALUE
so what would be an easy query on the metrics is harder on the sysstat:
&lt;pre&gt;
with stats as (
           select
                  st.stat_name,
                  st.dbid,
                  to_char(trunc(cast(begin_interval_time as date ))+
                          (ROUND ((cast(begin_interval_time as  date)- 
                            TRUNC (cast(begin_interval_time as date))) * 24) / 24),
                            &#039;YYYY/MM/DD HH24:MI&#039;) btime,
                  Lag (st.value) OVER( PARTITION BY st.stat_name,st.dbid ORDER BY sn.snap_id)
                               value_beg,
                  st.value     value_end,
                  (cast(end_interval_time as date) - cast(begin_interval_time as date )) * (24*60*60) delta
           from
                  DBA_HIST_SYSSTAT  st,
                  DBA_HIST_SNAPSHOT sn
           where
                    sn.snap_id=st.snap_id and
                    sn.dbid=st.dbid and
                    (st.stat_name= &#039;physical read total bytes&#039;
                  or st.stat_name=&#039;physical write total bytes&#039; )
           order by begin_interval_time
     ) 
   select
          n.db_name, 
          btime,
          stat_name,
          (value_end-value_beg)/delta rate_per_sec
   from stats st,
       (select distinct dbid, db_name, host_name from dba_hist_database_instance) n
   where n.dbid=st.dbid
    and  (value_end-value_beg) &gt; 0
/
&lt;/pre&gt;
verses metrics
&lt;pre&gt;
select
               n.db_name&#124;&#124;&#039;_&#039;&#124;&#124;n.host_name,
               decode(metric_name,
                   &#039;Physical Write Total Bytes Per Sec&#039;,&#039;write&#039;,&#039;read&#039;),
               to_char(trunc(begin_time)+
                ( ROUND ((begin_time - TRUNC (begin_time)) * 24) / 24),
                       &#039;YYYY/MM/DD HH24:MI&#039;),
               average
        from dba_hist_sysmetric_summary           s,
             (select distinct 
                         dbid, 
                         db_name, 
                         host_name
                from dba_hist_database_instance) n
        where
               ( s.metric_name= &#039;Physical Write Total Bytes Per Sec&#039;
                  or
                 s.metric_name= &#039;Physical Read Total Bytes Per Sec&#039;
               ) and n.dbid=s.dbid
               order by begin_time;
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>One thing to keep in mind: the &#8220;metric&#8221; tables have already computed values such as rates and deltas which are read to be used. On the other hand the standard Oracle statistic tables such as dba_hist_sysstat and db_hist_system_event have the cumlative values since database startup and require deltas to be calculated.<br />
DBA_HIST_SYSMETRIC_SUMMARY is cool as it already has max, min, avg, std etc:<br />
SQL> desc DBA_HIST_SYSMETRIC_SUMMARY<br />
 Name<br />
 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
 SNAP_ID<br />
 DBID<br />
 INSTANCE_NUMBER<br />
 BEGIN_TIME<br />
 END_TIME<br />
 INTSIZE<br />
 GROUP_ID<br />
 METRIC_ID<br />
 METRIC_NAME<br />
 METRIC_UNIT<br />
 NUM_INTERVAL<br />
 MINVAL<br />
 MAXVAL<br />
 AVERAGE<br />
 STANDARD_DEVIATION<br />
 SUM_SQUARES<br />
where as dba_hist_sysstat is not so much fun<br />
SQL> desc dba_hist_sysstat<br />
 Name<br />
 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
 SNAP_ID<br />
 DBID<br />
 INSTANCE_NUMBER<br />
 STAT_ID<br />
 STAT_NAME<br />
 VALUE<br />
so what would be an easy query on the metrics is harder on the sysstat:</p>
<pre>
with stats as (
           select
                  st.stat_name,
                  st.dbid,
                  to_char(trunc(cast(begin_interval_time as date ))+
                          (ROUND ((cast(begin_interval_time as  date)- 
                            TRUNC (cast(begin_interval_time as date))) * 24) / 24),
                            'YYYY/MM/DD HH24:MI') btime,
                  Lag (st.value) OVER( PARTITION BY st.stat_name,st.dbid ORDER BY sn.snap_id)
                               value_beg,
                  st.value     value_end,
                  (cast(end_interval_time as date) - cast(begin_interval_time as date )) * (24*60*60) delta
           from
                  DBA_HIST_SYSSTAT  st,
                  DBA_HIST_SNAPSHOT sn
           where
                    sn.snap_id=st.snap_id and
                    sn.dbid=st.dbid and
                    (st.stat_name= 'physical read total bytes'
                  or st.stat_name='physical write total bytes' )
           order by begin_interval_time
     ) 
   select
          n.db_name, 
          btime,
          stat_name,
          (value_end-value_beg)/delta rate_per_sec
   from stats st,
       (select distinct dbid, db_name, host_name from dba_hist_database_instance) n
   where n.dbid=st.dbid
    and  (value_end-value_beg) > 0
/
</pre>
<p>verses metrics</p>
<pre>
select
               n.db_name||'_'||n.host_name,
               decode(metric_name,
                   'Physical Write Total Bytes Per Sec','write','read'),
               to_char(trunc(begin_time)+
                ( ROUND ((begin_time - TRUNC (begin_time)) * 24) / 24),
                       'YYYY/MM/DD HH24:MI'),
               average
        from dba_hist_sysmetric_summary           s,
             (select distinct 
                         dbid, 
                         db_name, 
                         host_name
                from dba_hist_database_instance) n
        where
               ( s.metric_name= 'Physical Write Total Bytes Per Sec'
                  or
                 s.metric_name= 'Physical Read Total Bytes Per Sec'
               ) and n.dbid=s.dbid
               order by begin_time;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry Poras</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-413</link>
		<dc:creator>Henry Poras</dc:creator>
		<pubDate>Wed, 22 Jun 2011 18:15:57 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-413</guid>
		<description><![CDATA[Ooops, stupid math error. Never mind.
&lt;a href=&quot;#comment-412&quot; rel=&quot;nofollow&quot;&gt;@Henry Poras&lt;/a&gt;]]></description>
		<content:encoded><![CDATA[<p>Ooops, stupid math error. Never mind.<br />
<a href="#comment-412" rel="nofollow">@Henry Poras</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry Poras</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-412</link>
		<dc:creator>Henry Poras</dc:creator>
		<pubDate>Wed, 22 Jun 2011 18:11:33 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-412</guid>
		<description><![CDATA[I compared &quot;physical [read&#124;write] total bytes&quot; in dba_hist_sysstat to the dba_hist_sysmetric_summary and there seems to be a factor of 1000 difference in the MB/sec values.  For example, sysmetric_summary shows 17 MB/sec while sysstat shows .017 MB/sec. Anyone else seeing this?]]></description>
		<content:encoded><![CDATA[<p>I compared &#8220;physical [read|write] total bytes&#8221; in dba_hist_sysstat to the dba_hist_sysmetric_summary and there seems to be a factor of 1000 difference in the MB/sec values.  For example, sysmetric_summary shows 17 MB/sec while sysstat shows .017 MB/sec. Anyone else seeing this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Arao</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-409</link>
		<dc:creator>Karl Arao</dc:creator>
		<pubDate>Wed, 22 Jun 2011 03:13:51 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-409</guid>
		<description><![CDATA[Hi Kyle, 
This is my interest too, let me know if I can help ;) I&#039;ve done some research before where I want to have the latency on the same row (avg,min,max) with the IO throughput numbers and IO type (single/multiblock) per snap_id but this requires joining to the dba_hist_filestats and if you have a bunch of datafiles that would be really make the join slow. So I just took out that portion and added the CPU IO wait at least that would let me know if I&#039;m IO bound/bottleneck on a particular period. I&#039;ve got a script called awr_iowl.sql let me know if that&#039;s helpful. 


Tyler, 
I&#039;ve got some ideas too on the AWR formatting, that tool was very useful on a recent Exadata tuning gig!


-Karl]]></description>
		<content:encoded><![CDATA[<p>Hi Kyle,<br />
This is my interest too, let me know if I can help ;) I&#8217;ve done some research before where I want to have the latency on the same row (avg,min,max) with the IO throughput numbers and IO type (single/multiblock) per snap_id but this requires joining to the dba_hist_filestats and if you have a bunch of datafiles that would be really make the join slow. So I just took out that portion and added the CPU IO wait at least that would let me know if I&#8217;m IO bound/bottleneck on a particular period. I&#8217;ve got a script called awr_iowl.sql let me know if that&#8217;s helpful. </p>
<p>Tyler,<br />
I&#8217;ve got some ideas too on the AWR formatting, that tool was very useful on a recent Exadata tuning gig!</p>
<p>-Karl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Hailey</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-403</link>
		<dc:creator>Kyle Hailey</dc:creator>
		<pubDate>Tue, 21 Jun 2011 04:22:34 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-403</guid>
		<description><![CDATA[Hey Tyler,

  Thanks for stopping by. I&#039;d definitely be interested in collaborating.

  Been meaning to send  you some questions about questions about the AWR formatting - pretty cool ( &lt;a ref=http://tylermuth.wordpress.com/2011/04/20/awr-formatter/ rel=&quot;nofollow&quot;&gt; AWR formatter&lt;/a&gt; )

- Kyle]]></description>
		<content:encoded><![CDATA[<p>Hey Tyler,</p>
<p>  Thanks for stopping by. I&#8217;d definitely be interested in collaborating.</p>
<p>  Been meaning to send  you some questions about questions about the AWR formatting &#8211; pretty cool ( <a ref=http://tylermuth.wordpress.com/2011/04/20/awr-formatter/ rel="nofollow"> AWR formatter</a> )</p>
<p>- Kyle</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tyler D Muth</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-402</link>
		<dc:creator>Tyler D Muth</dc:creator>
		<pubDate>Tue, 21 Jun 2011 02:12:47 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-402</guid>
		<description><![CDATA[Funny, I was just writing some related reports. Drop me an email if you would like to collaborate. 

The HTML output from sqlplus is easy to open in excel. 

Tyler]]></description>
		<content:encoded><![CDATA[<p>Funny, I was just writing some related reports. Drop me an email if you would like to collaborate. </p>
<p>The HTML output from sqlplus is easy to open in excel. </p>
<p>Tyler</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tyler D Muth</title>
		<link>http://dboptimizer.com/2011/06/21/awr-mining/#comment-401</link>
		<dc:creator>Tyler D Muth</dc:creator>
		<pubDate>Tue, 21 Jun 2011 02:10:31 +0000</pubDate>
		<guid isPermaLink="false">http://dboptimizer.com/?p=1055#comment-401</guid>
		<description><![CDATA[L]]></description>
		<content:encoded><![CDATA[<p>L</p>
]]></content:encoded>
	</item>
</channel>
</rss>
