<?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: Undo Segments &#8211; What is Wrong with this Quote?</title>
	<atom:link href="http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/feed/" rel="self" type="application/rss+xml" />
	<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/</link>
	<description>Miscellaneous Random Oracle Topics: Stop, Think, ... Understand</description>
	<lastBuildDate>Mon, 13 May 2013 14:10:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1469</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 23 Jun 2010 12:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1469</guid>
		<description><![CDATA[I appreciate your discussion on this topic.  Very helpful information.]]></description>
		<content:encoded><![CDATA[<p>I appreciate your discussion on this topic.  Very helpful information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1465</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 22 Jun 2010 16:38:56 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1465</guid>
		<description><![CDATA[Charles,

I&#039;m not sure that a fast commit rate would necessarily affect the number of buffer busy waits. Your session has to latch the block then pin the block to modify it to start a transaction. Your session only has to latch a block to check if it has an active transaction, and if your session decides the block has no active transaction it&#039;s possible that there is something in the &quot;pin it exclusive / change it&quot; code path that says - if the block is already pinned (or maybe pinned exclusive) then drop the latch and move on to the next undo header.

The upshot of this, and this is also just speculation: if you have an active transaction in an undo segment header I won&#039;t try to pin the block (which means I won&#039;t force your subsequent attempt to &quot;commit&quot; to wait), if you have pinned a block that appears to have no active transactions I won&#039;t try to pin it because you might be about to add an active transaction to it. So we (almost) never see active BBW on undo headers unless we keep cycling through all of them and then waiting for exclusive pins as we come round a second time.]]></description>
		<content:encoded><![CDATA[<p>Charles,</p>
<p>I&#8217;m not sure that a fast commit rate would necessarily affect the number of buffer busy waits. Your session has to latch the block then pin the block to modify it to start a transaction. Your session only has to latch a block to check if it has an active transaction, and if your session decides the block has no active transaction it&#8217;s possible that there is something in the &#8220;pin it exclusive / change it&#8221; code path that says &#8211; if the block is already pinned (or maybe pinned exclusive) then drop the latch and move on to the next undo header.</p>
<p>The upshot of this, and this is also just speculation: if you have an active transaction in an undo segment header I won&#8217;t try to pin the block (which means I won&#8217;t force your subsequent attempt to &#8220;commit&#8221; to wait), if you have pinned a block that appears to have no active transactions I won&#8217;t try to pin it because you might be about to add an active transaction to it. So we (almost) never see active BBW on undo headers unless we keep cycling through all of them and then waiting for exclusive pins as we come round a second time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Centinul</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1463</link>
		<dc:creator><![CDATA[Centinul]]></dc:creator>
		<pubDate>Tue, 22 Jun 2010 13:13:22 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1463</guid>
		<description><![CDATA[Charles --

&quot;As long as Centinul did not create the table T1 in the SYSTEM tablespace&quot;

The table T1 was created in the SYSTEM tablespace (this is a test system :) ). I receive an error when I try and create this table in another tablespace.

&lt;pre&gt;SQL&gt; CREATE TABLE T1 (
  2    C1 NUMBER,
  3    C2 VARCHAR2(10)) TABLESPACE USERS;
CREATE TABLE T1 (
*
ERROR at line 1:
ORA-01552: cannot use system rollback segment for non-system tablespace &#039;USERS&#039;&lt;/pre&gt;

This does seem to confirm your assertion that the undo segment is in the SYSTEM tablespace.

If I have a sufficiently sized undo tablespace I can create the table perfectly fine in another tablespace (ex. USERS). It seems to occur only when there isn&#039;t enough space in the tablespace specified by the UNDO_TABLESPACE parameter. I tried creating T1 first with a sufficiently sized undo tablespace and then changed the UNDO_TABLESPACE parameter to the small undo tablespace I created, but when attempting to insert on T1 I received the same error as above.]]></description>
		<content:encoded><![CDATA[<p>Charles &#8211;</p>
<p>&#8220;As long as Centinul did not create the table T1 in the SYSTEM tablespace&#8221;</p>
<p>The table T1 was created in the SYSTEM tablespace (this is a test system <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). I receive an error when I try and create this table in another tablespace.</p>
<pre>SQL&gt; CREATE TABLE T1 (
  2    C1 NUMBER,
  3    C2 VARCHAR2(10)) TABLESPACE USERS;
CREATE TABLE T1 (
*
ERROR at line 1:
ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'</pre>
<p>This does seem to confirm your assertion that the undo segment is in the SYSTEM tablespace.</p>
<p>If I have a sufficiently sized undo tablespace I can create the table perfectly fine in another tablespace (ex. USERS). It seems to occur only when there isn&#8217;t enough space in the tablespace specified by the UNDO_TABLESPACE parameter. I tried creating T1 first with a sufficiently sized undo tablespace and then changed the UNDO_TABLESPACE parameter to the small undo tablespace I created, but when attempting to insert on T1 I received the same error as above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1461</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Tue, 22 Jun 2010 11:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1461</guid>
		<description><![CDATA[Centinul,

Thank you for performing the test.  It seems that Oracle Database is OK with using a single undo segment.

I think that you just answered question number 10 in this article:
http://hoopercharles.wordpress.com/2010/05/09/true-or-false-undo/
&quot;10. The automatically created undo segments in the SYSTEM tablespace will only be used when modifying objects residing in the SYSTEM tablespace.&quot;

(To Anyone:) Please correct me if I am wrong, but I believe that undo segment 0 is located in the SYSTEM tablespace.  As long as Centinul did not create the table T1 in the SYSTEM tablespace, I think that he just demonstrated that question number 10 in the my other blog article is false, and possibly also demonstrated that question number 11 is false.

I wonder if you need to bounce the database before it will create the additional undo segments in UNDOTBS02?

---------
Edit (5 minutes after the comment post):
To verify that undo segment 0 is located in the SYSTEM tablespace:
&lt;pre&gt;
SELECT
  NAME
FROM
  V$ROLLNAME
WHERE
  USN=0;
 
NAME
------
SYSTEM
&lt;/pre&gt;
 
&lt;pre&gt;
SELECT
  NAME
FROM
  V$ROLLNAME
WHERE
  USN=1;
 
NAME
---------
_SYSSMU1$
&lt;/pre&gt;

- above is from 10.2.0.4, on 11.1.0.7 -
&lt;pre&gt;
SELECT
  NAME
FROM
  V$ROLLNAME
WHERE
  USN=1;
 
NAME
--------------------
_SYSSMU1_1236281137$
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Centinul,</p>
<p>Thank you for performing the test.  It seems that Oracle Database is OK with using a single undo segment.</p>
<p>I think that you just answered question number 10 in this article:<br />
<a href="http://hoopercharles.wordpress.com/2010/05/09/true-or-false-undo/" rel="nofollow">http://hoopercharles.wordpress.com/2010/05/09/true-or-false-undo/</a><br />
&#8220;10. The automatically created undo segments in the SYSTEM tablespace will only be used when modifying objects residing in the SYSTEM tablespace.&#8221;</p>
<p>(To Anyone:) Please correct me if I am wrong, but I believe that undo segment 0 is located in the SYSTEM tablespace.  As long as Centinul did not create the table T1 in the SYSTEM tablespace, I think that he just demonstrated that question number 10 in the my other blog article is false, and possibly also demonstrated that question number 11 is false.</p>
<p>I wonder if you need to bounce the database before it will create the additional undo segments in UNDOTBS02?</p>
<p>&#8212;&#8212;&#8212;<br />
Edit (5 minutes after the comment post):<br />
To verify that undo segment 0 is located in the SYSTEM tablespace:</p>
<pre>
SELECT
  NAME
FROM
  V$ROLLNAME
WHERE
  USN=0;
 
NAME
------
SYSTEM
</pre>
<pre>
SELECT
  NAME
FROM
  V$ROLLNAME
WHERE
  USN=1;
 
NAME
---------
_SYSSMU1$
</pre>
<p>- above is from 10.2.0.4, on 11.1.0.7 -</p>
<pre>
SELECT
  NAME
FROM
  V$ROLLNAME
WHERE
  USN=1;
 
NAME
--------------------
_SYSSMU1_1236281137$
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Centinul</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1459</link>
		<dc:creator><![CDATA[Centinul]]></dc:creator>
		<pubDate>Tue, 22 Jun 2010 11:21:19 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1459</guid>
		<description><![CDATA[Charles --

Thanks for providing the information. I extended your test a little further by creating the smallest undo tablespace I could (81K) to see if Oracle would use the same segment for different transactions. Here are the results:

Setup and first transaction:

&lt;pre&gt;SQL&gt; -- Session 1
SQL&gt; SELECT * FROM V$VERSION;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production

SQL&gt; SHOW PARAMETER UNDO_MANAGEMENT

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO

SQL&gt; CREATE UNDO TABLESPACE UNDOTBS02 DATAFILE &#039;D:\oracle\oradata\pmpprod\undotbs02.dbf&#039; SIZE 81K REUSE AUTOEXTEND OFF;

Tablespace created.

SQL&gt; ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS02;

System altered.

SQL&gt; CREATE TABLE T1 (
  2    C1 NUMBER,
  3    C2 VARCHAR2(10));

Table created.

SQL&gt; SELECT
  2    XIDUSN SEGMENT,
  3    XIDSLOT SLOT,
  4    USED_UBLK,
  5    USED_UREC
  6  FROM
  7    V$TRANSACTION;

no rows selected

SQL&gt; INSERT INTO T1 VALUES (1,&#039;1&#039;);

1 row created.

SQL&gt; SELECT
  2    XIDUSN SEGMENT,
  3    XIDSLOT SLOT,
  4    USED_UBLK,
  5    USED_UREC
  6  FROM
  7    V$TRANSACTION;

             SEGMENT                 SLOT            USED_UBLK            USED_UREC
-------------------- -------------------- -------------------- --------------------
                   0                   36                    1                    1&lt;/pre&gt;

Second session:

&lt;pre&gt;SQL&gt; -- Session 2
SQL&gt; INSERT INTO T1 VALUES (2,&#039;2&#039;);

1 row created.

SQL&gt; SELECT
  2    XIDUSN SEGMENT,
  3    XIDSLOT SLOT,
  4    USED_UBLK,
  5    USED_UREC
  6  FROM
  7    V$TRANSACTION;

             SEGMENT                 SLOT            USED_UBLK            USED_UREC
-------------------- -------------------- -------------------- --------------------
                   0                   36                    1                    1
                   0                   30                    1                    1&lt;/pre&gt;

Same segment. Third session:

&lt;pre&gt;SQL&gt; -- Session 3
SQL&gt; INSERT INTO T1 VALUES (2,&#039;2&#039;);

1 row created.

SQL&gt;
SQL&gt; SELECT
  2    XIDUSN SEGMENT,
  3    XIDSLOT SLOT,
  4    USED_UBLK,
  5    USED_UREC
  6  FROM
  7    V$TRANSACTION;

             SEGMENT                 SLOT            USED_UBLK            USED_UREC
-------------------- -------------------- -------------------- --------------------
                   0                   36                    1                    1
                   0                   85                    1                    1
                   0                   30                    1                    1&lt;/pre&gt;

Again, same segment. Final stats:

&lt;pre&gt;SQL&gt; SELECT
  2    USN,
  3    EXTENTS
  4  FROM
  5    V$ROLLSTAT
  6  ORDER BY
  7    USN;

                 USN              EXTENTS
-------------------- --------------------
                   0                    6

SQL&gt; SELECT
  2    *
  3  FROM
  4    V$WAITSTAT
  5  ORDER BY
  6    COUNT DESC,
  7    TIME,
  8    CLASS;

CLASS                             COUNT                 TIME
------------------ -------------------- --------------------
data block                            4                    4
segment header                        2                    0
undo header                           2                    0
system undo header                    1                    0
1st level bmb                         0                    0
2nd level bmb                         0                    0
3rd level bmb                         0                    0
bitmap block                          0                    0
bitmap index block                    0                    0
extent map                            0                    0
file header block                     0                    0
free list                             0                    0
save undo block                       0                    0
save undo header                      0                    0
sort block                            0                    0
system undo block                     0                    0
undo block                            0                    0
unused                                0                    0

18 rows selected.&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Charles &#8211;</p>
<p>Thanks for providing the information. I extended your test a little further by creating the smallest undo tablespace I could (81K) to see if Oracle would use the same segment for different transactions. Here are the results:</p>
<p>Setup and first transaction:</p>
<pre>SQL&gt; -- Session 1
SQL&gt; SELECT * FROM V$VERSION;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production

SQL&gt; SHOW PARAMETER UNDO_MANAGEMENT

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO

SQL&gt; CREATE UNDO TABLESPACE UNDOTBS02 DATAFILE 'D:\oracle\oradata\pmpprod\undotbs02.dbf' SIZE 81K REUSE AUTOEXTEND OFF;

Tablespace created.

SQL&gt; ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS02;

System altered.

SQL&gt; CREATE TABLE T1 (
  2    C1 NUMBER,
  3    C2 VARCHAR2(10));

Table created.

SQL&gt; SELECT
  2    XIDUSN SEGMENT,
  3    XIDSLOT SLOT,
  4    USED_UBLK,
  5    USED_UREC
  6  FROM
  7    V$TRANSACTION;

no rows selected

SQL&gt; INSERT INTO T1 VALUES (1,'1');

1 row created.

SQL&gt; SELECT
  2    XIDUSN SEGMENT,
  3    XIDSLOT SLOT,
  4    USED_UBLK,
  5    USED_UREC
  6  FROM
  7    V$TRANSACTION;

             SEGMENT                 SLOT            USED_UBLK            USED_UREC
-------------------- -------------------- -------------------- --------------------
                   0                   36                    1                    1</pre>
<p>Second session:</p>
<pre>SQL&gt; -- Session 2
SQL&gt; INSERT INTO T1 VALUES (2,'2');

1 row created.

SQL&gt; SELECT
  2    XIDUSN SEGMENT,
  3    XIDSLOT SLOT,
  4    USED_UBLK,
  5    USED_UREC
  6  FROM
  7    V$TRANSACTION;

             SEGMENT                 SLOT            USED_UBLK            USED_UREC
-------------------- -------------------- -------------------- --------------------
                   0                   36                    1                    1
                   0                   30                    1                    1</pre>
<p>Same segment. Third session:</p>
<pre>SQL&gt; -- Session 3
SQL&gt; INSERT INTO T1 VALUES (2,'2');

1 row created.

SQL&gt;
SQL&gt; SELECT
  2    XIDUSN SEGMENT,
  3    XIDSLOT SLOT,
  4    USED_UBLK,
  5    USED_UREC
  6  FROM
  7    V$TRANSACTION;

             SEGMENT                 SLOT            USED_UBLK            USED_UREC
-------------------- -------------------- -------------------- --------------------
                   0                   36                    1                    1
                   0                   85                    1                    1
                   0                   30                    1                    1</pre>
<p>Again, same segment. Final stats:</p>
<pre>SQL&gt; SELECT
  2    USN,
  3    EXTENTS
  4  FROM
  5    V$ROLLSTAT
  6  ORDER BY
  7    USN;

                 USN              EXTENTS
-------------------- --------------------
                   0                    6

SQL&gt; SELECT
  2    *
  3  FROM
  4    V$WAITSTAT
  5  ORDER BY
  6    COUNT DESC,
  7    TIME,
  8    CLASS;

CLASS                             COUNT                 TIME
------------------ -------------------- --------------------
data block                            4                    4
segment header                        2                    0
undo header                           2                    0
system undo header                    1                    0
1st level bmb                         0                    0
2nd level bmb                         0                    0
3rd level bmb                         0                    0
bitmap block                          0                    0
bitmap index block                    0                    0
extent map                            0                    0
file header block                     0                    0
free list                             0                    0
save undo block                       0                    0
save undo header                      0                    0
sort block                            0                    0
system undo block                     0                    0
undo block                            0                    0
unused                                0                    0

18 rows selected.</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1455</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Tue, 22 Jun 2010 01:19:18 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1455</guid>
		<description><![CDATA[Jonathan,

Very helpful comments - thank you.  You are correct that the buffer busy waits discussed in this particular paragraph are for the undo segment header blocks (I should have mentioned that).  Some of your comments tie directly into those made by Alistair Wall and Centinul.

I wonder if a very fast, continuous commit rate in a single session, for instance more than 100 commits per second, could contribute to the number of buffer busy waits for the undo header blocks.  It would seem that the session might need to inspect the various undo header blocks to find an undo segment without an active transaction, and this inspection might lead to buffer busy waits if the session could not quickly access the current version of the undo segment header (this is not a statement, just speculation).]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>Very helpful comments &#8211; thank you.  You are correct that the buffer busy waits discussed in this particular paragraph are for the undo segment header blocks (I should have mentioned that).  Some of your comments tie directly into those made by Alistair Wall and Centinul.</p>
<p>I wonder if a very fast, continuous commit rate in a single session, for instance more than 100 commits per second, could contribute to the number of buffer busy waits for the undo header blocks.  It would seem that the session might need to inspect the various undo header blocks to find an undo segment without an active transaction, and this inspection might lead to buffer busy waits if the session could not quickly access the current version of the undo segment header (this is not a statement, just speculation).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1454</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 21 Jun 2010 21:33:45 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1454</guid>
		<description><![CDATA[The &quot;buffer busy waits&quot; the author has in mind are probably waits for undo segment header - which would occur if two processes were trying to acquire, free, or update a transaction table entry at the same time. However, they can probably occur in circumstances where just one process is attempting to modify the block - for example, it&#039;s possible (and I haven&#039;t proved this) that a reader process will pin the block exclusive to clone it for reasons relating to transaction table read consistency.

To a very large extent the comments in the paragraph are correct - but (a) you&#039;d probably have to have several transactions active per undo segment before you saw any real threat from buffer busy waits on the segment header block, there would probably be more important problems elsewhere; and (b) you could always increase the size of the file rather than adding a new data file.]]></description>
		<content:encoded><![CDATA[<p>The &#8220;buffer busy waits&#8221; the author has in mind are probably waits for undo segment header &#8211; which would occur if two processes were trying to acquire, free, or update a transaction table entry at the same time. However, they can probably occur in circumstances where just one process is attempting to modify the block &#8211; for example, it&#8217;s possible (and I haven&#8217;t proved this) that a reader process will pin the block exclusive to clone it for reasons relating to transaction table read consistency.</p>
<p>To a very large extent the comments in the paragraph are correct &#8211; but (a) you&#8217;d probably have to have several transactions active per undo segment before you saw any real threat from buffer busy waits on the segment header block, there would probably be more important problems elsewhere; and (b) you could always increase the size of the file rather than adding a new data file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1453</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Mon, 21 Jun 2010 21:28:34 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1453</guid>
		<description><![CDATA[Now for sentence number 3: &quot;This usually takes care of the buffer busy waits.&quot;  Note that this is output from a different database:
&lt;pre&gt;
SELECT
  *
FROM
  V$WAITSTAT
ORDER BY
  COUNT DESC,
  TIME,
  CLASS;

CLASS                   COUNT       TIME
------------------ ---------- ----------
undo header                79          0
data block                 18        179
file header block           2          2
1st level bmb               0          0
2nd level bmb               0          0
3rd level bmb               0          0
bitmap block                0          0
bitmap index block          0          0
extent map                  0          0
free list                   0          0
save undo block             0          0
save undo header            0          0
segment header              0          0
sort block                  0          0
system undo block           0          0
system undo header          0          0
undo block                  0          0
unused                      0          0
 
SELECT
  USN,
  EXTENTS
FROM
  V$ROLLSTAT
ORDER BY
  USN;
 
USN    EXTENTS
--- ----------
  0          6
  1         10
  2          4
  3          5
  4          6
  5         10
  6          5
  7          8
  8          5
  9          5
 10          6
&lt;/pre&gt;

Should I not be seeing buffer busy waits for the undo header - with Automatic Undo Management enabled, there are more waits for the undo header blocks than for data blocks.  Of course the time is insignificant for the undo header block buffer busy waits.

Sentence number 3 might not be correct.]]></description>
		<content:encoded><![CDATA[<p>Now for sentence number 3: &#8220;This usually takes care of the buffer busy waits.&#8221;  Note that this is output from a different database:</p>
<pre>
SELECT
  *
FROM
  V$WAITSTAT
ORDER BY
  COUNT DESC,
  TIME,
  CLASS;

CLASS                   COUNT       TIME
------------------ ---------- ----------
undo header                79          0
data block                 18        179
file header block           2          2
1st level bmb               0          0
2nd level bmb               0          0
3rd level bmb               0          0
bitmap block                0          0
bitmap index block          0          0
extent map                  0          0
free list                   0          0
save undo block             0          0
save undo header            0          0
segment header              0          0
sort block                  0          0
system undo block           0          0
system undo header          0          0
undo block                  0          0
unused                      0          0
 
SELECT
  USN,
  EXTENTS
FROM
  V$ROLLSTAT
ORDER BY
  USN;
 
USN    EXTENTS
--- ----------
  0          6
  1         10
  2          4
  3          5
  4          6
  5         10
  6          5
  7          8
  8          5
  9          5
 10          6
</pre>
<p>Should I not be seeing buffer busy waits for the undo header &#8211; with Automatic Undo Management enabled, there are more waits for the undo header blocks than for data blocks.  Of course the time is insignificant for the undo header block buffer busy waits.</p>
<p>Sentence number 3 might not be correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1452</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Mon, 21 Jun 2010 20:55:38 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1452</guid>
		<description><![CDATA[A brief test to determine the accuracy of the first two sentences using Oracle Database 11.1.0.7:

&lt;pre&gt;
(Session 1):
CREATE TABLE T1 (
  C1 NUMBER,
  C2 VARCHAR2(10));

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

no rows selected

INSERT INTO T1 VALUES (1,&#039;1&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

   SEGMENT       SLOT  USED_UBLK  USED_UREC
---------- ---------- ---------- ----------
         1         28          1          1
&lt;/pre&gt;

We now have a test table and a single active transaction using undo segment 1.

&lt;pre&gt;
(Session 2):
INSERT INTO T1 VALUES (2,&#039;2&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

   SEGMENT       SLOT  USED_UBLK  USED_UREC
---------- ---------- ---------- ----------
         1         28          1          1
         7         10          1          1
&lt;/pre&gt;

The second session&#039;s transaction is using undo segment 7 rather than undo segment 1.

&lt;pre&gt;
(Session 3):
INSERT INTO T1 VALUES (3,&#039;3&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;
 
 SEGMENT       SLOT  USED_UBLK  USED_UREC
-------- ---------- ---------- ----------
       1         28          1          1
       7         10          1          1
      10         14          1          1

(Session 4):
INSERT INTO T1 VALUES (4,&#039;4&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

   SEGMENT       SLOT  USED_UBLK  USED_UREC
---------- ---------- ---------- ----------
         4          2          1          1
         1         28          1          1
         7         10          1          1
        10         14          1          1
&lt;/pre&gt;

We now have 4 active transactions, each using a different undo extent.  Must be that there are *many* undo segments - luck of the draw?
&lt;pre&gt;
SELECT
  USN,
  EXTENTS
FROM
  V$ROLLSTAT
ORDER BY
  USN;

USN    EXTENTS
--- ----------
  0          6
  1          4
  2          3
  3          3
  4          3
  5          5
  6          3
  7          3
  8          3
  9          3
 10          4
&lt;/pre&gt;

Just 10 undo segments (plus the one in the SYSTEM tablespace).  So, what happens if we continue?
&lt;pre&gt;
(Session 5):
INSERT INTO T1 VALUES (5,&#039;5&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      4          2          1          1
      1         28          1          1
      7         10          1          1
      8          1          1          1
     10         14          1          1

(Session 6):
INSERT INTO T1 VALUES (6,&#039;6&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
     10         14          1          1

(Session 7):
INSERT INTO T1 VALUES (7,&#039;7&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
     10         14          1          1
      3         14          1          1

(Session 8):
INSERT INTO T1 VALUES (8,&#039;8&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
      6          7          1          1
     10         14          1          1
      3         14          1          1

(Session 9):
INSERT INTO T1 VALUES (9,&#039;9&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      9         29          1          1
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
      6          7          1          1
     10         14          1          1
      3         14          1          1

(Session 10):
INSERT INTO T1 VALUES (10,&#039;10&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      2          2          1          1
      9         29          1          1
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
      6          7          1          1
     10         14          1          1
      3         14          1          1
&lt;/pre&gt;

Each session is currently in its own undo segment, so for this test the first sentence from the book quote seems to be correct.

Now, let&#039;s check the second sentence:
&lt;pre&gt;
(Session 11):
INSERT INTO T1 VALUES (11,&#039;11&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      2          2          1          1
      9         29          1          1
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
     11          6          1          1
      8          1          1          1
      6          7          1          1
     10         14          1          1
      3         14          1          1

(Session 12):
INSERT INTO T1 VALUES (12,&#039;12&#039;);

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      2          2          1          1
      9         29          1          1
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
     11          6          1          1
      8          1          1          1
      6          7          1          1
     12         13          1          1
     10         14          1          1
      3         14          1          1
&lt;/pre&gt;
Just to verify:
&lt;pre&gt;
SELECT
  USN,
  EXTENTS
FROM
  V$ROLLSTAT
ORDER BY
  USN;

USN    EXTENTS
--- ----------
  0          6
  1          4
  2          3
  3          3
  4          3
  5          5
  6          3
  7          3
  8          3
  9          3
 10          4
 11          2
 12          2
 13          2
&lt;/pre&gt;

The above test seems to confirm that the second sentence is correct.  Now, the rest of the paragraph?]]></description>
		<content:encoded><![CDATA[<p>A brief test to determine the accuracy of the first two sentences using Oracle Database 11.1.0.7:</p>
<pre>
(Session 1):
CREATE TABLE T1 (
  C1 NUMBER,
  C2 VARCHAR2(10));

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

no rows selected

INSERT INTO T1 VALUES (1,'1');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

   SEGMENT       SLOT  USED_UBLK  USED_UREC
---------- ---------- ---------- ----------
         1         28          1          1
</pre>
<p>We now have a test table and a single active transaction using undo segment 1.</p>
<pre>
(Session 2):
INSERT INTO T1 VALUES (2,'2');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

   SEGMENT       SLOT  USED_UBLK  USED_UREC
---------- ---------- ---------- ----------
         1         28          1          1
         7         10          1          1
</pre>
<p>The second session&#8217;s transaction is using undo segment 7 rather than undo segment 1.</p>
<pre>
(Session 3):
INSERT INTO T1 VALUES (3,'3');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;
 
 SEGMENT       SLOT  USED_UBLK  USED_UREC
-------- ---------- ---------- ----------
       1         28          1          1
       7         10          1          1
      10         14          1          1

(Session 4):
INSERT INTO T1 VALUES (4,'4');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

   SEGMENT       SLOT  USED_UBLK  USED_UREC
---------- ---------- ---------- ----------
         4          2          1          1
         1         28          1          1
         7         10          1          1
        10         14          1          1
</pre>
<p>We now have 4 active transactions, each using a different undo extent.  Must be that there are *many* undo segments &#8211; luck of the draw?</p>
<pre>
SELECT
  USN,
  EXTENTS
FROM
  V$ROLLSTAT
ORDER BY
  USN;

USN    EXTENTS
--- ----------
  0          6
  1          4
  2          3
  3          3
  4          3
  5          5
  6          3
  7          3
  8          3
  9          3
 10          4
</pre>
<p>Just 10 undo segments (plus the one in the SYSTEM tablespace).  So, what happens if we continue?</p>
<pre>
(Session 5):
INSERT INTO T1 VALUES (5,'5');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      4          2          1          1
      1         28          1          1
      7         10          1          1
      8          1          1          1
     10         14          1          1

(Session 6):
INSERT INTO T1 VALUES (6,'6');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
     10         14          1          1

(Session 7):
INSERT INTO T1 VALUES (7,'7');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
     10         14          1          1
      3         14          1          1

(Session 8):
INSERT INTO T1 VALUES (8,'8');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
      6          7          1          1
     10         14          1          1
      3         14          1          1

(Session 9):
INSERT INTO T1 VALUES (9,'9');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      9         29          1          1
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
      6          7          1          1
     10         14          1          1
      3         14          1          1

(Session 10):
INSERT INTO T1 VALUES (10,'10');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      2          2          1          1
      9         29          1          1
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
      8          1          1          1
      6          7          1          1
     10         14          1          1
      3         14          1          1
</pre>
<p>Each session is currently in its own undo segment, so for this test the first sentence from the book quote seems to be correct.</p>
<p>Now, let&#8217;s check the second sentence:</p>
<pre>
(Session 11):
INSERT INTO T1 VALUES (11,'11');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      2          2          1          1
      9         29          1          1
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
     11          6          1          1
      8          1          1          1
      6          7          1          1
     10         14          1          1
      3         14          1          1

(Session 12):
INSERT INTO T1 VALUES (12,'12');

SELECT
  XIDUSN SEGMENT,
  XIDSLOT SLOT,
  USED_UBLK,
  USED_UREC 
FROM
  V$TRANSACTION;

SEGMENT       SLOT  USED_UBLK  USED_UREC
------- ---------- ---------- ----------
      2          2          1          1
      9         29          1          1
      4          2          1          1
      1         28          1          1
      5          5          1          1
      7         10          1          1
     11          6          1          1
      8          1          1          1
      6          7          1          1
     12         13          1          1
     10         14          1          1
      3         14          1          1
</pre>
<p>Just to verify:</p>
<pre>
SELECT
  USN,
  EXTENTS
FROM
  V$ROLLSTAT
ORDER BY
  USN;

USN    EXTENTS
--- ----------
  0          6
  1          4
  2          3
  3          3
  4          3
  5          5
  6          3
  7          3
  8          3
  9          3
 10          4
 11          2
 12          2
 13          2
</pre>
<p>The above test seems to confirm that the second sentence is correct.  Now, the rest of the paragraph?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/06/21/undo-segments-what-is-wrong-with-this-quote/#comment-1450</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Mon, 21 Jun 2010 13:59:11 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=2685#comment-1450</guid>
		<description><![CDATA[Centinul,

When I read the above quote from the book I searched the documentation and found the web page that you included in your comment.  Here is the section in the documentation that caused me to pause, and pose the question of whether or not the book&#039;s paragraph is correct:

&lt;blockquote&gt;At any given time, a transaction writes sequentially to only one extent in an undo segment, known as the current extent for the transaction. Multiple active transactions can write simultaneously to the same current extent or to different current extents. Figure 12-20 shows transactions T1 and T2 writing simultaneously to extent E3. Within an undo extent, a data block contains data for only one transaction.
 
As the current undo extent fills, the first transaction needing space checks the availability of the next allocated extent in the ring. If the next extent does &lt;em&gt;not&lt;/em&gt; contain data from an active transaction, then this extent becomes the current extent. Now all transactions that need space can write to the new current extent. In Figure 12-21, when E4 is full, T1 and T2 continue writing to E1, overwriting the nonactive undo data in E1.
 
If the next extent &lt;em&gt;does&lt;/em&gt; contain data from an active transaction, then the database must allocate a new extent. Figure 12-22 shows a scenario in which T1 and T2 are writing to E4. When E4 fills up, the transactions cannot continue writing to E1 because E1 contains active undo entries. Therefore, the database allocates a new extent (E5) for this undo segment. The transactions continue writing to E5.&lt;/blockquote&gt;

The above quote from the documentation seems to describe a different sequence of events than what appears in the book.

Any other comments?]]></description>
		<content:encoded><![CDATA[<p>Centinul,</p>
<p>When I read the above quote from the book I searched the documentation and found the web page that you included in your comment.  Here is the section in the documentation that caused me to pause, and pose the question of whether or not the book&#8217;s paragraph is correct:</p>
<blockquote><p>At any given time, a transaction writes sequentially to only one extent in an undo segment, known as the current extent for the transaction. Multiple active transactions can write simultaneously to the same current extent or to different current extents. Figure 12-20 shows transactions T1 and T2 writing simultaneously to extent E3. Within an undo extent, a data block contains data for only one transaction.</p>
<p>As the current undo extent fills, the first transaction needing space checks the availability of the next allocated extent in the ring. If the next extent does <em>not</em> contain data from an active transaction, then this extent becomes the current extent. Now all transactions that need space can write to the new current extent. In Figure 12-21, when E4 is full, T1 and T2 continue writing to E1, overwriting the nonactive undo data in E1.</p>
<p>If the next extent <em>does</em> contain data from an active transaction, then the database must allocate a new extent. Figure 12-22 shows a scenario in which T1 and T2 are writing to E4. When E4 fills up, the transactions cannot continue writing to E1 because E1 contains active undo entries. Therefore, the database allocates a new extent (E5) for this undo segment. The transactions continue writing to E5.</p></blockquote>
<p>The above quote from the documentation seems to describe a different sequence of events than what appears in the book.</p>
<p>Any other comments?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
