<?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: Transactions 2</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Sat, 18 May 2013 11:04:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Houri</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53658</link>
		<dc:creator><![CDATA[Houri]]></dc:creator>
		<pubDate>Wed, 20 Feb 2013 08:27:54 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53658</guid>
		<description><![CDATA[Jonathan,
 I have tried what you’ve suggested me to do and here are the results:
The model is :
[sourcecode language=&quot;sql&quot;]
drop table t_target purge;
drop table err$_t_target purge;
drop table t_source;

create table t_target
as 
   select 
    level  n1
  ,trunc(dbms_random.value(1,250)) n2
  ,date&#039;2012-06-07&#039; + mod((level-1)*5,10)   start_date   
	 ,rpad(&#039;xx&#039;,10) padding
   from dual
  connect
    by level &lt;= 1000;	 

alter table t_target add constraint t_g_pk primary key(n1);
alter table t_target modify start_date not null;
create index t_g_ind1 on t_target(n2);
exec dbms_errlog.create_error_log(&#039;t_target&#039;);

create table t_source as
    select 
     case rownum 
        when 1 then 1 
        when 10 then 10
      else rownum + 1000 end id1
    , mod(rownum-1, 10) id2
    ,case mod(rownum,3)
        when 0 then null
    else sysdate + rownum end date1
from dual
  connect by level &lt;= 10;
[/sourcecode]
Run without DML error logging
[sourcecode language=&quot;sql&quot;]
/* 
1. insert id 1 --&gt; duplicate record rejected
2. insert several successful rows
3. insert 3 rejected rows dues to null start_date
4. insert several successful rows
5. insert id = 10 --&gt; duplicate record rejected
*/
@@c:\stats#
begin
  for x in (select   
        id1
       ,id2
       ,date1
       ,&#039;yy&#039;
  from
      t_source
) loop
begin
  insert into t_target
   (n1, n2,start_date, padding)
  values
    (x.id1, x.id2, x.date1, &#039;yy&#039;);  
  commit;
 exception
   when others then
     null;
 end;
end loop;
end;        
/
@@c:\stats#

NAME                                       VALUE
----------------------------------------- ----------
user commits                                9
user rollbacks                              0
recursive calls                             25331
rollback changes - undo records applied     0
transaction rollbacks                       0

PL/SQL procedure successfully completed.

NAME                                        VALUE
------------------------------------------- ----------
user commits                                14
user rollbacks                              0
recursive calls                             25482  151
rollback changes - undo records applied     2
transaction rollbacks                       2      2 
[/sourcecode]

Run with DML error logging
[sourcecode language=&quot;sql&quot;]
/* -------------------------------------------------
1. insert id 1 --&gt; duplicate record rejected
2. insert several successful rows
3. insert 3 rejected rows dues to null start_date
4. insert several successful rows
5. insert id = 10 --&gt; duplicate record rejected
* -------------------------------------------------- */
@@c:\stats#

begin
  for x in (select   
        id1
       ,id2
       ,date1
       ,&#039;yy&#039;
  from
      t_source
) loop
begin
  insert into t_target
   (n1, n2,start_date, padding)
  values
    (x.id1, x.id2, x.date1, &#039;yy&#039;)
  log errors into err$_t_target reject limit unlimited;
  commit;
 exception
   when others then
     null;
 end;
end loop;
end;        
/
@@c:\stats#

NAME                                        VALUE
------------------------------------------- -------
user commits                                22
user rollbacks                              0
recursive calls                             34291
rollback changes - undo records applied     2
transaction rollbacks                       2

PL/SQL procedure successfully completed.

NAME                                        VALUE
---------------------------- -------------- -----
user commits                                27
user rollbacks                              0
recursive calls                             34488  197
rollback changes - undo records applied     4
transaction rollbacks                       2      0
[/sourcecode]

When I changed a little bit my DML error logging script in order to use direct path load I got the following results:
[sourcecode language=&quot;sql&quot;]
@@c:\stats#

begin
  insert /*+ append */ into t_target
   (n1, n2,start_date, padding)
  select   
        id1
       ,id2
       ,date1
       ,&#039;yy&#039;
  from
      t_source
  log errors into err$_t_target reject limit unlimited;
  commit;
end;
/
@@c:\stats#



NAME                                         VALUE
-------------------------------------------- ----------
user commits                                 62
user rollbacks                               0
recursive calls                              99427
rollback changes - undo records applied      7
transaction rollbacks                        3

begin
*
ERROR at line 1:
ORA-00001: unique constraint (XXX.T_G_PK) violated
ORA-06512: at line 2


NAME                                         VALUE
-------------------------------------------- ----------
user commits                                 62
user rollbacks                               0
recursive calls                              99571
rollback changes - undo records applied      8
transaction rollbacks                        4   1

SQL&gt; select ORA_ERR_MESG$ from err$_t_target;

ORA_ERR_MESG$
--------------------------------------------------------------------
ORA-01400: cannot insert NULL into (&quot;XXX&quot;.&quot;T_TARGET&quot;.&quot;START_DATE&quot;)
ORA-01400: cannot insert NULL into (&quot;XXX&quot;.&quot;T_TARGET&quot;.&quot;START_DATE&quot;)
ORA-01400: cannot insert NULL into (&quot;XXX&quot;.&quot;T_TARGET&quot;.&quot;START_DATE&quot;)
[/sourcecode]

As far as the DML Error logging is able to catch the error and let the insert continue there seem to be no transaction rollbacks applied. Unless you hit a restriction of the DML error logging (as unique constraint during direct path) where transaction rollbacks statistics starts to be incremented.]]></description>
		<content:encoded><![CDATA[<p>Jonathan,<br />
 I have tried what you’ve suggested me to do and here are the results:<br />
The model is :</p>
<pre class="brush: sql; title: ; notranslate">
drop table t_target purge;
drop table err$_t_target purge;
drop table t_source;

create table t_target
as 
   select 
    level  n1
  ,trunc(dbms_random.value(1,250)) n2
  ,date'2012-06-07' + mod((level-1)*5,10)   start_date   
	 ,rpad('xx',10) padding
   from dual
  connect
    by level &lt;= 1000;	 

alter table t_target add constraint t_g_pk primary key(n1);
alter table t_target modify start_date not null;
create index t_g_ind1 on t_target(n2);
exec dbms_errlog.create_error_log('t_target');

create table t_source as
    select 
     case rownum 
        when 1 then 1 
        when 10 then 10
      else rownum + 1000 end id1
    , mod(rownum-1, 10) id2
    ,case mod(rownum,3)
        when 0 then null
    else sysdate + rownum end date1
from dual
  connect by level &lt;= 10;
</pre>
<p>Run without DML error logging</p>
<pre class="brush: sql; title: ; notranslate">
/* 
1. insert id 1 --&gt; duplicate record rejected
2. insert several successful rows
3. insert 3 rejected rows dues to null start_date
4. insert several successful rows
5. insert id = 10 --&gt; duplicate record rejected
*/
@@c:\stats#
begin
  for x in (select   
        id1
       ,id2
       ,date1
       ,'yy'
  from
      t_source
) loop
begin
  insert into t_target
   (n1, n2,start_date, padding)
  values
    (x.id1, x.id2, x.date1, 'yy');  
  commit;
 exception
   when others then
     null;
 end;
end loop;
end;        
/
@@c:\stats#

NAME                                       VALUE
----------------------------------------- ----------
user commits                                9
user rollbacks                              0
recursive calls                             25331
rollback changes - undo records applied     0
transaction rollbacks                       0

PL/SQL procedure successfully completed.

NAME                                        VALUE
------------------------------------------- ----------
user commits                                14
user rollbacks                              0
recursive calls                             25482  151
rollback changes - undo records applied     2
transaction rollbacks                       2      2 
</pre>
<p>Run with DML error logging</p>
<pre class="brush: sql; title: ; notranslate">
/* -------------------------------------------------
1. insert id 1 --&gt; duplicate record rejected
2. insert several successful rows
3. insert 3 rejected rows dues to null start_date
4. insert several successful rows
5. insert id = 10 --&gt; duplicate record rejected
* -------------------------------------------------- */
@@c:\stats#

begin
  for x in (select   
        id1
       ,id2
       ,date1
       ,'yy'
  from
      t_source
) loop
begin
  insert into t_target
   (n1, n2,start_date, padding)
  values
    (x.id1, x.id2, x.date1, 'yy')
  log errors into err$_t_target reject limit unlimited;
  commit;
 exception
   when others then
     null;
 end;
end loop;
end;        
/
@@c:\stats#

NAME                                        VALUE
------------------------------------------- -------
user commits                                22
user rollbacks                              0
recursive calls                             34291
rollback changes - undo records applied     2
transaction rollbacks                       2

PL/SQL procedure successfully completed.

NAME                                        VALUE
---------------------------- -------------- -----
user commits                                27
user rollbacks                              0
recursive calls                             34488  197
rollback changes - undo records applied     4
transaction rollbacks                       2      0
</pre>
<p>When I changed a little bit my DML error logging script in order to use direct path load I got the following results:</p>
<pre class="brush: sql; title: ; notranslate">
@@c:\stats#

begin
  insert /*+ append */ into t_target
   (n1, n2,start_date, padding)
  select   
        id1
       ,id2
       ,date1
       ,'yy'
  from
      t_source
  log errors into err$_t_target reject limit unlimited;
  commit;
end;
/
@@c:\stats#



NAME                                         VALUE
-------------------------------------------- ----------
user commits                                 62
user rollbacks                               0
recursive calls                              99427
rollback changes - undo records applied      7
transaction rollbacks                        3

begin
*
ERROR at line 1:
ORA-00001: unique constraint (XXX.T_G_PK) violated
ORA-06512: at line 2


NAME                                         VALUE
-------------------------------------------- ----------
user commits                                 62
user rollbacks                               0
recursive calls                              99571
rollback changes - undo records applied      8
transaction rollbacks                        4   1

SQL&gt; select ORA_ERR_MESG$ from err$_t_target;

ORA_ERR_MESG$
--------------------------------------------------------------------
ORA-01400: cannot insert NULL into (&quot;XXX&quot;.&quot;T_TARGET&quot;.&quot;START_DATE&quot;)
ORA-01400: cannot insert NULL into (&quot;XXX&quot;.&quot;T_TARGET&quot;.&quot;START_DATE&quot;)
ORA-01400: cannot insert NULL into (&quot;XXX&quot;.&quot;T_TARGET&quot;.&quot;START_DATE&quot;)
</pre>
<p>As far as the DML Error logging is able to catch the error and let the insert continue there seem to be no transaction rollbacks applied. Unless you hit a restriction of the DML error logging (as unique constraint during direct path) where transaction rollbacks statistics starts to be incremented.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53639</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 19 Feb 2013 10:59:19 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53639</guid>
		<description><![CDATA[Valentin,

Thanks for the demo; if you hadn&#039;t come up with this example, I would have suggested it as another area for Mohamed to look at.

One of the big problems I find with Oracle - as soon as I start looking at something a little bit too closely I keep finding more and more cases that ought to be examined at the same time. Are there any differences regarding recursive call counts between the bulk exceptions strategy and the error logging strategy, for example ?  And does this change with version ?

I thought I had a blog with some quick demos of the interesting side effects and costs of error logging - but it turns out that the thing I had in mind was an article that Mark Rittman wrote about it nearly &lt;strong&gt;&lt;a href=&quot;http://www.rittmanmead.com/2005/12/performance-issues-with-dml-error-logging-and-conventional-path-inserts/&quot; rel=&quot;nofollow&quot;&gt;8 years ago&lt;/a&gt;&lt;/strong&gt;, with a little 11g follow-up reference &lt;a href=&quot;http://www.rittmanmead.com/2008/01/owb11g-dml-error-logging-and-data-rules/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;a couple of years later&lt;/strong&gt;&lt;/a&gt;.

]]></description>
		<content:encoded><![CDATA[<p>Valentin,</p>
<p>Thanks for the demo; if you hadn&#8217;t come up with this example, I would have suggested it as another area for Mohamed to look at.</p>
<p>One of the big problems I find with Oracle &#8211; as soon as I start looking at something a little bit too closely I keep finding more and more cases that ought to be examined at the same time. Are there any differences regarding recursive call counts between the bulk exceptions strategy and the error logging strategy, for example ?  And does this change with version ?</p>
<p>I thought I had a blog with some quick demos of the interesting side effects and costs of error logging &#8211; but it turns out that the thing I had in mind was an article that Mark Rittman wrote about it nearly <strong><a href="http://www.rittmanmead.com/2005/12/performance-issues-with-dml-error-logging-and-conventional-path-inserts/" rel="nofollow">8 years ago</a></strong>, with a little 11g follow-up reference <a href="http://www.rittmanmead.com/2008/01/owb11g-dml-error-logging-and-data-rules/" rel="nofollow"><strong>a couple of years later</strong></a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53638</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 19 Feb 2013 10:51:29 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53638</guid>
		<description><![CDATA[Mohamed,

Thanks for the example. I think the results are as I would have guessed. Having covered this case, it would be interesting to extend the checks to get to (a) multiple indexes, not all unique, (b) multiple rows rejected, including first, middle, and last rows of insert as select. It would also be interesting to take a note of how the logging action affected the number of recursive calls.]]></description>
		<content:encoded><![CDATA[<p>Mohamed,</p>
<p>Thanks for the example. I think the results are as I would have guessed. Having covered this case, it would be interesting to extend the checks to get to (a) multiple indexes, not all unique, (b) multiple rows rejected, including first, middle, and last rows of insert as select. It would also be interesting to take a note of how the logging action affected the number of recursive calls.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valentin Nikotin</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53637</link>
		<dc:creator><![CDATA[Valentin Nikotin]]></dc:creator>
		<pubDate>Tue, 19 Feb 2013 09:18:54 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53637</guid>
		<description><![CDATA[The same for forall save exceptions:
[sourcecode language=&quot;SQL&quot; collapse=&quot;true&quot;]
[oracle@DB1 ~]$ cat test.sql
drop table u.t1 purge;

create table u.t1(id number(6,0) primary key, n1 number, v1 varchar2(10), padding varchar2(100));
insert into u.t1 select level, 1, &#039;x&#039;, &#039;x&#039; from dual connect by level &lt;= 3000;

exec dbms_workload_repository.create_snapshot;

declare
    a1 dbms_sql.number_table;
begin
    for i in 1 .. &amp;1 loop
      a1(i) := i;
    end loop;
    
    begin
        forall i in 1..&amp;1 save exceptions
            insert into u.t1 values(50,a1(i),&#039;x&#039;,&#039;x&#039;);
    exception
        when others then null;
    end;

    for i in 1..&amp;2 loop
        begin
            insert into u.t1 values(50,i,&#039;x&#039;,&#039;x&#039;);
            commit;
        exception
            when others then null;
        end;
    end loop;

end;
/

exec dbms_workload_repository.create_snapshot;

define num_days = 1;

column inst_num   new_value inst_num  format 99999;
column inst_name  new_value inst_name format a12;
column db_name    new_value db_name   format a12;
column dbid       new_value dbid      format 9999999999;

select d.dbid            dbid
     , d.name            db_name
     , i.instance_number inst_num
     , i.instance_name   inst_name
  from v$database d,
       v$instance i;

column begin_snap new_value begin_snap  format 99999;
column end_snap   new_value end_snap    format 99999;

select max(snap_id) end_snap, max(snap_id)-1 begin_snap from dba_hist_snapshot;

define  report_type  = &#039;text&#039;;
define  report_name  = &#039;&#039;;

@@?/rdbms/admin/awrrpti

exit

[oracle@DB1 ~]$ sqlplus / as sysdba @test 200 0 &#124; egrep &quot;user commits&#124;user rollbacks&#124;transaction rollbacks&#124;rollback changes&quot;
rollback changes - undo records                 201          348.4          18.3
transaction rollbacks                             0            0.0           0.0
user commits                                     11           19.1           1.0
user rollbacks                                    0            0.0           0.0
[oracle@DB1 ~]$ sqlplus / as sysdba @test 0 200 &#124; egrep &quot;user commits&#124;user rollbacks&#124;transaction rollbacks&#124;rollback changes&quot;
rollback changes - undo records                 200          338.4          18.2
transaction rollbacks                           200          338.4          18.2
user commits                                     11           18.6           1.0
user rollbacks                                    0            0.0           0.0
[oracle@DB1 ~]$ 
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>The same for forall save exceptions:</p>
<pre class="brush: sql; collapse: true; light: false; title: ; toolbar: true; notranslate">
[oracle@DB1 ~]$ cat test.sql
drop table u.t1 purge;

create table u.t1(id number(6,0) primary key, n1 number, v1 varchar2(10), padding varchar2(100));
insert into u.t1 select level, 1, 'x', 'x' from dual connect by level &lt;= 3000;

exec dbms_workload_repository.create_snapshot;

declare
    a1 dbms_sql.number_table;
begin
    for i in 1 .. &amp;1 loop
      a1(i) := i;
    end loop;
    
    begin
        forall i in 1..&amp;1 save exceptions
            insert into u.t1 values(50,a1(i),'x','x');
    exception
        when others then null;
    end;

    for i in 1..&amp;2 loop
        begin
            insert into u.t1 values(50,i,'x','x');
            commit;
        exception
            when others then null;
        end;
    end loop;

end;
/

exec dbms_workload_repository.create_snapshot;

define num_days = 1;

column inst_num   new_value inst_num  format 99999;
column inst_name  new_value inst_name format a12;
column db_name    new_value db_name   format a12;
column dbid       new_value dbid      format 9999999999;

select d.dbid            dbid
     , d.name            db_name
     , i.instance_number inst_num
     , i.instance_name   inst_name
  from v$database d,
       v$instance i;

column begin_snap new_value begin_snap  format 99999;
column end_snap   new_value end_snap    format 99999;

select max(snap_id) end_snap, max(snap_id)-1 begin_snap from dba_hist_snapshot;

define  report_type  = 'text';
define  report_name  = '';

@@?/rdbms/admin/awrrpti

exit

[oracle@DB1 ~]$ sqlplus / as sysdba @test 200 0 | egrep &quot;user commits|user rollbacks|transaction rollbacks|rollback changes&quot;
rollback changes - undo records                 201          348.4          18.3
transaction rollbacks                             0            0.0           0.0
user commits                                     11           19.1           1.0
user rollbacks                                    0            0.0           0.0
[oracle@DB1 ~]$ sqlplus / as sysdba @test 0 200 | egrep &quot;user commits|user rollbacks|transaction rollbacks|rollback changes&quot;
rollback changes - undo records                 200          338.4          18.2
transaction rollbacks                           200          338.4          18.2
user commits                                     11           18.6           1.0
user rollbacks                                    0            0.0           0.0
[oracle@DB1 ~]$ 
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Houri</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53635</link>
		<dc:creator><![CDATA[Houri]]></dc:creator>
		<pubDate>Tue, 19 Feb 2013 08:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53635</guid>
		<description><![CDATA[Jonathan,

Unless I missed something I found a different behavior for transaction rollbacks statistic when using DML error logging. This statistic seems not be incremented in this particular case. The column id is the primary key of table t1 and id = 1 has already been inserted into t1.The test has been conducted under Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

[sourcecode language=&quot;sql&quot;]
SQL&gt; start c:\stats#

NAME                                      VALUE
---------------------------------------- -------
user commits                               1
user rollbacks                             0
rollback changes - undo records applied    0
transaction rollbacks                      0

SQL&gt; begin
  2          insert into t1(id) values(1);
  3          commit;
  4        exception
  5         when others then
  6           null;
  7        end;
  8        /

PL/SQL procedure successfully completed.

SQL&gt; start c:\stats#

NAME                                      VALUE
----------------------------------------- ------
user commits                               1
user rollbacks                             0
rollback changes - undo records applied    1
transaction rollbacks                      1

SQL&gt; select count(1) from t1;

  COUNT(1)
----------
         1

SQL&gt; select count(1) from err$_t1;

  COUNT(1)
----------
         0

SQL&gt; begin
  2          insert into t1(id) values(1)
  3          log errors into err$_t1 reject limit unlimited;
  4          commit;
  5        exception
  6         when others then
  7           null;
  8        end;
  9        /

PL/SQL procedure successfully completed.

SQL&gt; start c:\stats#

NAME                                          VALUE
--------------------------------------------- ------
user commits                                   1
user rollbacks                                 0
rollback changes - undo records applied        2
transaction rollbacks                          1

SQL&gt; select count(1) from t1;

  COUNT(1)
----------
         1

SQL&gt; select count(1) from err$_t1;

  COUNT(1)
----------
         1
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>Unless I missed something I found a different behavior for transaction rollbacks statistic when using DML error logging. This statistic seems not be incremented in this particular case. The column id is the primary key of table t1 and id = 1 has already been inserted into t1.The test has been conducted under Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; 64bi</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; start c:\stats#

NAME                                      VALUE
---------------------------------------- -------
user commits                               1
user rollbacks                             0
rollback changes - undo records applied    0
transaction rollbacks                      0

SQL&gt; begin
  2          insert into t1(id) values(1);
  3          commit;
  4        exception
  5         when others then
  6           null;
  7        end;
  8        /

PL/SQL procedure successfully completed.

SQL&gt; start c:\stats#

NAME                                      VALUE
----------------------------------------- ------
user commits                               1
user rollbacks                             0
rollback changes - undo records applied    1
transaction rollbacks                      1

SQL&gt; select count(1) from t1;

  COUNT(1)
----------
         1

SQL&gt; select count(1) from err$_t1;

  COUNT(1)
----------
         0

SQL&gt; begin
  2          insert into t1(id) values(1)
  3          log errors into err$_t1 reject limit unlimited;
  4          commit;
  5        exception
  6         when others then
  7           null;
  8        end;
  9        /

PL/SQL procedure successfully completed.

SQL&gt; start c:\stats#

NAME                                          VALUE
--------------------------------------------- ------
user commits                                   1
user rollbacks                                 0
rollback changes - undo records applied        2
transaction rollbacks                          1

SQL&gt; select count(1) from t1;

  COUNT(1)
----------
         1

SQL&gt; select count(1) from err$_t1;

  COUNT(1)
----------
         1
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53628</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 18 Feb 2013 21:52:47 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53628</guid>
		<description><![CDATA[I&#039;ve now updated the post with my results and a few comments.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve now updated the post with my results and a few comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Monti</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53619</link>
		<dc:creator><![CDATA[Andrea Monti]]></dc:creator>
		<pubDate>Mon, 18 Feb 2013 13:39:40 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53619</guid>
		<description><![CDATA[I was in a hurry and my first post was (partially) wrong. The right picture is :

The first loop will be responsible for 200 ORA-1 errors which should turn into:
 200 transaction rollbacks 
 0 user rollbacks
 200 rollback changed – undo records applied (to “repair” the ORA-1 errors on the index only: we did no change on the base table, thus we have no undo record applied on the base table)

The second loop will be responsible for 40 insert+rollback which should turn into:
 40 transaction rollbacks  
 40 user rollbacks ( since these are explicit rollbacks)
 80 rollback changed – undo records applied (40 changes on the index and 40 changes on the table)

The third loop will be responsible for 50 insert+commit which should turn into:
 0 transaction rollbacks
 50 user commits 
 0 rollback changed – undo records applied

The fourth loop will be responsible for 70 insert+rollback to savepoint which should turn into:
 0 transaction rollback (the “rollback to savepoint” does not close the transaction even if we rollback to the “starting” savepoint)
 0 user rollbacks (same as before)
 140 rollback changed – undo records applied (70 changes on the index and 70 changes on the table)

We should thus get
    420 rollback changes – undo records applied
    240 transaction rollbacks
    40 user rollbacks
    50 user commits
    (200+40+50) = 290 closed transactions from the first three loops, 
    1 open transaction from the last loop 
    (40) / (40+50) = 0.44 &quot;Rollback per transaction %&quot; since we should only account for &quot;user commits&quot; and &quot;user rollback&quot; to evaluate this metric

Next time I&#039;ll double-check my guesses. Regards, Andrea]]></description>
		<content:encoded><![CDATA[<p>I was in a hurry and my first post was (partially) wrong. The right picture is :</p>
<p>The first loop will be responsible for 200 ORA-1 errors which should turn into:<br />
 200 transaction rollbacks<br />
 0 user rollbacks<br />
 200 rollback changed – undo records applied (to “repair” the ORA-1 errors on the index only: we did no change on the base table, thus we have no undo record applied on the base table)</p>
<p>The second loop will be responsible for 40 insert+rollback which should turn into:<br />
 40 transaction rollbacks<br />
 40 user rollbacks ( since these are explicit rollbacks)<br />
 80 rollback changed – undo records applied (40 changes on the index and 40 changes on the table)</p>
<p>The third loop will be responsible for 50 insert+commit which should turn into:<br />
 0 transaction rollbacks<br />
 50 user commits<br />
 0 rollback changed – undo records applied</p>
<p>The fourth loop will be responsible for 70 insert+rollback to savepoint which should turn into:<br />
 0 transaction rollback (the “rollback to savepoint” does not close the transaction even if we rollback to the “starting” savepoint)<br />
 0 user rollbacks (same as before)<br />
 140 rollback changed – undo records applied (70 changes on the index and 70 changes on the table)</p>
<p>We should thus get<br />
    420 rollback changes – undo records applied<br />
    240 transaction rollbacks<br />
    40 user rollbacks<br />
    50 user commits<br />
    (200+40+50) = 290 closed transactions from the first three loops,<br />
    1 open transaction from the last loop<br />
    (40) / (40+50) = 0.44 &#8220;Rollback per transaction %&#8221; since we should only account for &#8220;user commits&#8221; and &#8220;user rollback&#8221; to evaluate this metric</p>
<p>Next time I&#8217;ll double-check my guesses. Regards, Andrea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valentin Nikotin</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53617</link>
		<dc:creator><![CDATA[Valentin Nikotin]]></dc:creator>
		<pubDate>Mon, 18 Feb 2013 11:41:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53617</guid>
		<description><![CDATA[How do you get &quot;240 transaction rollbacks&quot; if you post before that &quot;0 transaction rollbacks ( because the transaction does not start at all)&quot; and others give you just 40 ?]]></description>
		<content:encoded><![CDATA[<p>How do you get &#8220;240 transaction rollbacks&#8221; if you post before that &#8220;0 transaction rollbacks ( because the transaction does not start at all)&#8221; and others give you just 40 ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohamed Houri</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53614</link>
		<dc:creator><![CDATA[Mohamed Houri]]></dc:creator>
		<pubDate>Mon, 18 Feb 2013 09:54:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53614</guid>
		<description><![CDATA[a small correction for user commits
[sourcecode language=&quot;sql&quot;]
user commits                                 50  
user rollbacks                               40  
rollback changes - undo records applied      420  
transaction rollbacks                        240 
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>a small correction for user commits</p>
<pre class="brush: sql; title: ; notranslate">
user commits                                 50  
user rollbacks                               40  
rollback changes - undo records applied      420  
transaction rollbacks                        240 
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohamed Houri</title>
		<link>http://jonathanlewis.wordpress.com/2013/02/18/transactions-2/#comment-53613</link>
		<dc:creator><![CDATA[Mohamed Houri]]></dc:creator>
		<pubDate>Mon, 18 Feb 2013 09:39:20 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=10595#comment-53613</guid>
		<description><![CDATA[[sourcecode language=&quot;sql&quot;]
user commits                                                             54
user rollbacks                                                           40
rollback changes - undo records applied                 420
transaction rollbacks                                                240
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<pre class="brush: sql; title: ; notranslate">
user commits                                                             54
user rollbacks                                                           40
rollback changes - undo records applied                 420
transaction rollbacks                                                240
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
