<?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: Shared SQL</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/</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: Blessed Sikosana</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2809</link>
		<dc:creator><![CDATA[Blessed Sikosana]]></dc:creator>
		<pubDate>Sun, 28 Jan 2007 21:35:19 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2809</guid>
		<description><![CDATA[While working in the telecommunications closet at Evco Insurance, you walk around the equipment rack and notice one hub with 2 ports whose collision lights are blinking almost constantly. Being a conscientious network professional, you point out this problem to the network manager. 
Question:
What troubleshooting step would be a wise follow-up to this discovery?]]></description>
		<content:encoded><![CDATA[<p>While working in the telecommunications closet at Evco Insurance, you walk around the equipment rack and notice one hub with 2 ports whose collision lights are blinking almost constantly. Being a conscientious network professional, you point out this problem to the network manager.<br />
Question:<br />
What troubleshooting step would be a wise follow-up to this discovery?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CT</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2552</link>
		<dc:creator><![CDATA[CT]]></dc:creator>
		<pubDate>Fri, 26 Jan 2007 14:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2552</guid>
		<description><![CDATA[Dear Mr.Lewis 
Thank you very much for the guidance. I believe you are right ,it is the  resource manager where I have to look and might be I should talk to our DBA who is controlling this.

Thought you might be interested in the observation what I made after changing the sequence cache, Here it is....

I changed the cache for the few sequences, last night snap shot shows me the library cache lock waits went down to  695 (from previous nights 1816) and wait time has gone down to 2023 (from previous nights 5307). But my program tokk the same time to complete (Not so lucky last night).



once again Thanks for your time . I am working in oracle (or any data base) for last 1 and 1/2 years so not quite knowledgeable , please bear with me if I throw any stupid questions .

with best 
CT]]></description>
		<content:encoded><![CDATA[<p>Dear Mr.Lewis<br />
Thank you very much for the guidance. I believe you are right ,it is the  resource manager where I have to look and might be I should talk to our DBA who is controlling this.</p>
<p>Thought you might be interested in the observation what I made after changing the sequence cache, Here it is&#8230;.</p>
<p>I changed the cache for the few sequences, last night snap shot shows me the library cache lock waits went down to  695 (from previous nights 1816) and wait time has gone down to 2023 (from previous nights 5307). But my program tokk the same time to complete (Not so lucky last night).</p>
<p>once again Thanks for your time . I am working in oracle (or any data base) for last 1 and 1/2 years so not quite knowledgeable , please bear with me if I throw any stupid questions .</p>
<p>with best<br />
CT</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2480</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 26 Jan 2007 02:41:02 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2480</guid>
		<description><![CDATA[CT - read about the Resource Manager and the package &lt;b&gt;dbms_resource_manager&lt;/b&gt;. A session which is subject to resource management will go into &lt;i&gt;&#039;resmgr&#039;&lt;/i&gt; waits when the CPU is under pressure. Note - the fact that this is happening suggests that at some stage in the batch, you were under CPU pressure - which may be why your other task had trouble running, and may have exacerbated any latch problem you had.

Precede the code with &lt;b&gt;&lt;code&gt;&lt;/b&gt;, follow it with &lt;b&gt;&lt;/code&gt;&lt;/b&gt;, and replace all spaces with &lt;b&gt;&nbsp;&lt;/b&gt;.]]></description>
		<content:encoded><![CDATA[<p>CT &#8211; read about the Resource Manager and the package <b>dbms_resource_manager</b>. A session which is subject to resource management will go into <i>&#8216;resmgr&#8217;</i> waits when the CPU is under pressure. Note &#8211; the fact that this is happening suggests that at some stage in the batch, you were under CPU pressure &#8211; which may be why your other task had trouble running, and may have exacerbated any latch problem you had.</p>
<p>Precede the code with <b>&lt;code&gt;</b>, follow it with <b>&lt;/code&gt;</b>, and replace all spaces with <b>&amp;nbsp;</b>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CT</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2432</link>
		<dc:creator><![CDATA[CT]]></dc:creator>
		<pubDate>Thu, 25 Jan 2007 18:09:45 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2432</guid>
		<description><![CDATA[Dear Mr.Lewis

Thank you very much for detailed clarification.
version is 10.2.0.1.0

I didn&#039;t think that the percentage should be 100 %. Thought it is a ratio of all the wait events, looking at the other reports five events are adding up to (100+ or - 3 ) %.

yes we are running with sga_target parameter.

I was going down the report to find what is adding up to hard parses , 
I found this statement 
and an update seq stmt
[sourcecode]
update seq$ 
set increment$=:2, 
    minvalue=:3,
    maxvalue=:4,
    cycle#=:5,
    order$=:6,
   cache=:7,
   highwater=:8,
   audit$=:9,
   flags=:10 
where obj#=:1
[/sourcecode]
is parsed for 223,294 and executed for same number oftimes.

Looking in to the other batch pgms running at the same time I found sequence cache are set for 20 where as we generate 35,000 unique numbers. I am not sure whether this is causing the latch problem........I need to change the cache and see how they are performing.

I have tuned my batch program with the help of 10046 level 8.  
.


I did not understand what do you mean by this

&quot;After all, the batch job might have voluntarily lost its time by yielding the CPU in the resource manager&quot;

is there any where I can read more about this stuff.

Thanks again for your time.

CT

p.s How did you formatted my report.I couldn&#039;t get it right.]]></description>
		<content:encoded><![CDATA[<p>Dear Mr.Lewis</p>
<p>Thank you very much for detailed clarification.<br />
version is 10.2.0.1.0</p>
<p>I didn&#8217;t think that the percentage should be 100 %. Thought it is a ratio of all the wait events, looking at the other reports five events are adding up to (100+ or &#8211; 3 ) %.</p>
<p>yes we are running with sga_target parameter.</p>
<p>I was going down the report to find what is adding up to hard parses ,<br />
I found this statement<br />
and an update seq stmt</p>
<pre class="brush: plain; title: ; notranslate">
update seq$ 
set increment$=:2, 
    minvalue=:3,
    maxvalue=:4,
    cycle#=:5,
    order$=:6,
   cache=:7,
   highwater=:8,
   audit$=:9,
   flags=:10 
where obj#=:1
</pre>
<p>is parsed for 223,294 and executed for same number oftimes.</p>
<p>Looking in to the other batch pgms running at the same time I found sequence cache are set for 20 where as we generate 35,000 unique numbers. I am not sure whether this is causing the latch problem&#8230;&#8230;..I need to change the cache and see how they are performing.</p>
<p>I have tuned my batch program with the help of 10046 level 8.<br />
.</p>
<p>I did not understand what do you mean by this</p>
<p>&#8220;After all, the batch job might have voluntarily lost its time by yielding the CPU in the resource manager&#8221;</p>
<p>is there any where I can read more about this stuff.</p>
<p>Thanks again for your time.</p>
<p>CT</p>
<p>p.s How did you formatted my report.I couldn&#8217;t get it right.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2345</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 25 Jan 2007 00:44:11 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2345</guid>
		<description><![CDATA[CT - which specific version of 10.2, it is a little odd (though not signficant) that your percentages sum to 50%.

It seems unlikely, though not impossible, that a small number of “hard parses” would cause the time loss. However, it is a possible that a single operation hitting a silly bug could jam your batch job for ages. (Are you, for example, running with automatic SGA management - there might be a previously unrecorded bug in the code that caused a single parse call to hang for ages). 

Bottom line, though, it is not possible to draw any conclusions about your batch job from this summary. After all, the batch job might have voluntarily lost its time by yielding the CPU in the &lt;em&gt;&lt;strong&gt;resource manager&lt;/strong&gt;&lt;/em&gt; code path; it might have had to wait for 22 of the &lt;em&gt;&#039;lost&#039;&lt;/em&gt; minutes because of &lt;em&gt;&lt;strong&gt;TM&lt;/strong&gt;&lt;/em&gt; lock waits; it might have had to compete more for latches, and therefore used more CPU 

Since you have a batch job to watch, a low-impact strategy would be to add selects from &lt;em&gt;&lt;strong&gt;v$mystat&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;v$sesstat&lt;/strong&gt;&lt;/em&gt; (for the current SID) to capture the work done and time lost by the session. Otherwise you just need to trace the batch job (10046 level 8 ) to see exactly where the time was spent.]]></description>
		<content:encoded><![CDATA[<p>CT &#8211; which specific version of 10.2, it is a little odd (though not signficant) that your percentages sum to 50%.</p>
<p>It seems unlikely, though not impossible, that a small number of “hard parses” would cause the time loss. However, it is a possible that a single operation hitting a silly bug could jam your batch job for ages. (Are you, for example, running with automatic SGA management &#8211; there might be a previously unrecorded bug in the code that caused a single parse call to hang for ages). </p>
<p>Bottom line, though, it is not possible to draw any conclusions about your batch job from this summary. After all, the batch job might have voluntarily lost its time by yielding the CPU in the <em><strong>resource manager</strong></em> code path; it might have had to wait for 22 of the <em>&#8216;lost&#8217;</em> minutes because of <em><strong>TM</strong></em> lock waits; it might have had to compete more for latches, and therefore used more CPU </p>
<p>Since you have a batch job to watch, a low-impact strategy would be to add selects from <em><strong>v$mystat</strong></em> and <em><strong>v$sesstat</strong></em> (for the current SID) to capture the work done and time lost by the session. Otherwise you just need to trace the batch job (10046 level 8 ) to see exactly where the time was spent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CT</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2204</link>
		<dc:creator><![CDATA[CT]]></dc:creator>
		<pubDate>Tue, 23 Jan 2007 22:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2204</guid>
		<description><![CDATA[Hello Mr. Lewis

I was studying a system of 4 cpu in 10 g r2. We took a snap shot for one hour period during which our batch programs run. Found Following 
&lt;code&gt;
EVENT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;WAITS&#160;&#160;&#160;Time(s)&#160;&#160;&#160;AvgWait(ms)&#160;&#160;%TotalCallTime
-----------------------&#160;----------&#160;---------&#160;&#160;&#160;-----------&#160;&#160;&#160;-------------
resmgr:become&#160;active&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;274&#160;&#160;&#160;&#160;15,162&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;55,334&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;26.5
library&#160;cache&#160;lock&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2,360&#160;&#160;&#160;&#160;&#160;6,893&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2,921&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;12.0
CPU&#160;time&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6,869&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;12.0
db&#160;file&#160;sequential&#160;read&#160;&#160;&#160;&#160;851,324&#160;&#160;&#160;&#160;&#160;4,386&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.7
enq:&#160;TM&#160;-&#160;contention&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;460&#160;&#160;&#160;&#160;&#160;1,340&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2,914&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.3
&lt;/code&gt;

If I see the report , Library cache lock is second(114 minutes). I was using one of your stats pack analysis link from your jl comp page . Looking deep into the report I found we are having a hard parse of 1.69/ second. 

I am wondering does this hard parse alone is constituting for the library_cache_lock or some other factor can also constitute. If so, what should I be looking for.........your guidence in this regard would be really helpful.

I took the snap shot for this hour , because one of my batch program when I run in development it runs for 35 minutes and when I run during the above  hour in production it is taking more than an hour ( to be exact 1 hour 20 minutes).  

Thank you very much for sharing your wisdom.

with best
CT]]></description>
		<content:encoded><![CDATA[<p>Hello Mr. Lewis</p>
<p>I was studying a system of 4 cpu in 10 g r2. We took a snap shot for one hour period during which our batch programs run. Found Following<br />
<code><br />
EVENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WAITS&nbsp;&nbsp;&nbsp;Time(s)&nbsp;&nbsp;&nbsp;AvgWait(ms)&nbsp;&nbsp;%TotalCallTime<br />
-----------------------&nbsp;----------&nbsp;---------&nbsp;&nbsp;&nbsp;-----------&nbsp;&nbsp;&nbsp;-------------<br />
resmgr:become&nbsp;active&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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;&nbsp;7.7<br />
enq:&nbsp;TM&nbsp;-&nbsp;contention&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;460&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,340&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2,914&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.3<br />
</code></p>
<p>If I see the report , Library cache lock is second(114 minutes). I was using one of your stats pack analysis link from your jl comp page . Looking deep into the report I found we are having a hard parse of 1.69/ second. </p>
<p>I am wondering does this hard parse alone is constituting for the library_cache_lock or some other factor can also constitute. If so, what should I be looking for&#8230;&#8230;&#8230;your guidence in this regard would be really helpful.</p>
<p>I took the snap shot for this hour , because one of my batch program when I run in development it runs for 35 minutes and when I run during the above  hour in production it is taking more than an hour ( to be exact 1 hour 20 minutes).  </p>
<p>Thank you very much for sharing your wisdom.</p>
<p>with best<br />
CT</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2201</link>
		<dc:creator><![CDATA[Gary]]></dc:creator>
		<pubDate>Tue, 23 Jan 2007 21:44:26 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2201</guid>
		<description><![CDATA[Thanks for that]]></description>
		<content:encoded><![CDATA[<p>Thanks for that</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2167</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 23 Jan 2007 10:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2167</guid>
		<description><![CDATA[Gary, you have to remember that there are several different classes of linked lists running through the buffer headers array, and a couple running through the library cache.

For example, you may have 128,000 cache buffers chains (linked lists) which make it possible for your session to find a particular block very quickly if it is in memory - compute the id of the chain it&#039;s on and the linked list is very short. At the same time, there may only be 16 LRU chains (linked lists) running through your whole buffer and (virtually) every buffer is on one of those chains.

So when you kick a block out of memory, you go to the end of an LRU chain to disconnect the buffer from it - but you then have to work out which cache buffers chain it&#039;s on and remove it from that chain as well.]]></description>
		<content:encoded><![CDATA[<p>Gary, you have to remember that there are several different classes of linked lists running through the buffer headers array, and a couple running through the library cache.</p>
<p>For example, you may have 128,000 cache buffers chains (linked lists) which make it possible for your session to find a particular block very quickly if it is in memory &#8211; compute the id of the chain it&#8217;s on and the linked list is very short. At the same time, there may only be 16 LRU chains (linked lists) running through your whole buffer and (virtually) every buffer is on one of those chains.</p>
<p>So when you kick a block out of memory, you go to the end of an LRU chain to disconnect the buffer from it &#8211; but you then have to work out which cache buffers chain it&#8217;s on and remove it from that chain as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2123</link>
		<dc:creator><![CDATA[Gary]]></dc:creator>
		<pubDate>Mon, 22 Jan 2007 22:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/#comment-2123</guid>
		<description><![CDATA[&quot;by someone else adding or removing an entry&quot;
I&#039;m trying to get a mental picture of this. In a perfect (OLTP) world, would most of the changes to linked list entries (data blocks and SQL area) involve movement up and down the lists in accordance with &#039;least recently used&#039; rather than things being removed or added to the list ?]]></description>
		<content:encoded><![CDATA[<p>&#8220;by someone else adding or removing an entry&#8221;<br />
I&#8217;m trying to get a mental picture of this. In a perfect (OLTP) world, would most of the changes to linked list entries (data blocks and SQL area) involve movement up and down the lists in accordance with &#8216;least recently used&#8217; rather than things being removed or added to the list ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
