Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

0

积分

1

好友

9

主题
1#
发表于 2013-4-22 13:10:32 | 查看: 3504| 回复: 4
10.2.0.4.0   单机        NOARCHIVELOG模式

一个sql 执行,产生大量的redo,是什么原因呢?

sql.jpg (62.42 KB, 下载次数: 203)

sql.jpg

你不放弃希望,希望就不会放弃你.
2#
发表于 2013-4-22 13:16:00
  1. SQL>  select '1' logType,
  2.   2             (select count(*) totaLoginNum
  3.   3                from oss.t_user_login_log t
  4.   4               where t.login_time > trunc(SYSDATE, 'dd') - 1
  5.   5                 and t.log_type = 1) totalUserNum,
  6.   6             sysdate - 1,
  7.   7             '1' statType
  8.   8        from dual;

  9. 已用时间:  00: 00: 07.63

  10. 执行计划
  11. ----------------------------------------------------------
  12. Plan hash value: 1824551839

  13. ----------------------------------------------------------------------------------------------------
  14. | Id  | Operation                    | Name                         | Rows  | Bytes | Cost (%CPU)| Time     |
  15. ----------------------------------------------------------------------------------------------------
  16. |   0 | SELECT STATEMENT             |                              |     1 |       |     2   (0)| 00:00:01 |
  17. |   1 |  SORT AGGREGATE              |                              |     1 |    11 |            |          |
  18. |*  2 |   TABLE ACCESS BY INDEX ROWID| T_USER_LOGIN_LOG             |     1 |    11 |     5   (0)| 00:00:01 |
  19. |*  3 |    INDEX RANGE SCAN          | T_USER_LOG_IINDEX_LOGIN_TIME |    10 |       |     3   (0)| 00:00:01 |
  20. |   4 |  FAST DUAL                   |                              |     1 |       |     2   (0)| 00:00:01 |
  21. ----------------------------------------------------------------------------------------------------

  22. Predicate Information (identified by operation id):
  23. ---------------------------------------------------

  24.    2 - filter("T"."LOG_TYPE"=1)
  25.    3 - access("T"."LOGIN_TIME">TRUNC(SYSDATE@!,'fmdd')-1)


  26. 统计信息
  27. ----------------------------------------------------------
  28.         177  recursive calls
  29.           0  db block gets
  30.      183826  consistent gets
  31.        4526  physical reads
  32.        7344  redo size
  33.         514  bytes sent via SQL*Net to client
  34.         350  bytes received via SQL*Net from client
  35.           2  SQL*Net roundtrips to/from client
  36.           5  sorts (memory)
  37.           0  sorts (disk)
  38.           1  rows processed
复制代码
截图好像不清晰,还是copy出来 贴上来.

回复 只看该作者 道具 举报

3#
发表于 2013-4-22 14:48:22
每次都有redo产生吗? 这个应该和延迟块清理有关。

回复 只看该作者 道具 举报

4#
发表于 2013-4-22 17:39:18
Thomas Kyte《Expert one-on-one Oracle》
Block Cleanout
If you recall earlier, Chapter 3 on Locking and Concurrency, when we talked about datalocks and how they were managed, I described how they are actually attributes of the data,stored on the block header. A side effect of this is that the next time that block is accessed,we may have to ʹclean it outʹ, in other words, remove the transaction information. Thisaction generates redo and causes the block to become ʹdirtyʹ if it wasnʹt already. What thismeans is that a simple SELECT may generate redo, and may cause lots of blocks to bewritten to disk with the next checkpoint.
请参考:http://www.itpub.net/thread-1300346-1-1.html

回复 只看该作者 道具 举报

5#
发表于 2013-4-22 18:29:09
select  产生redo很正常

详见 delay block cleanout

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-6-1 18:39 , Processed in 0.053726 second(s), 23 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569