临时表真的不生成redo日志吗?

澄清大家一个常见的错误:临时表是否产生redo
临时表本身的操作并不产生redo,但是在临时表中处理数据时,是要产生undo的,而undo是要产生redo的,但相比较普通表要少很多。
[oracle@mydb02 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Nov 7 14:21:52 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
startup
Connected to an idle instance.
SQL> ORACLE instance started.
Total System Global Area  818401280 bytes
Fixed Size                  2257680 bytes
Variable Size             532679920 bytes
Database Buffers          281018368 bytes
Redo Buffers                2445312 bytes
Database mounted.
Database opened.
SQL> create table t1(id number) tablespace users;
Table created.
SQL> set pagesize 1200
SQL> set linesize 1200
SQL> set autotrace trace stat 
SQL> insert into t1 select obj# from obj$;
87046 rows created.
Statistics
----------------------------------------------------------
         99  recursive calls
       2247  db block gets
       1431  consistent gets
        193  physical reads
    1398988  redo size
        838  bytes sent via SQL*Net to client
        788  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          8  sorts (memory)
          0  sorts (disk)
      87046  rows processed
SQL> create global temporary table t2 (id number) ;
Table created.
SQL> insert into t2 select obj# from obj$;
87047 rows created.
Statistics
----------------------------------------------------------
          4  recursive calls
       1010  db block gets
        385  consistent gets
          0  physical reads
     241176  redo size
        838  bytes sent via SQL*Net to client
        788  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
      87047  rows processed
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值