<?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: Event snapshots</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2008/06/15/event-snapshots/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2008/06/15/event-snapshots/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Thu, 23 May 2013 12:47:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Slow Code &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/06/15/event-snapshots/#comment-35122</link>
		<dc:creator><![CDATA[Slow Code &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Wed, 30 Dec 2009 15:11:07 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=378#comment-35122</guid>
		<description><![CDATA[[...] (approximately) v$session_wait_history in older versions of Oracle. Rapid snapshots of the event histogram view.    Comments [...]]]></description>
		<content:encoded><![CDATA[<p>[...] (approximately) v$session_wait_history in older versions of Oracle. Rapid snapshots of the event histogram view.    Comments [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Advanced Oracle Troubleshooting Guide, Part 7: Sampling latch holder statistics using LatchProf &#171; Tanel Poder&#8217;s blog: Core IT for geeks and pros</title>
		<link>http://jonathanlewis.wordpress.com/2008/06/15/event-snapshots/#comment-31479</link>
		<dc:creator><![CDATA[Advanced Oracle Troubleshooting Guide, Part 7: Sampling latch holder statistics using LatchProf &#171; Tanel Poder&#8217;s blog: Core IT for geeks and pros]]></dc:creator>
		<pubDate>Tue, 08 Jul 2008 11:56:25 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=378#comment-31479</guid>
		<description><![CDATA[[...] want to run this for too long at a time ( you could implement a short wait in there with a nice trick by Jonathan Lewis [...]]]></description>
		<content:encoded><![CDATA[<p>[...] want to run this for too long at a time ( you could implement a short wait in there with a nice trick by Jonathan Lewis [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/06/15/event-snapshots/#comment-31318</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 17 Jun 2008 20:08:02 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=378#comment-31318</guid>
		<description><![CDATA[Jeroen, 
Nice enhancement; it&#039;s prompted me to write a version of the original code for 11g.

&lt;code&gt;
column event format a32
define m_event=&#039;db file%&#039;
define m_pause=20

with subq as (
&#160; &#160; &#160; &#160; select
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; event, wait_time_milli, sum(wait_count) wait_count
&#160; &#160; &#160; &#160; from (
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; select 
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; event, wait_time_milli, -1 * wait_count&#160; wait_count
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; from&#160; &#160; v$event_histogram
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; where&#160;&#160; event like &#039;&amp;m_event&#039;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; union all
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; select 
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; null, jpl_numeric_wait( &amp;m_pause ,-1), null 
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; from&#160; &#160; dual
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; union all
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; select 
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; event, wait_time_milli, wait_count 
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; from&#160; &#160; v$event_histogram
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; where&#160;&#160; event like&#160; &#039;&amp;m_event&#039;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; )
&#160; &#160; &#160; &#160; where
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; wait_time_milli != -1
&#160; &#160; &#160; &#160; group by
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; event, wait_time_milli
&#160; &#160; &#160; &#160; order by 
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; event, wait_time_milli
&#160; &#160; &#160; &#160; )
select
&#160; &#160; &#160; &#160; *
from
&#160; &#160; &#160; &#160; subq
&#160; &#160; &#160; &#160; pivot (
&#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; max(wait_count) 
&#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; for wait_time_milli in (1,2,4,8,16,32)
&#160; &#160; &#160; &#160; )
order by
&#160; &#160; &#160; &#160; event
;



EVENT&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; 1&#160; &#160; &#160; 2&#160; &#160; &#160; 4&#160; &#160; &#160; 8&#160; &#160;&#160; 16&#160; &#160;&#160; 32
---------------------- ------- ------ ------ ------ ------ ------ 
db file parallel read&#160; &#160; &#160; &#160; 0&#160; &#160; &#160; 0&#160; &#160; &#160; 0&#160; &#160; &#160; 0&#160; &#160; &#160; 0&#160; &#160; &#160; 0
db file parallel write&#160; &#160; &#160; 18&#160; &#160; &#160; 0&#160; &#160; &#160; 0&#160; &#160; &#160; 0&#160; &#160; &#160; 0&#160; &#160; &#160; 0
db file scattered read&#160; &#160; &#160;&#160; 1&#160; &#160; &#160; 1&#160; &#160; &#160; 0&#160; &#160; &#160; 0&#160; &#160; &#160; 0&#160; &#160; &#160; 0
db file sequential read&#160;&#160; 1379&#160; &#160; &#160; 5&#160; &#160; &#160; 4&#160; &#160;&#160; 11&#160; &#160;&#160; 33&#160; &#160;&#160; 34
db file single write&#160; &#160; &#160; &#160;&#160; 0

&lt;/code&gt;

I&#039;ve just used the &lt;em&gt;&lt;strong&gt;pivot()&lt;/strong&gt;&lt;/em&gt; function here on my origrinal query, but changed the equality to a &lt;em&gt;&lt;strong&gt;like&lt;/strong&gt;&lt;/em&gt;. This has lined up a few similar events in a nice tabular form.

If you want to get clever, you could even change the like to some variant of a &lt;em&gt;&lt;strong&gt;regexp()&lt;/strong&gt;&lt;/em&gt; function and pick out (say) all file reads and writes.

Update: Note that the &lt;em&gt;&lt;strong&gt;pivot()&lt;/strong&gt;&lt;/em&gt; clause is limited to keep the output readable on Wordpress.]]></description>
		<content:encoded><![CDATA[<p>Jeroen,<br />
Nice enhancement; it&#8217;s prompted me to write a version of the original code for 11g.</p>
<p><code><br />
column event format a32<br />
define m_event='db file%'<br />
define m_pause=20</p>
<p>with subq as (<br />
&nbsp; &nbsp; &nbsp; &nbsp; select<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event, wait_time_milli, sum(wait_count) wait_count<br />
&nbsp; &nbsp; &nbsp; &nbsp; from (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; select<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event, wait_time_milli, -1 * wait_count&nbsp; wait_count<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from&nbsp; &nbsp; v$event_histogram<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where&nbsp;&nbsp; event like '&amp;m_event'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; union all<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; select<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; null, jpl_numeric_wait( &amp;m_pause ,-1), null<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from&nbsp; &nbsp; dual<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; union all<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; select<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event, wait_time_milli, wait_count<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from&nbsp; &nbsp; v$event_histogram<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where&nbsp;&nbsp; event like&nbsp; '&amp;m_event'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br />
&nbsp; &nbsp; &nbsp; &nbsp; where<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wait_time_milli != -1<br />
&nbsp; &nbsp; &nbsp; &nbsp; group by<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event, wait_time_milli<br />
&nbsp; &nbsp; &nbsp; &nbsp; order by<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event, wait_time_milli<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
select<br />
&nbsp; &nbsp; &nbsp; &nbsp; *<br />
from<br />
&nbsp; &nbsp; &nbsp; &nbsp; subq<br />
&nbsp; &nbsp; &nbsp; &nbsp; pivot (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; max(wait_count)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; for wait_time_milli in (1,2,4,8,16,32)<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
order by<br />
&nbsp; &nbsp; &nbsp; &nbsp; event<br />
;</p>
<p>EVENT&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1&nbsp; &nbsp; &nbsp; 2&nbsp; &nbsp; &nbsp; 4&nbsp; &nbsp; &nbsp; 8&nbsp; &nbsp;&nbsp; 16&nbsp; &nbsp;&nbsp; 32<br />
---------------------- ------- ------ ------ ------ ------ ------<br />
db file parallel read&nbsp; &nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0<br />
db file parallel write&nbsp; &nbsp; &nbsp; 18&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0<br />
db file scattered read&nbsp; &nbsp; &nbsp;&nbsp; 1&nbsp; &nbsp; &nbsp; 1&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; 0<br />
db file sequential read&nbsp;&nbsp; 1379&nbsp; &nbsp; &nbsp; 5&nbsp; &nbsp; &nbsp; 4&nbsp; &nbsp;&nbsp; 11&nbsp; &nbsp;&nbsp; 33&nbsp; &nbsp;&nbsp; 34<br />
db file single write&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 0</p>
<p></code></p>
<p>I&#8217;ve just used the <em><strong>pivot()</strong></em> function here on my origrinal query, but changed the equality to a <em><strong>like</strong></em>. This has lined up a few similar events in a nice tabular form.</p>
<p>If you want to get clever, you could even change the like to some variant of a <em><strong>regexp()</strong></em> function and pick out (say) all file reads and writes.</p>
<p>Update: Note that the <em><strong>pivot()</strong></em> clause is limited to keep the output readable on WordPress.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeroen</title>
		<link>http://jonathanlewis.wordpress.com/2008/06/15/event-snapshots/#comment-31303</link>
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Mon, 16 Jun 2008 10:56:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=378#comment-31303</guid>
		<description><![CDATA[I tried this out on 11g and used the new pivot clause to produce a cross-tab from multiple collection samples.

&lt;code&gt;
create table evh (
snap_time           date,
event               varchar2(30),
wait_time_milli     number,
wait_time_count     number
);

insert into evh
select sysdate snap_time, iv.event event, iv.wait_time_milli, iv.wait_time_count
  from (
select
     event, wait_time_milli, sum(wait_count) wait_time_count
  from (
     select
             event, wait_time_milli, -1 * wait_count  wait_count
     from    v$event_histogram
     where   event = &#039;&amp;m_event&#039;
     union all
     select
             null, jpl_numeric_wait( &amp;m_pause ,-1), null
     from    dual
     union all
     select
             event, wait_time_milli, wait_count
     from    v$event_histogram
     where   event = &#039;&amp;m_event&#039;
     )
  where
     wait_time_milli != -1
  group by
     event, wait_time_milli
  order by
    event, wait_time_milli
) iv;

with data as (
     select to_char(snap_time,&#039;dd-mon-yy hh24:mi:ss&#039;), event, wait_time_milli, wait_time_count
     from evh
)
select *
from data
pivot (
     max(wait_time_count)
     for wait_time_milli 
     in (1,2,4,8,16,32,64,128,256,512,1024,2048 )
      )
order by 2,1
&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>I tried this out on 11g and used the new pivot clause to produce a cross-tab from multiple collection samples.</p>
<p><code><br />
create table evh (<br />
snap_time           date,<br />
event               varchar2(30),<br />
wait_time_milli     number,<br />
wait_time_count     number<br />
);</p>
<p>insert into evh<br />
select sysdate snap_time, iv.event event, iv.wait_time_milli, iv.wait_time_count<br />
  from (<br />
select<br />
     event, wait_time_milli, sum(wait_count) wait_time_count<br />
  from (<br />
     select<br />
             event, wait_time_milli, -1 * wait_count  wait_count<br />
     from    v$event_histogram<br />
     where   event = '&amp;m_event'<br />
     union all<br />
     select<br />
             null, jpl_numeric_wait( &amp;m_pause ,-1), null<br />
     from    dual<br />
     union all<br />
     select<br />
             event, wait_time_milli, wait_count<br />
     from    v$event_histogram<br />
     where   event = '&amp;m_event'<br />
     )<br />
  where<br />
     wait_time_milli != -1<br />
  group by<br />
     event, wait_time_milli<br />
  order by<br />
    event, wait_time_milli<br />
) iv;</p>
<p>with data as (<br />
     select to_char(snap_time,'dd-mon-yy hh24:mi:ss'), event, wait_time_milli, wait_time_count<br />
     from evh<br />
)<br />
select *<br />
from data<br />
pivot (<br />
     max(wait_time_count)<br />
     for wait_time_milli<br />
     in (1,2,4,8,16,32,64,128,256,512,1024,2048 )<br />
      )<br />
order by 2,1<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Event Histograms - 2 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/06/15/event-snapshots/#comment-31301</link>
		<dc:creator><![CDATA[Event Histograms - 2 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Mon, 16 Jun 2008 09:11:22 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=378#comment-31301</guid>
		<description><![CDATA[[...] Event Histograms -&#160;2 Filed under: Statspack, Troubleshooting &#8212; Jonathan Lewis @ 8:38 pm UTC Jan 31,2007   [Forward to part 3] [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Event Histograms -&nbsp;2 Filed under: Statspack, Troubleshooting &#8212; Jonathan Lewis @ 8:38 pm UTC Jan 31,2007   [Forward to part 3] [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lascoltodelvenerdi</title>
		<link>http://jonathanlewis.wordpress.com/2008/06/15/event-snapshots/#comment-31299</link>
		<dc:creator><![CDATA[lascoltodelvenerdi]]></dc:creator>
		<pubDate>Mon, 16 Jun 2008 08:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=378#comment-31299</guid>
		<description><![CDATA[Nice one.

Times ago, I was thinking about redefining some Oracle V$iews, or introduce some new ones, so I can have history in them.

They would be great for historic-events-analysis.]]></description>
		<content:encoded><![CDATA[<p>Nice one.</p>
<p>Times ago, I was thinking about redefining some Oracle V$iews, or introduce some new ones, so I can have history in them.</p>
<p>They would be great for historic-events-analysis.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
