oracle 12c 新特性 Temporary UNDO

这个特性将对于临时表的UNDO信息分离出去,独立存储在临时表空间中,这就减少了对于UNDO段的使用。这个特性完全无损Oracle的事务一致性,但是却得到了空间缩减的好处。

下面用实验测试下效果:

SQL> show parameter temp_undo_enabled;
temp_undo_enabled                    boolean     FALSE
SQL> set autot traceonly statistics

SQL> create global temporary table test as select * from dba_tables where 1=0;

Table created.

SQL>  insert into test select * from dba_tables;

2108 rows created.


Statistics
----------------------------------------------------------
        782  recursive calls
        521  db block gets
      25061  consistent gets
          9  physical reads
      29384  redo size
        865  bytes sent via SQL*Net to client
        962  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
         22  sorts (memory)
          0  sorts (disk)
       2108  rows processed

SQL>  update test set table_name=lower(table_name);

2108 rows updated.


Statistics
----------------------------------------------------------
         12  recursive calls
       2742  db block gets
        355  consistent gets
          0  physical reads
     299640  redo size
        865  bytes sent via SQL*Net to client
        965  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
       2108  rows processed

SQL> conn / as sysdba
Connected.
SQL> alter session set temp_undo_enabled=true;

Session altered.

SQL> set autotrace traceonly statistics;    
SQL>  insert into test select * from dba_tables;

2108 rows created.


Statistics
----------------------------------------------------------
         25  recursive calls
        528  db block gets
      11812  consistent gets
          0  physical reads
        272  redo size
        850  bytes sent via SQL*Net to client
        962  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          2  sorts (memory)
          0  sorts (disk)
       2108  rows processed

SQL>  update test set table_name=lower(table_name);

2108 rows updated.


Statistics
----------------------------------------------------------
          0  recursive calls
        129  db block gets
         97  consistent gets
          0  physical reads
          0  redo size
        857  bytes sent via SQL*Net to client
        965  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
       2108  rows processed

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值