<?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 2 Redo and Undo</title>
	<atom:link href="http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Fri, 24 May 2013 13:27:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Martin</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-54122</link>
		<dc:creator><![CDATA[Martin]]></dc:creator>
		<pubDate>Thu, 14 Mar 2013 21:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-54122</guid>
		<description><![CDATA[Hello Jonathan

I have a couple of questions related to the private redo buffers and in-memory undo which you describe starting at page 14.

1) From the figures on page 16 it seems, that a transaction hits the private redo allocation latch once (and presumably &quot;reserves&quot; the corresponding private redo buffer for exclusive usage until the transaction flushes its contents to a public redo buffer) while the transaction hits the in-memory undo latch once per change, which suggests that one in-memory undo pool may be used simultaneously by many transactions.
a) Are my conclusions about the usage patterns correct? I doubt a bit, as you state on page 16 &quot;1. Start the transaction by acquiring a matching pair of the private memory structures&quot;, which might be interpreted as &quot;acquiring them exclusively&quot; - however if this is the case, why would the transaction have to hit the in-memory undo latch once for every change?
b) If so, what justifies the different usage patterns? I.e. why are the private redo buffers used exclusively by a transaction while the in-memory undo pools are shared by concurrent transactions. It seems that the number of private redo buffers equals the number of in-memory undo pools (see http://www.teamycc.com/rmoug_2008_conference/PDF/Haisley.pdf, slide 20). To me this makes the different usage pattern /allocation schema even more surprising.
c) If my assumption on concurrent usage of the in-memory undo pools is correct, then upon commit a transaction has to search its undo change vectors from the in-memory undo pool as they may be mingled with undo change vectors from other transactions in the same pool. This seems as quite an overhead to me - are there any auxiliary structures mitigating that effect?

2) What is the reason to apply the changes to the data and undo blocks only upon commit (rather than right after creation of the change vectors)? Are there any performance benefits from this proceeding or is it just to ensure the write-ahead protocol is respected when DBWR writes data and undo blocks to disk (which I believe could also be achieved if the DBWR just looked at the block&#039;s &quot;has private redo&quot; flag).

3) Did you write any additional blog on the in-memory undo / private redo or do you know any other resources describing the mechanism in more details?

