<?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: OC 3 Transactions and Consistency</title>
	<atom:link href="http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Wed, 19 Jun 2013 18:51:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Roman Muschinskiy</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-55138</link>
		<dc:creator><![CDATA[Roman Muschinskiy]]></dc:creator>
		<pubDate>Tue, 30 Apr 2013 17:28:11 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-55138</guid>
		<description><![CDATA[... Answering my own question, apparently from Xid.. And 0x01802ec8 is data block address...]]></description>
		<content:encoded><![CDATA[<p>&#8230; Answering my own question, apparently from Xid.. And 0x01802ec8 is data block address&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roman Muschinskiy</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-55133</link>
		<dc:creator><![CDATA[Roman Muschinskiy]]></dc:creator>
		<pubDate>Tue, 30 Apr 2013 14:56:01 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-55133</guid>
		<description><![CDATA[Hello Jonathan! Greetings from Russia!

On page 38 it is said &quot;Finally, you can see from the uba that if you go to record 5 of block 11,976 of file 6 (which should have sequence number 0x0543)&quot;. My question is where does &quot;block 11,976&quot; as well as &quot;file 6&quot; come from ? If you look at uba - 0x01802ec8.0543.05: 

05 - undo record number (comes from transaction table)
0543 - sequence number

0x01802ec8 to decimal gives us 25177800 (which is SCN I guess..). How do you manage to get that block and file number info?

Thank you very much in advance!]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan! Greetings from Russia!</p>
<p>On page 38 it is said &#8220;Finally, you can see from the uba that if you go to record 5 of block 11,976 of file 6 (which should have sequence number 0&#215;0543)&#8221;. My question is where does &#8220;block 11,976&#8243; as well as &#8220;file 6&#8243; come from ? If you look at uba &#8211; 0x01802ec8.0543.05: </p>
<p>05 &#8211; undo record number (comes from transaction table)<br />
0543 &#8211; sequence number</p>
<p>0x01802ec8 to decimal gives us 25177800 (which is SCN I guess..). How do you manage to get that block and file number info?</p>
<p>Thank you very much in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-52565</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 06 Jan 2013 15:34:50 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-52565</guid>
		<description><![CDATA[Wojciech,

I don&#039;t think v$undostat really fits in chapter 3 with transactions, it would be more appropriate in the context of chapter 2 (redo and undo) but I didn&#039;t make any comments about how much space had to be allocated for keeping undo and how Oracle managed it.

Here&#039;s an outline that may help answer your questions. We can set (or Oracle can automatically adjust) and &quot;undo retention&quot; time with the intention that no undo block should be overwritten until the transaction(s) that generated the undo records in that undo block have been committed for at least that amount of time. Although this retention time is often spoken of in terms of keeping blocks the actually granularity of the check occurs at the extent level.

Assume a session is changing load of data in a single transaction and the undo_retention is 900 seconds. Assume our transaction is quite large and generates a lot of undo very quickly. At some point we happen to fill the last available block in the current extent and move on to the next extent in the chain that makes up our undo segment, and find that the commit SCN for the most recently committed undo record in that extent happened only 12 minutes ago. This is the scenario where most of these columns are relevant.

We &lt;b&gt;can&#039;t&lt;/b&gt; immediately overwrite the next extent, so we have to grow the segment - which is easy if there is free space in the undo tablespace, but if there isn&#039;t we first check to see if there are any other segments which have &quot;expired&quot; extents, i.e. extents with no undo records that were committed less than 900 seconds ago. If we find one (and I believe we pick the oldest such extent we can find) then we have &quot;stolen&quot; an &quot;expired&quot; extent, (EXPSTEALCNT goes up by one) while the other segment has &quot;released&quot; &quot;expired&quot; blocks (EXPBLKRELCNT) - and we record the block count because UNDO extents can be of different sizes.

If we find that no other segment has any expired blocks, we look for the extent with the oldest commit. This isn &quot;unexpired&quot; extent, and we steal it because we have to continue working -- this gives us the UNXPSTEALCNT and UNXPBLKRELCNT. One bit of timing I&#039;m not sure about (and would have to research) is whether we overwrite unexpired extents from our own segment before stealing extents from other segments - this overwriting of our own unexpired extents is the UNXPBLKREUCNT (counting blocks from the extent). Of course if we had had some expired extents in our own segment when we got to the end of the current segment we would simply have run the transaction on into the next (i.e. oldest) extent - and this would have shown up under EXPBLKREUCNT.

As for ACTIVEBLKS, UNEXPIREDBLKS and EXPIREDBLKS, I haven&#039;t looked closely at them - I&#039;ve only glanced at the definition and guessed at what they mean and haven&#039;t had to work out whether or not my guess is correct.  I suspect that they are snapshots taken either at the beginning or end of the snapshot interval (10 minutes).

Expired blocks are probably blocks in extents where the entire extent has been used and all transactions committed far enough in the past to be outside the retention time.

Unexpired blocks are probably blocks in extents where the entire extent has been used but the extent has some transactions in it that committed in the recent past - i.e. less than &quot;retention time&quot; seconds ago.

Active blocks are probably blocks in extents where there is a transaction that has used blocks in that extent and has not yet committed.
]]></description>
		<content:encoded><![CDATA[<p>Wojciech,</p>
<p>I don&#8217;t think v$undostat really fits in chapter 3 with transactions, it would be more appropriate in the context of chapter 2 (redo and undo) but I didn&#8217;t make any comments about how much space had to be allocated for keeping undo and how Oracle managed it.</p>
<p>Here&#8217;s an outline that may help answer your questions. We can set (or Oracle can automatically adjust) and &#8220;undo retention&#8221; time with the intention that no undo block should be overwritten until the transaction(s) that generated the undo records in that undo block have been committed for at least that amount of time. Although this retention time is often spoken of in terms of keeping blocks the actually granularity of the check occurs at the extent level.</p>
<p>Assume a session is changing load of data in a single transaction and the undo_retention is 900 seconds. Assume our transaction is quite large and generates a lot of undo very quickly. At some point we happen to fill the last available block in the current extent and move on to the next extent in the chain that makes up our undo segment, and find that the commit SCN for the most recently committed undo record in that extent happened only 12 minutes ago. This is the scenario where most of these columns are relevant.</p>
<p>We <b>can&#8217;t</b> immediately overwrite the next extent, so we have to grow the segment &#8211; which is easy if there is free space in the undo tablespace, but if there isn&#8217;t we first check to see if there are any other segments which have &#8220;expired&#8221; extents, i.e. extents with no undo records that were committed less than 900 seconds ago. If we find one (and I believe we pick the oldest such extent we can find) then we have &#8220;stolen&#8221; an &#8220;expired&#8221; extent, (EXPSTEALCNT goes up by one) while the other segment has &#8220;released&#8221; &#8220;expired&#8221; blocks (EXPBLKRELCNT) &#8211; and we record the block count because UNDO extents can be of different sizes.</p>
<p>If we find that no other segment has any expired blocks, we look for the extent with the oldest commit. This isn &#8220;unexpired&#8221; extent, and we steal it because we have to continue working &#8212; this gives us the UNXPSTEALCNT and UNXPBLKRELCNT. One bit of timing I&#8217;m not sure about (and would have to research) is whether we overwrite unexpired extents from our own segment before stealing extents from other segments &#8211; this overwriting of our own unexpired extents is the UNXPBLKREUCNT (counting blocks from the extent). Of course if we had had some expired extents in our own segment when we got to the end of the current segment we would simply have run the transaction on into the next (i.e. oldest) extent &#8211; and this would have shown up under EXPBLKREUCNT.</p>
<p>As for ACTIVEBLKS, UNEXPIREDBLKS and EXPIREDBLKS, I haven&#8217;t looked closely at them &#8211; I&#8217;ve only glanced at the definition and guessed at what they mean and haven&#8217;t had to work out whether or not my guess is correct.  I suspect that they are snapshots taken either at the beginning or end of the snapshot interval (10 minutes).</p>
<p>Expired blocks are probably blocks in extents where the entire extent has been used and all transactions committed far enough in the past to be outside the retention time.</p>
<p>Unexpired blocks are probably blocks in extents where the entire extent has been used but the extent has some transactions in it that committed in the recent past &#8211; i.e. less than &#8220;retention time&#8221; seconds ago.</p>
<p>Active blocks are probably blocks in extents where there is a transaction that has used blocks in that extent and has not yet committed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wojciech</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-52559</link>
		<dc:creator><![CDATA[Wojciech]]></dc:creator>
		<pubDate>Sun, 06 Jan 2013 12:35:48 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-52559</guid>
		<description><![CDATA[I think I am confused with columns UNXPSTEALCNT, UNXPBLKRELCNT, UNXPBLKREUCNT and EXPSTEALCNT, EXPBLKRELCNT, EXPBLKREUCNT. What this stealing of expired and non-expired blocks is about? I haven&#039;t found it in the chapter.

And regarding ACTIVEBLKS, UNEXPIREDBLKS and EXPIREDBLKS, what exactly are active, unexpired and expired blocks in the context of transaction managment?]]></description>
		<content:encoded><![CDATA[<p>I think I am confused with columns UNXPSTEALCNT, UNXPBLKRELCNT, UNXPBLKREUCNT and EXPSTEALCNT, EXPBLKRELCNT, EXPBLKREUCNT. What this stealing of expired and non-expired blocks is about? I haven&#8217;t found it in the chapter.</p>
<p>And regarding ACTIVEBLKS, UNEXPIREDBLKS and EXPIREDBLKS, what exactly are active, unexpired and expired blocks in the context of transaction managment?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-52419</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 31 Dec 2012 11:18:48 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-52419</guid>
		<description><![CDATA[Prashnath,

Sorry about the delay in answering this question. You&#039;re heading in the right direction, but your comment isn&#039;t quite right.
It&#039;s important to remember that when a buffer is written to disc it isn&#039;t cleared from memory (unless dbwr has been called to write it because a session needs some free buffers). With this though in mind:

a) commit cleanout can occur if the block is in the buffer - whether or not it has been written to disc. In fact if I update the block, then something causes it to be flushed from memory, then you re-read it, and then I commit, I can still visit that (back) in-memory copy of the block and apply commit cleanout.

b) delayed block cleanout occurs if commit cleanout hasn&#039;t occured, and the block has been flushed from memory (which means it must have been written to disc); and it occurs the next time someone reads the block into memory.  If I only committed after the block was flushed, that would be one reason why commit cleanout hadn&#039;t happened; but possibly I didn&#039;t even commit until the block had been flushed, possibly some other process was pinning the buffer at the moment that I committed and wanted to do a commit cleanout.]]></description>
		<content:encoded><![CDATA[<p>Prashnath,</p>
<p>Sorry about the delay in answering this question. You&#8217;re heading in the right direction, but your comment isn&#8217;t quite right.<br />
It&#8217;s important to remember that when a buffer is written to disc it isn&#8217;t cleared from memory (unless dbwr has been called to write it because a session needs some free buffers). With this though in mind:</p>
<p>a) commit cleanout can occur if the block is in the buffer &#8211; whether or not it has been written to disc. In fact if I update the block, then something causes it to be flushed from memory, then you re-read it, and then I commit, I can still visit that (back) in-memory copy of the block and apply commit cleanout.</p>
<p>b) delayed block cleanout occurs if commit cleanout hasn&#8217;t occured, and the block has been flushed from memory (which means it must have been written to disc); and it occurs the next time someone reads the block into memory.  If I only committed after the block was flushed, that would be one reason why commit cleanout hadn&#8217;t happened; but possibly I didn&#8217;t even commit until the block had been flushed, possibly some other process was pinning the buffer at the moment that I committed and wanted to do a commit cleanout.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-52073</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 13 Dec 2012 13:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-52073</guid>
		<description><![CDATA[What&#039;s not in the documentation that you think you need to know ?
http://docs.oracle.com/cd/E11882_01/server.112/e25513/dynviews_3118.htm]]></description>
		<content:encoded><![CDATA[<p>What&#8217;s not in the documentation that you think you need to know ?<br />
<a href="http://docs.oracle.com/cd/E11882_01/server.112/e25513/dynviews_3118.htm" rel="nofollow">http://docs.oracle.com/cd/E11882_01/server.112/e25513/dynviews_3118.htm</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-52072</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 13 Dec 2012 13:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-52072</guid>
		<description><![CDATA[Mike,

Correct - I&#039;ve got the two columns the wrong way round.
(It&#039;s also extremely unlikely that two slots from different segment would be at exactly the same sequence at the same time;)]]></description>
		<content:encoded><![CDATA[<p>Mike,</p>
<p>Correct &#8211; I&#8217;ve got the two columns the wrong way round.<br />
(It&#8217;s also extremely unlikely that two slots from different segment would be at exactly the same sequence at the same time;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wojciech</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-50963</link>
		<dc:creator><![CDATA[Wojciech]]></dc:creator>
		<pubDate>Wed, 24 Oct 2012 14:17:24 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-50963</guid>
		<description><![CDATA[Jonathan, could you explain the meaning of v$undostat columns in the context of this chapter?]]></description>
		<content:encoded><![CDATA[<p>Jonathan, could you explain the meaning of v$undostat columns in the context of this chapter?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Kinkade</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-50746</link>
		<dc:creator><![CDATA[Mike Kinkade]]></dc:creator>
		<pubDate>Fri, 12 Oct 2012 14:28:39 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-50746</guid>
		<description><![CDATA[On Page 41 in Figure 3-3 in the ITL List: The order of both XID entires is showing as undo segment.undo sequence number.undo slot (3.1843.9) . Should it be (3.9.1843)undo segment.undo slot. undo sequence number ? Thanks]]></description>
		<content:encoded><![CDATA[<p>On Page 41 in Figure 3-3 in the ITL List: The order of both XID entires is showing as undo segment.undo sequence number.undo slot (3.1843.9) . Should it be (3.9.1843)undo segment.undo slot. undo sequence number ? Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavol Babel</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-3-transactions-and-consistency/#comment-50672</link>
		<dc:creator><![CDATA[Pavol Babel]]></dc:creator>
		<pubDate>Sun, 07 Oct 2012 22:49:29 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7137#comment-50672</guid>
		<description><![CDATA[Oh I made  silly mistake in my test case, hence I can tell your script core_cleanout_4.sql will work on 11.2.0.3 too. No matter what errors I made, I would like to ask question. Oracle session creates private copy of transaction table in buffer cache (I guess it could keep it pinned), later applying undo record as needed. Does it keep private version of TT also cross  subsequent  calls? 

Interestingly, when oracle performs single session direct path read on table and repeat same query again (at least in same read only transaction), it won&#039;t perform TTR any more, although there is still plenty of data blocks with dirty ITL slots placed on disks (because direct path read didn&#039;t clear them).

Regards
Pavol Babel]]></description>
		<content:encoded><![CDATA[<p>Oh I made  silly mistake in my test case, hence I can tell your script core_cleanout_4.sql will work on 11.2.0.3 too. No matter what errors I made, I would like to ask question. Oracle session creates private copy of transaction table in buffer cache (I guess it could keep it pinned), later applying undo record as needed. Does it keep private version of TT also cross  subsequent  calls? </p>
<p>Interestingly, when oracle performs single session direct path read on table and repeat same query again (at least in same read only transaction), it won&#8217;t perform TTR any more, although there is still plenty of data blocks with dirty ITL slots placed on disks (because direct path read didn&#8217;t clear them).</p>
<p>Regards<br />
Pavol Babel</p>
]]></content:encoded>
	</item>
</channel>
</rss>
