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

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

164

积分

0

好友

16

主题
1#
发表于 2011-12-28 13:36:02 | 查看: 14711| 回复: 7
s10u10下的11.2.0.2 rac为什么归档日志没到redo大小就马上切换,如单机设置50M则差不多平均在45M左右就会切换生成一个,而
rac中如果设置成50M则平均3M左右会切换一个,将原来50M全部删除,重新成200Mredo log,再增加一组200M,这样也会变成平均
12M左右切换一个,难道这是正常的?同样在pc服务器上安装的11.2.0.2 rac,重做日志用默认50M一个,也差不多平均20-40M左右
才会切换一个,同样采用asm来管理。这是什么原因?有没哪些大侠有遇到类似情况?怎么处理?
2#
发表于 2011-12-28 18:35:39
1.

“如单机设置50M则差不多平均在45M左右就会切换生成一个”

Why?

redo wastage  http://www.oracledatabase12g.com ... B9redo-wastage.html


2.

"rac中如果设置成50M则平均3M左右会切换一个,将原来50M全部删除,重新成200Mredo log,再增加一组200M,这样也会变成平均
12M左右切换一个,难道这是正常的?"

why?

force archive SCN

"Log switches may also be forced automatically in relatively idle threads of an Oracle parallel server database, to secure recoverability. Whenever a log file is reused in any thread, the force SCN recorded in the database entry of the controlfile is advanced to 1 beyond the high SCN of the reused log file (unless the force SCN was already higher). If the low SCN for the current log file in any enabled thread thereby falls behind the force SCN, a log switch is forced in that thread. This allows that log file to be archived. Until that log file is archived, newer redo in the archived copy of the recently reused log file might not be able to be applied in some recovery scenarios, or to a standby database.

If a thread requiring a forced log switch is not open, the instance that raised the force SCN will perform the log switch on behalf of the closed thread, and the first available ARCn process in any instance will archive the log file. However, if the thread is open, its instance is prompted to perform these actions itself. This is done by taking a KK instance lock. The LGWR process in each instance holds the KK instance lock on its own thread. The id2 field identifies the thread number. When this lock is taken by another instance, LGWR recognizes that a forced log switch is required. "

reference http://www.ixora.com.au/notes/log_switch_triggers.htm

回复 只看该作者 道具 举报

3#
发表于 2012-1-1 00:43:03
理解有困难,关于2
换言之是否意味着,如果某个节点产生redo显著慢于其它节点,必将经常遭遇force archive?

回复 只看该作者 道具 举报

4#
发表于 2012-1-24 22:23:51
Archive logs can be different than the online log size. It is perfectly normal behaviour and nothing to be concerned of. Below note discuss the reason in details( no blank padding and log switch ):

Note 388627.1 : Archive logs are created with smaller, uneven size than the original redo logs. Why?

回复 只看该作者 道具 举报

5#
发表于 2012-1-24 22:35:12
Archive Logs Are Created With Smaller, Uneven Size Than The Original Redo Logs. Why? [ID 388627.1]
  1. Applies to:
  2. Oracle Server - Enterprise Edition - Version: 8.1.7.4 to 11.1.0.6 - Release: 8.1.7 to 11.1
  3. Information in this document applies to any platform.
  4. Goal
  5. Archive logs are created with smaller, uneven size than the original redo logs.
  6. Commands like:
  7. ALTER SYSTEM SWITCH LOGFILE
  8. or
  9. ALTER SYSTEM ARCHIVE LOG ...
  10. are not used to generate archive or switch the logfile. As well, there is no ARCHIVE_LAG_TARGET parameter set.
  11. What else could cause such behaviour?

  12. Solution
  13. According to:
  14. Bug: 5450861 : ARCHIVE LOGS ARE GENERATED WITH A SMALLER SIZE THAN THE REDO LOG FILES
  15. the explanation for this situation has 2 main reasons:

  16. 1. The archive logs do not have to be even in size. This was decided a very long time ago, when blank padding the archive logs was stopped, for a very good reason - in order to save disk space.

  17. 2. The log switch does not occur when a redo log file is 100% full. There is an internal algorithm that determines the log switch moment. This also has a very good reason - doing the log switch at the last moment could incur performance problems (for various reasons, out of the scope of this note).
  18. As a result, after the log switch occurs, the archivers are copying only the actual information from the redo log files. Since the redo logs are not 100% full after the log switch and the archive logs are not blank padded after the copy operation has finished, this results in uneven, smaller files than the original redo log files.
  19. This is very conspicuous for very small redo log files (e.g. smaller than 10 MB), i.e. 2.5 MB archive logs generated from 5 MB redo logs are very visible.
  20. Just note that at this moment, the default redo log files are 100 MB in size. If the resulting archive log files would be between 98 and 100 MB nobody would notice.
  21. The main concern that one should have for the archive log files is an eventual corruption. This can be very easily checked by trying a test recovery. When this is ok, the uneven archive log size should be of no concern, as it's expected.


  22. Please note that Bug: 5450861 has been closed as 'Not a Bug', just like related Bug reports Bug 9272059  and Bug 12317474.
  23. In fact Bug 12317474 discusses an additional situation that could cause the same issue.

  24. 3. With a high CPU_COUNT, a low load and a redo log file size smaller than the redolog buffer, you may small archived log files because of log switches at about 1/8 of the size of the define log file size.
  25. This is because CPU_COUNT defines the number of redo strands (ncpus/16). With a low load only a single strand may be used. With redo log file size smaller than the redolog buffer, the log file space is divided over the available strands. When for instance only a single active strand is used, a log switch can already occur when that strand is filled.

  26. References
  27. BUG:5450861 - ARCHIVE LOGS ARE GENERATED WITH A SMALLER SIZE THAN THE REDO LOG FILES
  28. BUG:9272059 - REDO LOG SWITCH AT 1/8 OF SIZE DUE TO CMT CPU'S
  29. BUG:12317474 - FREQUENT REDO LOG SWITCHES GENERATING SMALL SIZED ARCHIVELOGS
复制代码

回复 只看该作者 道具 举报

6#
发表于 2012-1-24 22:39:27
结论是 不管是 RAC或非RAC环境中  archivelog  归档日志的大小都 不是必须等于 重做日志大小的,  一般会 略微小于redo log size , 但是也不排除 远远小于的情况。

造成这种现象的几点原因:

1. 节约不必要的磁盘浪费
2.  内部算法决定了何时切换日志(非ARCHIVE_LAG_TARGET)
3.  较高的CPU_COUNT 参数,因为cpu number 决定了redo strands (ncpus/16)的个数

主要是由于oracle内部算法所决定的,  一般不会造成实例 性能或可用性问题, 唯一的困扰可能是 生成了较多的小归档日志。

回复 只看该作者 道具 举报

7#
发表于 2014-5-28 14:24:52
Maclean Liu(刘相兵 发表于 2012-1-24 22:39
结论是 不管是 RAC或非RAC环境中  archivelog  归档日志的大小都 不是必须等于 重做日志大小的,  一般会  ...

这是啊造成很多小归档.以前ORACLE 10G 和9I 激发日志发生归档 是有些条件的.

如今11G 激发日志归档 还要加内部算法

回复 只看该作者 道具 举报

8#
发表于 2014-5-28 14:30:03
ORACLE Instance posdb1 - Can not allocate log, archival required

每晚 10点 都要切换好多次

回复 只看该作者 道具 举报

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

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

GMT+8, 2024-12-23 07:04 , Processed in 0.050189 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

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