thank you
kind regards
Martin]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan</p>
<p>I have a couple of questions related to the private redo buffers and in-memory undo which you describe starting at page 14.</p>
<p>1) From the figures on page 16 it seems, that a transaction hits the private redo allocation latch once (and presumably &#8220;reserves&#8221; the corresponding private redo buffer for exclusive usage until the transaction flushes its contents to a public redo buffer) while the transaction hits the in-memory undo latch once per change, which suggests that one in-memory undo pool may be used simultaneously by many transactions.<br />
a) Are my conclusions about the usage patterns correct? I doubt a bit, as you state on page 16 &#8220;1. Start the transaction by acquiring a matching pair of the private memory structures&#8221;, which might be interpreted as &#8220;acquiring them exclusively&#8221; &#8211; however if this is the case, why would the transaction have to hit the in-memory undo latch once for every change?<br />
b) If so, what justifies the different usage patterns? I.e. why are the private redo buffers used exclusively by a transaction while the in-memory undo pools are shared by concurrent transactions. It seems that the number of private redo buffers equals the number of in-memory undo pools (see <a href="http://www.teamycc.com/rmoug_2008_conference/PDF/Haisley.pdf" rel="nofollow">http://www.teamycc.com/rmoug_2008_conference/PDF/Haisley.pdf</a>, slide 20). To me this makes the different usage pattern /allocation schema even more surprising.<br />
c) If my assumption on concurrent usage of the in-memory undo pools is correct, then upon commit a transaction has to search its undo change vectors from the in-memory undo pool as they may be mingled with undo change vectors from other transactions in the same pool. This seems as quite an overhead to me &#8211; are there any auxiliary structures mitigating that effect?</p>
<p>2) What is the reason to apply the changes to the data and undo blocks only upon commit (rather than right after creation of the change vectors)? Are there any performance benefits from this proceeding or is it just to ensure the write-ahead protocol is respected when DBWR writes data and undo blocks to disk (which I believe could also be achieved if the DBWR just looked at the block&#8217;s &#8220;has private redo&#8221; flag).</p>
<p>3) Did you write any additional blog on the in-memory undo / private redo or do you know any other resources describing the mechanism in more details?</p>
<p>thank you<br />
kind regards<br />
Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-52341</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 28 Dec 2012 10:58:23 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-52341</guid>
		<description><![CDATA[&lt;i&gt;&quot;the process of rollback can also produce redo record and undo record,and what is its own itl&quot;&lt;/i&gt;

When you roll back a transaction, you will generate redo because you are making changes to data blocks (which includes changed to undo blocks) - but you do not generate new undo records, you are only marking existing records as &quot;user applied&quot;. Rolling back does not create a new transaction so there is no need for further ITL entries to come into play.]]></description>
		<content:encoded><![CDATA[<p><i>&#8220;the process of rollback can also produce redo record and undo record,and what is its own itl&#8221;</i></p>
<p>When you roll back a transaction, you will generate redo because you are making changes to data blocks (which includes changed to undo blocks) &#8211; but you do not generate new undo records, you are only marking existing records as &#8220;user applied&#8221;. Rolling back does not create a new transaction so there is no need for further ITL entries to come into play.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yushangfu</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-52265</link>
		<dc:creator><![CDATA[yushangfu]]></dc:creator>
		<pubDate>Tue, 25 Dec 2012 03:42:08 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-52265</guid>
		<description><![CDATA[hello Jonathan

when we rollback a transaction ,we will apply the undo record in reverse order,and the itl in undo record will replace the itl in the data block …… finally,to get the correct version of the block.
the process of rollback can also produce redo record and undo record,and what is its own itl(i think the itl here is different from the itl replaced by the undo record)? the block have more than one itl ,when undo record cover one itl ,if the rollback session use another ltl to point to its own new undo?

thanks!!]]></description>
		<content:encoded><![CDATA[<p>hello Jonathan</p>
<p>when we rollback a transaction ,we will apply the undo record in reverse order,and the itl in undo record will replace the itl in the data block …… finally,to get the correct version of the block.<br />
the process of rollback can also produce redo record and undo record,and what is its own itl(i think the itl here is different from the itl replaced by the undo record)? the block have more than one itl ,when undo record cover one itl ,if the rollback session use another ltl to point to its own new undo?</p>
<p>thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-52098</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 13 Dec 2012 19:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-52098</guid>
		<description><![CDATA[Mohamed,

The comment is simply pointing out that when we make read-consistent copies of a block it&#039;s okay to discard them within a short period of time.
They can be useful, and the way the copy is used may mean that it stays in memory for some time - but it&#039;s not a copy that HAS to be protected for the sake of database correctness.  (Other sessions may be able to use the CR copy we&#039;ve created, either to read it directly, or to clone it and take their clone further back in time.).]]></description>
		<content:encoded><![CDATA[<p>Mohamed,</p>
<p>The comment is simply pointing out that when we make read-consistent copies of a block it&#8217;s okay to discard them within a short period of time.<br />
They can be useful, and the way the copy is used may mean that it stays in memory for some time &#8211; but it&#8217;s not a copy that HAS to be protected for the sake of database correctness.  (Other sessions may be able to use the CR copy we&#8217;ve created, either to read it directly, or to clone it and take their clone further back in time.).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hourim</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-51677</link>
		<dc:creator><![CDATA[hourim]]></dc:creator>
		<pubDate>Wed, 28 Nov 2012 10:38:44 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-51677</guid>
		<description><![CDATA[Hi Jonathan,

In page 21, you wrote:

“&quot;There is an important difference between read consistency and rolling back, of course. For read consistency we make a copy of the data block in memory and apply undo records to that block, and it&#039;s a copy of the block that we can discard very rapidly once we&#039;ve finished with it......&quot;

What do you mean by “and it&#039;s a copy of the block that we can discard very rapidly”?  I might not have clearly understood this. Does this mean that a new session could not benefit from an exact reconstructed read consistency image of a block done by a preceding session because the copy of the block used for that purpose has been rapidly discarded?

Or does the work done on the copy of the block is kept in the buffer cache(for reuse) while the copy of the block is thrown away?

My question came up here after having participated to the following otn thread :

https://forums.oracle.com/forums/message.jspa?messageID=10712705#10712705

Thanks in advance

Mohamed Houri]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>In page 21, you wrote:</p>
<p>“&#8221;There is an important difference between read consistency and rolling back, of course. For read consistency we make a copy of the data block in memory and apply undo records to that block, and it&#8217;s a copy of the block that we can discard very rapidly once we&#8217;ve finished with it&#8230;&#8230;&#8221;</p>
<p>What do you mean by “and it&#8217;s a copy of the block that we can discard very rapidly”?  I might not have clearly understood this. Does this mean that a new session could not benefit from an exact reconstructed read consistency image of a block done by a preceding session because the copy of the block used for that purpose has been rapidly discarded?</p>
<p>Or does the work done on the copy of the block is kept in the buffer cache(for reuse) while the copy of the block is thrown away?</p>
<p>My question came up here after having participated to the following otn thread :</p>
<p><a href="https://forums.oracle.com/forums/message.jspa?messageID=10712705#10712705" rel="nofollow">https://forums.oracle.com/forums/message.jspa?messageID=10712705#10712705</a></p>
<p>Thanks in advance</p>
<p>Mohamed Houri</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-50249</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 17 Sep 2012 20:41:39 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-50249</guid>
		<description><![CDATA[Wojciech,

The reference object for buffers is x$kcrfstrand, and there&#039;s a little script listing important addresses in the Appendix D, and I&#039;ve &lt;a href=&quot;http://jonathanlewis.wordpress.com/2012/09/17/private-redo-2/&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;&lt;strong&gt;just posted a variant&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt; on the script to show how you can get the sizes (and a little extra information) for your system. As a general principal, Oracle minimises the use of multiple log buffers (public and private). In the case of the private buffers this is done by picking the lowest numbered buffer that is available, in the case of the public buffers Oracle will only use more than one thread if there are indications of latch contention (on the public redo allocation latches.)

On a log writer flush, the log writer writes each of the public redo threads in turn before returning. Tony Hasler has &lt;a href=&quot;http://tonyhasler.wordpress.com/2011/07/24/log-file-sync-and-log-file-parallel-write-part-2/&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;&lt;strong&gt;an interesting post &lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;on this topic.

In general you shouldn&#039;t be setting the log_buffer parameter, but if you do you may find that the value you set is (roughly) divided equally between the number of public redo threads - but the behaviour is not very consistent.]]></description>
		<content:encoded><![CDATA[<p>Wojciech,</p>
<p>The reference object for buffers is x$kcrfstrand, and there&#8217;s a little script listing important addresses in the Appendix D, and I&#8217;ve <a href="http://jonathanlewis.wordpress.com/2012/09/17/private-redo-2/" rel="nofollow"><em><strong>just posted a variant</strong></em></a> on the script to show how you can get the sizes (and a little extra information) for your system. As a general principal, Oracle minimises the use of multiple log buffers (public and private). In the case of the private buffers this is done by picking the lowest numbered buffer that is available, in the case of the public buffers Oracle will only use more than one thread if there are indications of latch contention (on the public redo allocation latches.)</p>
<p>On a log writer flush, the log writer writes each of the public redo threads in turn before returning. Tony Hasler has <a href="http://tonyhasler.wordpress.com/2011/07/24/log-file-sync-and-log-file-parallel-write-part-2/" rel="nofollow"><em><strong>an interesting post </strong></em></a>on this topic.</p>
<p>In general you shouldn&#8217;t be setting the log_buffer parameter, but if you do you may find that the value you set is (roughly) divided equally between the number of public redo threads &#8211; but the behaviour is not very consistent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wojciech</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-50247</link>
		<dc:creator><![CDATA[Wojciech]]></dc:creator>
		<pubDate>Mon, 17 Sep 2012 18:24:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-50247</guid>
		<description><![CDATA[Jonathan, I would appreciate you clarification.

Page 15: Note [...] In 10g you get at least two public log buffers (redo threads) if you have more than one CPU.

I thought that multiple threads are only in RAC databases where each instance has its own thread. How big public log buffers are and what do they have in common with the buffer defined by log_buffer parameter? Is there any sort of redo record sorting when the log writer flushes the public log buffers to disk or are they managed independently?

How can I check how many public log buffers are used in my database? Any init parameter responsible for that? I see that log_parallelism dissappeared in 10g.]]></description>
		<content:encoded><![CDATA[<p>Jonathan, I would appreciate you clarification.</p>
<p>Page 15: Note [...] In 10g you get at least two public log buffers (redo threads) if you have more than one CPU.</p>
<p>I thought that multiple threads are only in RAC databases where each instance has its own thread. How big public log buffers are and what do they have in common with the buffer defined by log_buffer parameter? Is there any sort of redo record sorting when the log writer flushes the public log buffers to disk or are they managed independently?</p>
<p>How can I check how many public log buffers are used in my database? Any init parameter responsible for that? I see that log_parallelism dissappeared in 10g.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-49745</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 02 Sep 2012 21:46:57 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-49745</guid>
		<description><![CDATA[Martin,
1) It&#039;s aimed at blocks that are flagged as modified in the cache but which contain some sort of error. In principle I think this means that they would have to have been corrupted by a hardware bug or an Oracle code bug.

2) There are various points where the block (or part thereof) may be checked. Some checks can be enabled or disabled by parameter settings (e.g. db_block_checksum) some are simply built-in as implicit checks (e.g. code to update a row that finds that one row over-runs into a area of memory pointed at by another rowindex entry).

3) I don&#039;t really know. There are a couple statistics about &quot;db block corrupt&quot; and &quot;gc block corrupt&quot; that might be relevant (one of the checks applies when block are sent across the RAC interconnect, another as they arrive). It&#039;s also possible that some of the stats about block recovery and redo applied for recovery (which will be modified during instance recovery) wil also be modified during block recovery.

Possible statistics (may really be only for database startup)
[sourcecode]
redo blocks read for recovery
redo k-bytes read for recovery
db corrupt blocks detected
db corrupt blocks recovered
gc blocks corrupt
[/sourcecode]

Possible wait events
[sourcecode]
recovery buffer pinned
recovery read
[/sourcecode]
]]></description>
		<content:encoded><![CDATA[<p>Martin,<br />
1) It&#8217;s aimed at blocks that are flagged as modified in the cache but which contain some sort of error. In principle I think this means that they would have to have been corrupted by a hardware bug or an Oracle code bug.</p>
<p>2) There are various points where the block (or part thereof) may be checked. Some checks can be enabled or disabled by parameter settings (e.g. db_block_checksum) some are simply built-in as implicit checks (e.g. code to update a row that finds that one row over-runs into a area of memory pointed at by another rowindex entry).</p>
<p>3) I don&#8217;t really know. There are a couple statistics about &#8220;db block corrupt&#8221; and &#8220;gc block corrupt&#8221; that might be relevant (one of the checks applies when block are sent across the RAC interconnect, another as they arrive). It&#8217;s also possible that some of the stats about block recovery and redo applied for recovery (which will be modified during instance recovery) wil also be modified during block recovery.</p>
<p>Possible statistics (may really be only for database startup)</p>
<pre class="brush: plain; title: ; notranslate">
redo blocks read for recovery
redo k-bytes read for recovery
db corrupt blocks detected
db corrupt blocks recovered
gc blocks corrupt
</pre>
<p>Possible wait events</p>
<pre class="brush: plain; title: ; notranslate">
recovery buffer pinned
recovery read
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Maletinsky</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-49698</link>
		<dc:creator><![CDATA[Martin Maletinsky]]></dc:creator>
		<pubDate>Sat, 01 Sep 2012 10:01:13 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-49698</guid>
		<description><![CDATA[Hello Jonathan,

I have three question regarding the note on page 14 &quot;...a session can read the online redo log files when it discovers the in-memory version of a block to be corrupt...&quot;. 
1) What is the intended purpose of this mechanism, what kind of corruptions does this mechanism address, data corruptions caused by Oracle bugs, data corruptions caused by hardware (RAM) failures, any other data corruptions or a combination of those?
2) At which points during the processing does Oracle check in-memory blocks for data corruption (every time a session visits them, before the DBWR writes them to disk, ...)?
3) Is there any metric (e.g. session statistic) showing how many times in-memory blocks were checked for corruption and/or how many times online redo logs had to be used in order to rectify such corruptions?

Thanks a lot
kind regards
Martin]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan,</p>
<p>I have three question regarding the note on page 14 &#8220;&#8230;a session can read the online redo log files when it discovers the in-memory version of a block to be corrupt&#8230;&#8221;.<br />
1) What is the intended purpose of this mechanism, what kind of corruptions does this mechanism address, data corruptions caused by Oracle bugs, data corruptions caused by hardware (RAM) failures, any other data corruptions or a combination of those?<br />
2) At which points during the processing does Oracle check in-memory blocks for data corruption (every time a session visits them, before the DBWR writes them to disk, &#8230;)?<br />
3) Is there any metric (e.g. session statistic) showing how many times in-memory blocks were checked for corruption and/or how many times online redo logs had to be used in order to rectify such corruptions?</p>
<p>Thanks a lot<br />
kind regards<br />
Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raova</title>
		<link>http://jonathanlewis.wordpress.com/oracle-core/oc-2-undo-and-redo/#comment-46137</link>
		<dc:creator><![CDATA[raova]]></dc:creator>
		<pubDate>Fri, 20 Apr 2012 09:03:48 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=7135#comment-46137</guid>
		<description><![CDATA[Thanks Jonathan.
I havechecked the default setting for autocommit and it is OFF.
SQL&gt; show all
appinfo is OFF and set to &quot;SQL*Plus&quot;
arraysize 15
autocommit OFF
autoprint OFF
autorecovery OFF

MOS DOC ID 8338582.8 points to Bug 8338582 in 11.1.0.7 but that is with index access and says it has been fixed in 11.2.0.1 
Bug 8338582  SET TRANSACTION READ ONLY may see wrong data for index access.]]></description>
		<content:encoded><![CDATA[<p>Thanks Jonathan.<br />
I havechecked the default setting for autocommit and it is OFF.<br />
SQL&gt; show all<br />
appinfo is OFF and set to &#8220;SQL*Plus&#8221;<br />
arraysize 15<br />
autocommit OFF<br />
autoprint OFF<br />
autorecovery OFF</p>
<p>MOS DOC ID 8338582.8 points to Bug 8338582 in 11.1.0.7 but that is with index access and says it has been fixed in 11.2.0.1<br />
Bug 8338582  SET TRANSACTION READ ONLY may see wrong data for index access.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
