<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Analysing Statspack (4)</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Sat, 18 May 2013 11:04:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: xpchild &#187; Analysing Statspack 4</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-40867</link>
		<dc:creator><![CDATA[xpchild &#187; Analysing Statspack 4]]></dc:creator>
		<pubDate>Mon, 27 Jun 2011 09:15:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-40867</guid>
		<description><![CDATA[[...] 原文：http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 原文：http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kapil</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-32467</link>
		<dc:creator><![CDATA[Kapil]]></dc:creator>
		<pubDate>Tue, 30 Dec 2008 04:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-32467</guid>
		<description><![CDATA[Thanks for pointing snap_id and database_id. I would definitely consider using analytical function. 

Thanks
Kapil]]></description>
		<content:encoded><![CDATA[<p>Thanks for pointing snap_id and database_id. I would definitely consider using analytical function. </p>
<p>Thanks<br />
Kapil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-32435</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 21 Dec 2008 20:31:19 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-32435</guid>
		<description><![CDATA[Kapil,

Thank you for your contribution. I&#039;ve tried to edit the text to make it a little more readable within the restrictions of Wordpress comments.

A couple of points you might want to check. First, the outer join on snap_id will be eliminated because of earlier predicates that aren&#039;t outer joins.  Secondly, this may work on your system, but others may have managed to get data from multiple databases into their AWR tables; technically you should have a join on the database_id column as well. Finally, if you read the article from my website, you&#039;ll notice that it was about using analytic functions instead of a self-join. AWR discards data after seven days (by default) so the overhead using your self-join may not be significant - but some sites will choose to retain much larger ranges of data, at which point the benefits of the analytic approach may become more significant.]]></description>
		<content:encoded><![CDATA[<p>Kapil,</p>
<p>Thank you for your contribution. I&#8217;ve tried to edit the text to make it a little more readable within the restrictions of WordPress comments.</p>
<p>A couple of points you might want to check. First, the outer join on snap_id will be eliminated because of earlier predicates that aren&#8217;t outer joins.  Secondly, this may work on your system, but others may have managed to get data from multiple databases into their AWR tables; technically you should have a join on the database_id column as well. Finally, if you read the article from my website, you&#8217;ll notice that it was about using analytic functions instead of a self-join. AWR discards data after seven days (by default) so the overhead using your self-join may not be significant &#8211; but some sites will choose to retain much larger ranges of data, at which point the benefits of the analytic approach may become more significant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kapil</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-32397</link>
		<dc:creator><![CDATA[Kapil]]></dc:creator>
		<pubDate>Sun, 14 Dec 2008 17:05:25 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-32397</guid>
		<description><![CDATA[Hi Jonathan,

Thanks for sharing your knowledge and experience with oracle community. I really enjoy reading your articles.

For statspack trending, I use the same method as you use. This is really helpful. I also use following query as well on 10g for trending of Load Profile statistics.

[sourcecode]
set lines 130 pages 100
col value for 999999999999
col stat_name for a25
col BEGIN_INTERVAL_TIME for a25
col END_INTERVAL_TIME for a25
col per_scond for 9999999999
select 
    a.snap_id,
    a.value,
    b.snap_id,
    b.value,
    b.value-a.value &quot;DIFF&quot; ,
    sn.BEGIN_INTERVAL_TIME, 
    sn.END_INTERVAL_TIME,
    round((b.value-a.value)  /(extract( day from (end_interval_time-begin_interval_time) )*24*60*60+
               extract( hour from (end_interval_time-begin_interval_time) )*60*60+
               extract( minute from (end_interval_time-begin_interval_time) )*60+
               extract( second from (end_interval_time-begin_interval_time)) ),2) per_scecond
FROM 
    dba_hist_sysstat a,
    dba_hist_sysstat b,
    dba_hist_snapshot sn 
where 
    a.stat_name=&#039;redo size&#039; and
    b.stat_name=&#039;redo size&#039; and 
    a.instance_number=(select instance_number from v$instance) and 
    b.instance_number=(select instance_number from v$instance) and 
    sn.instance_number=(select instance_number from v$instance) and 
    a.snap_id=b.snap_id-1 and
    b.snap_id(+)=sn.snap_id 
order by 1;
[/sourcecode]

&quot;redo size&quot; can be replaced by following:
&#039;session logical reads&#039;,
&#039;db block changes&#039;,
&#039;physical reads&#039;,
&#039;physical writes&#039;,
&#039;user calls&#039;,
&#039;parse count (total)&#039;,
&#039;parse count (hard)&#039;,
&#039;sorts (disk)&#039;,
&#039;logons&#039;,
&#039;execute count&#039;,
&#039;transactions&#039;,
&#039;user commits&#039;,
&#039;user rollbacks&#039;

I hope, it will be helpful for someone.

Thanks
Kapil]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>Thanks for sharing your knowledge and experience with oracle community. I really enjoy reading your articles.</p>
<p>For statspack trending, I use the same method as you use. This is really helpful. I also use following query as well on 10g for trending of Load Profile statistics.</p>
<pre class="brush: plain; title: ; notranslate">
set lines 130 pages 100
col value for 999999999999
col stat_name for a25
col BEGIN_INTERVAL_TIME for a25
col END_INTERVAL_TIME for a25
col per_scond for 9999999999
select 
    a.snap_id,
    a.value,
    b.snap_id,
    b.value,
    b.value-a.value &quot;DIFF&quot; ,
    sn.BEGIN_INTERVAL_TIME, 
    sn.END_INTERVAL_TIME,
    round((b.value-a.value)  /(extract( day from (end_interval_time-begin_interval_time) )*24*60*60+
               extract( hour from (end_interval_time-begin_interval_time) )*60*60+
               extract( minute from (end_interval_time-begin_interval_time) )*60+
               extract( second from (end_interval_time-begin_interval_time)) ),2) per_scecond
FROM 
    dba_hist_sysstat a,
    dba_hist_sysstat b,
    dba_hist_snapshot sn 
where 
    a.stat_name='redo size' and
    b.stat_name='redo size' and 
    a.instance_number=(select instance_number from v$instance) and 
    b.instance_number=(select instance_number from v$instance) and 
    sn.instance_number=(select instance_number from v$instance) and 
    a.snap_id=b.snap_id-1 and
    b.snap_id(+)=sn.snap_id 
order by 1;
</pre>
<p>&#8220;redo size&#8221; can be replaced by following:<br />
&#8216;session logical reads&#8217;,<br />
&#8216;db block changes&#8217;,<br />
&#8216;physical reads&#8217;,<br />
&#8216;physical writes&#8217;,<br />
&#8216;user calls&#8217;,<br />
&#8216;parse count (total)&#8217;,<br />
&#8216;parse count (hard)&#8217;,<br />
&#8216;sorts (disk)&#8217;,<br />
&#8216;logons&#8217;,<br />
&#8216;execute count&#8217;,<br />
&#8216;transactions&#8217;,<br />
&#8216;user commits&#8217;,<br />
&#8216;user rollbacks&#8217;</p>
<p>I hope, it will be helpful for someone.</p>
<p>Thanks<br />
Kapil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-31181</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 10 Jun 2008 10:04:33 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-31181</guid>
		<description><![CDATA[George,

Thanks for the comment, and thanks for making the contribution.

A detail which you may find useful - and which I think I&#039;ve mentioned elsewhere - if you&#039;re going to depend on the statspack snapshot ids increasing by one all the time, then make sure you set the cache size on the statspack sequence (STATS$SNAPSHOT_ID) to zero (i.e. nocache).]]></description>
		<content:encoded><![CDATA[<p>George,</p>
<p>Thanks for the comment, and thanks for making the contribution.</p>
<p>A detail which you may find useful &#8211; and which I think I&#8217;ve mentioned elsewhere &#8211; if you&#8217;re going to depend on the statspack snapshot ids increasing by one all the time, then make sure you set the cache size on the statspack sequence (STATS$SNAPSHOT_ID) to zero (i.e. nocache).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Johnston</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-31142</link>
		<dc:creator><![CDATA[George Johnston]]></dc:creator>
		<pubDate>Wed, 04 Jun 2008 13:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-31142</guid>
		<description><![CDATA[Hi,

Firstly thanks for taking the time and effort to share your knowledge with the oracle community, it&#039;s very much appreciated.

Your series of statspack articles has given me some great pointers and in particular this posting has helped me in exactly the area i&#039;m currently working on i.e. trend analysis from statspack reports as part of an overall review of site performance for a customer.

Rgarding automating the runs of spreport.sql i&#039;ve borrowed your excellent file name format and come up with the following script which in turn generates a script which produces all the statspack reports for a certain day.

-- generateReportScript.sql

spool DayReports.sql

set heading off pages 9999

select &#039;define begin_snap=&#039;&#124;&#124;snap_id&#124;&#124;&#039;;&#039;&#124;&#124;chr(10)&#124;&#124;
       &#039;define end_snap=&#039;&#124;&#124;to_number(snap_id + 1)&#124;&#124;&#039;;&#039;&#124;&#124;chr(10)&#124;&#124;
       &#039;define report_name=sp_&#039;&#124;&#124;to_char(snap_time,&#039;ddmmhh24mi&#039;)&#124;&#124;&#039;.txt&#039;&#124;&#124;chr(10)&#124;&#124;
       &#039;@?/rdbms/admin/spreport;&#039;&#124;&#124;chr(10)
from stats$snapshot
where trunc(snap_time) = trunc(sysdate -1)
order by snap_time asc;

spool off

I don&#039;t have an understanding of analytic functions yet so the above script crudely just adds on 1 to the snap_id to get the end_snap for a report but if you&#039;ve set up your site to take snapshots every 15mins then the script works fine producing the following script:

-- DayReports.sql

define begin_snap=1621;
define end_snap=1622;
define report_name=sp_03060600.txt
@?/rdbms/admin/spreport;

etc...

which when run as the PERFSTAT user produces the required files

sp_03060600.txt
sp_03060615.txt
sp_03060630.txt
sp_03060645.txt
sp_03060700.txt
sp_03060715.txt
sp_03060730.txt
sp_03060745.txt
etc...

which can then be grepped as required!

Hope someone finds this useful. :)

Regards,
George Johnston]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Firstly thanks for taking the time and effort to share your knowledge with the oracle community, it&#8217;s very much appreciated.</p>
<p>Your series of statspack articles has given me some great pointers and in particular this posting has helped me in exactly the area i&#8217;m currently working on i.e. trend analysis from statspack reports as part of an overall review of site performance for a customer.</p>
<p>Rgarding automating the runs of spreport.sql i&#8217;ve borrowed your excellent file name format and come up with the following script which in turn generates a script which produces all the statspack reports for a certain day.</p>
<p>&#8211; generateReportScript.sql</p>
<p>spool DayReports.sql</p>
<p>set heading off pages 9999</p>
<p>select &#8216;define begin_snap=&#8217;||snap_id||&#8217;;'||chr(10)||<br />
       &#8216;define end_snap=&#8217;||to_number(snap_id + 1)||&#8217;;'||chr(10)||<br />
       &#8216;define report_name=sp_&#8217;||to_char(snap_time,&#8217;ddmmhh24mi&#8217;)||&#8217;.txt&#8217;||chr(10)||<br />
       &#8216;@?/rdbms/admin/spreport;&#8217;||chr(10)<br />
from stats$snapshot<br />
where trunc(snap_time) = trunc(sysdate -1)<br />
order by snap_time asc;</p>
<p>spool off</p>
<p>I don&#8217;t have an understanding of analytic functions yet so the above script crudely just adds on 1 to the snap_id to get the end_snap for a report but if you&#8217;ve set up your site to take snapshots every 15mins then the script works fine producing the following script:</p>
<p>&#8211; DayReports.sql</p>
<p>define begin_snap=1621;<br />
define end_snap=1622;<br />
define report_name=sp_03060600.txt<br />
@?/rdbms/admin/spreport;</p>
<p>etc&#8230;</p>
<p>which when run as the PERFSTAT user produces the required files</p>
<p>sp_03060600.txt<br />
sp_03060615.txt<br />
sp_03060630.txt<br />
sp_03060645.txt<br />
sp_03060700.txt<br />
sp_03060715.txt<br />
sp_03060730.txt<br />
sp_03060745.txt<br />
etc&#8230;</p>
<p>which can then be grepped as required!</p>
<p>Hope someone finds this useful. :)</p>
<p>Regards,<br />
George Johnston</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MURALI</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-15119</link>
		<dc:creator><![CDATA[MURALI]]></dc:creator>
		<pubDate>Fri, 13 Jul 2007 06:37:07 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-15119</guid>
		<description><![CDATA[What you gave information Regarding statspack is very very nice.....

With regards,
Murali]]></description>
		<content:encoded><![CDATA[<p>What you gave information Regarding statspack is very very nice&#8230;..</p>
<p>With regards,<br />
Murali</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ranjith</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-7904</link>
		<dc:creator><![CDATA[Ranjith]]></dc:creator>
		<pubDate>Wed, 09 May 2007 15:46:33 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-7904</guid>
		<description><![CDATA[Hello Jonathan,

Thanks for the reply.

When we run the statspack.snap manually, its taking snapshots, my doubt is whether we can manually check the STATSPACK is running or not through some variable or by some parameter or by some flag.

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan,</p>
<p>Thanks for the reply.</p>
<p>When we run the statspack.snap manually, its taking snapshots, my doubt is whether we can manually check the STATSPACK is running or not through some variable or by some parameter or by some flag.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-7820</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 08 May 2007 20:53:12 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-7820</guid>
		<description><![CDATA[Ranjith, not sure quite what you mean by the &lt;em&gt;statspack instance &lt;/em&gt;- but if you simply want to check on the whether the automatic job is running, then you could query view &lt;em&gt;&lt;strong&gt;dba_jobs&lt;/strong&gt;&lt;/em&gt;:

[sourcecode]
select 
        what, 
        to_char(next_date,&#039;dd-mon-yy hh24:mi:ss&#039;) when, 
        broken 
from 
        dba_jobs
;
WHAT               WHEN               B
------------------ ------------------ -
statspack.snap;    08-may-07 22:00:00 N
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>Ranjith, not sure quite what you mean by the <em>statspack instance </em>- but if you simply want to check on the whether the automatic job is running, then you could query view <em><strong>dba_jobs</strong></em>:</p>
<pre class="brush: plain; title: ; notranslate">
select 
        what, 
        to_char(next_date,'dd-mon-yy hh24:mi:ss') when, 
        broken 
from 
        dba_jobs
;
WHAT               WHEN               B
------------------ ------------------ -
statspack.snap;    08-may-07 22:00:00 N
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ranjith</title>
		<link>http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-7784</link>
		<dc:creator><![CDATA[Ranjith]]></dc:creator>
		<pubDate>Tue, 08 May 2007 13:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/03/07/analysing-statspack-4/#comment-7784</guid>
		<description><![CDATA[Hello Jonathan,

How to check the statspack instance whether it is running or not? are there any kind of checks to do that.

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan,</p>
<p>How to check the statspack instance whether it is running or not? are there any kind of checks to do that.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
