常见事件

1.log buffer space

The log buffer space Oracle metric indicates that the process is waiting for space to become available in the log buffer (Space becomes available only after LGWR has written the current contents of the log buffer to disk.) This typically happens when applications generate redo faster than LGWR can write it to disk.

Log Buffer Space

Log Buffer Space wait event occurs when server processes write data into the log buffer faster than the LGWR process can write it out. The LGWR process begins writing entries to the online redo log file if any of the following conditions are true:

  • The log buffer reaches the _log_io_size threshold. By default, this parameter is set to one third of the log buffer size.
  • A server process performing a COMMIT o ROLLBACK posts to the LGWR process.
  • The DBWR process posts to the LGWR process before it begins writing.

As the LGWR process writes entries to disk, user processes can reuse the space in the log buffer for new entries. If the Log Buffer is too small, user processes wait for “Log Buffer Space” until the LGWR flushes the redo information in memory to disk.

Sizing the Redo Log Buffer:

The size of the Redo Log Buffer is controlled by the initialization parameter, LOG_BUFFER, which is expressed in bytes. Oracle’s default setting for LOG_BUFFER is the maximum of 512k (.5m) or (128k * # of CPUs). Most of the time, the default setting is appropriate.

If your applications insert, update or delete large amounts of data within the database, and user processes experience many “log buffer space” waits, you may want to consider increasing the LOG_BUFFER parameter. However, careful analysis should be performed when changing this parameter. A LOG_BUFFER sized too large will cause the “_log_io_size” threshold also to be large. This may cause the LGWR process to write more data less often, causing yet another log-related wait event, “log file sync”.

For example, a LOG_BUFFER size of 10m will result in a _log_io_size threshold of over 3m. Therefore, the LGWR process will not begin writing until the 3m threshold is met, a checkpoint happens, or a commit or rollback is issued. If a commit or rollback is issued, the LGWR may take longer to write all the data from the buffer (up to last commit mark), especially if it hasn’t yet reached the larger 3m threshold. The larger write at commit time, will result in individual processes waiting on the “log file sync” event. The “log file sync” wait event occurs when processes commit or rollback, then wait for the information to be flushed from the log buffer (memory) to the online redo log file (disk).

When changing the LOG_BUFFER parameter, the optimal size should reduce the number of log-related wait events, not increase them.

Other Tuning Considerations:

When sizing the LOG_BUFFER produces no additional benefit, you may want to look at other tuning opportunities to reduce the “log buffer space” wait event.

Poor I/O Performance:

The “log buffer space” wait event could be an indication of slow disks and/or slow log file switches. Investigate moving the log files to faster disks such as file system direct I/O or raw devices. Also, look at improving the checkpointing or archiving process for better overall throughput.

Application Design:

If your application performs many commits or has heavy logging activity, try reducing the activity by using the NOLOGGING option where appropriate. Also, look for poor application behavior, such as, fetching and updating all columns in a table when only a few columns need changed.

Materialized Views:

When using materialized views, verify that appropriate methods of refresh have been chosen. If possible, perform. fast refreshes instead of complete refreshes. If using 10g and performing complete refreshes, review the setting of the ATOMIC_REFRESH parameter on the refresh statement. In 10g, the default changed to DELETE FROM the materialized view (causing redo creation) instead of using the TRUNCATE command (a nologging operation). For further details on this setting, see Metalink Note 306502.1.

Conclusion

When processes wait on the "log buffer space” event, the log buffer is filling up faster than what the LGWR process can write to disk. If this wait event is frequent, throughput is reduced for the entire database. To address this problem, look at increasing the LOG_BUFFER to an optimal size.

Other tuning alternatives are:

  • Put log files on faster disks.
  • Look at tuning checkpoint or archive processes (log files switches).
  • Review application design, use NOLOGGING operations where appropriate, and avoid changing more data than required.
  • Finally, check refresh methods when using Materialized Views to reduce logging activity.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7928987/viewspace-353129/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7928987/viewspace-353129/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值