<?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: Another way to use trace file</title>
	<atom:link href="http://dioncho.wordpress.com/2009/03/19/another-way-to-use-trace-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://dioncho.wordpress.com/2009/03/19/another-way-to-use-trace-file/</link>
	<description>We are natural born scientists</description>
	<lastBuildDate>Fri, 17 Dec 2010 18:43:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Dion Cho</title>
		<link>http://dioncho.wordpress.com/2009/03/19/another-way-to-use-trace-file/#comment-333</link>
		<dc:creator><![CDATA[Dion Cho]]></dc:creator>
		<pubDate>Wed, 15 Jul 2009 03:17:38 +0000</pubDate>
		<guid isPermaLink="false">http://dioncho.wordpress.com/?p=441#comment-333</guid>
		<description><![CDATA[@Coskan.

It&#039;s a nice try. Besides that, many enhancements are possible, like merging multiple tracefiles without trcsess or cat invokation.]]></description>
		<content:encoded><![CDATA[<p>@Coskan.</p>
<p>It&#8217;s a nice try. Besides that, many enhancements are possible, like merging multiple tracefiles without trcsess or cat invokation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coskan</title>
		<link>http://dioncho.wordpress.com/2009/03/19/another-way-to-use-trace-file/#comment-332</link>
		<dc:creator><![CDATA[coskan]]></dc:creator>
		<pubDate>Tue, 14 Jul 2009 21:52:37 +0000</pubDate>
		<guid isPermaLink="false">http://dioncho.wordpress.com/?p=441#comment-332</guid>
		<description><![CDATA[I changed it a bit to get the benefits of 11g. 
get_tracefile1 does not work when you set tracefilename but if you use v$diag_info it gives you to use it with tracefilename identifier. 

-- get exact file_name
  select replace(value,(select value&#124;&#124;&#039;\&#039; from v$diag_info where name=&#039;Diag Trace&#039;),&#039;&#039;) into v_filename 
from v$diag_info where name=&#039;Default Trace File&#039;;]]></description>
		<content:encoded><![CDATA[<p>I changed it a bit to get the benefits of 11g.<br />
get_tracefile1 does not work when you set tracefilename but if you use v$diag_info it gives you to use it with tracefilename identifier. </p>
<p>&#8211; get exact file_name<br />
  select replace(value,(select value||&#8217;\&#8217; from v$diag_info where name=&#8217;Diag Trace&#8217;),&#8221;) into v_filename<br />
from v$diag_info where name=&#8217;Default Trace File&#8217;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mehmood</title>
		<link>http://dioncho.wordpress.com/2009/03/19/another-way-to-use-trace-file/#comment-151</link>
		<dc:creator><![CDATA[Mehmood]]></dc:creator>
		<pubDate>Sat, 11 Apr 2009 16:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://dioncho.wordpress.com/?p=441#comment-151</guid>
		<description><![CDATA[It is nice post, and very useful for DBAs.

cheers]]></description>
		<content:encoded><![CDATA[<p>It is nice post, and very useful for DBAs.</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dion Cho</title>
		<link>http://dioncho.wordpress.com/2009/03/19/another-way-to-use-trace-file/#comment-76</link>
		<dc:creator><![CDATA[Dion Cho]]></dc:creator>
		<pubDate>Thu, 19 Mar 2009 22:49:35 +0000</pubDate>
		<guid isPermaLink="false">http://dioncho.wordpress.com/?p=441#comment-76</guid>
		<description><![CDATA[Asif.

Yes, external table is another solution, but pipelined table function version is more flexible and easy to manage.

Anyway, I really like your regular expression solution! :)]]></description>
		<content:encoded><![CDATA[<p>Asif.</p>
<p>Yes, external table is another solution, but pipelined table function version is more flexible and easy to manage.</p>
<p>Anyway, I really like your regular expression solution! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asif Momen</title>
		<link>http://dioncho.wordpress.com/2009/03/19/another-way-to-use-trace-file/#comment-75</link>
		<dc:creator><![CDATA[Asif Momen]]></dc:creator>
		<pubDate>Thu, 19 Mar 2009 22:06:26 +0000</pubDate>
		<guid isPermaLink="false">http://dioncho.wordpress.com/?p=441#comment-75</guid>
		<description><![CDATA[That&#039;s really nice.

You could also use External Tables like this:


SQL&gt; drop table trace_table ;

Table dropped.

SQL&gt;
SQL&gt; create table
  2     trace_table ( txt  varchar2(1000) )
  3  organization external (
  4     type oracle_loader
  5     default directory TRACE_DIR
  6     access parameters (
  7        records delimited by newline
  8     )
  9     location(&#039;mydb_ora_3248_bbw2.trc&#039;)
 10  );

Table created.

SQL&gt;
SQL&gt; Column Cur_Id Format a6
SQL&gt; Column Event  Format a30
SQL&gt; Column Class  Format a5
SQL&gt;
SQL&gt; Select Cursor_number Cur_Id,
  2         Event,
  3         Class,
  4         Round(Sum(Elapsed/1000000), 2) Elapsed_Time,
  5         Count(Event) Cnt
  6     From (Select Substr(REGEXP_SUBSTR(txt,  &#039;WAIT #[^:]*&#039;), 7)  Cursor_number,
  7                  Substr(REGEXP_SUBSTR(txt,  &#039;&#039;&#039;[^&#039;&#039;]*&#039;), 2) Event,
  8                  Nvl(Substr(REGEXP_SUBSTR(txt,  &#039;class#=[^ ]*&#039;), 8), &#039;N/A&#039;) Class,
  9                  Substr(REGEXP_SUBSTR(txt,  &#039;ela= [^ ]*&#039;), 6) Elapsed
 10             from trace_table
 11            where REGEXP_SUBSTR(txt,  &#039;WAIT #[^:]*&#039;) is NOT null)
 12   Group by
 13            Cursor_number,
 14            Event,
 15            Class
 16   Order by Cursor_number;

CUR_ID EVENT                          CLASS ELAPSED_TIME        CNT
------ ------------------------------ ----- ------------ ----------
3      SQL*Net message from client    N/A          13.16          1
3      SQL*Net message to client      N/A              0          1
6      SQL*Net message from client    N/A          17.04          2
6      SQL*Net message to client      N/A              0          2
6      db file scattered read         N/A         443.29       6223
6      db file sequential read        N/A          15.24        210
6      latch: cache buffers chains    N/A            .04         22
6      latch: cache buffers lru chain N/A              0          2
6      read by other session          1           438.68      11148

9 rows selected.

SQL&gt;]]></description>
		<content:encoded><![CDATA[<p>That&#8217;s really nice.</p>
<p>You could also use External Tables like this:</p>
<p>SQL&gt; drop table trace_table ;</p>
<p>Table dropped.</p>
<p>SQL&gt;<br />
SQL&gt; create table<br />
  2     trace_table ( txt  varchar2(1000) )<br />
  3  organization external (<br />
  4     type oracle_loader<br />
  5     default directory TRACE_DIR<br />
  6     access parameters (<br />
  7        records delimited by newline<br />
  8     )<br />
  9     location(&#8216;mydb_ora_3248_bbw2.trc&#8217;)<br />
 10  );</p>
<p>Table created.</p>
<p>SQL&gt;<br />
SQL&gt; Column Cur_Id Format a6<br />
SQL&gt; Column Event  Format a30<br />
SQL&gt; Column Class  Format a5<br />
SQL&gt;<br />
SQL&gt; Select Cursor_number Cur_Id,<br />
  2         Event,<br />
  3         Class,<br />
  4         Round(Sum(Elapsed/1000000), 2) Elapsed_Time,<br />
  5         Count(Event) Cnt<br />
  6     From (Select Substr(REGEXP_SUBSTR(txt,  &#8216;WAIT #[^:]*&#8217;), 7)  Cursor_number,<br />
  7                  Substr(REGEXP_SUBSTR(txt,  &#8221;&#8217;[^'']*&#8217;), 2) Event,<br />
  8                  Nvl(Substr(REGEXP_SUBSTR(txt,  &#8216;class#=[^ ]*&#8217;), 8), &#8216;N/A&#8217;) Class,<br />
  9                  Substr(REGEXP_SUBSTR(txt,  &#8216;ela= [^ ]*&#8217;), 6) Elapsed<br />
 10             from trace_table<br />
 11            where REGEXP_SUBSTR(txt,  &#8216;WAIT #[^:]*&#8217;) is NOT null)<br />
 12   Group by<br />
 13            Cursor_number,<br />
 14            Event,<br />
 15            Class<br />
 16   Order by Cursor_number;</p>
<p>CUR_ID EVENT                          CLASS ELAPSED_TIME        CNT<br />
&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8211; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;-<br />
3      SQL*Net message from client    N/A          13.16          1<br />
3      SQL*Net message to client      N/A              0          1<br />
6      SQL*Net message from client    N/A          17.04          2<br />
6      SQL*Net message to client      N/A              0          2<br />
6      db file scattered read         N/A         443.29       6223<br />
6      db file sequential read        N/A          15.24        210<br />
6      latch: cache buffers chains    N/A            .04         22<br />
6      latch: cache buffers lru chain N/A              0          2<br />
6      read by other session          1           438.68      11148</p>
<p>9 rows selected.</p>
<p>SQL&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dombrooks</title>
		<link>http://dioncho.wordpress.com/2009/03/19/another-way-to-use-trace-file/#comment-74</link>
		<dc:creator><![CDATA[dombrooks]]></dc:creator>
		<pubDate>Thu, 19 Mar 2009 09:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://dioncho.wordpress.com/?p=441#comment-74</guid>
		<description><![CDATA[Good stuff.]]></description>
		<content:encoded><![CDATA[<p>Good stuff.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
