ORACLE log_buffer


log_buffer 日志缓冲区是日志信息在内存中临时存放的区域,这些内存块都是循环使用的,当缓冲区内容写入redo文件后,内存被重新利用。

LogBuffer写入Redo Log的条件:
1).用户提交commit
2).有1/3重做日志缓冲区未被写入磁盘(可以通过修改_LOG_IO_SIZE参数来控制 )
3).有大于1M的重做日志缓冲区未被写入磁盘
4).每隔3 秒钟
5). DBWR 需要写入的数据的SCN大于LGWR记录的SCN,DBWR 触发LGWR写入。

在不同的版本中,Oracle对log_buffer描述也不同。

LOG_BUFFER (11.2)

默认值:5 MB 到 32 MB, 取决于SGA大小, CPU数量,以及系统是 32-bit 还是 64-bit
单位:Integer
是否立即生效:否
修改范围: 2 MB

官方介绍:

LOG_BUFFER specifies the amount of memory (in bytes) that Oracle uses when buffering redo entries to a redo log file. Redo log entries contain a record of the changes that have been made to the database block buffers. The LGWR process writes redo log entries from the log buffer to a redo log file.

LOG_BUFFER在Oracle中负责记录redo信息。Redo记录了数据块的改变信息。LGWR进程负责将log buffer中的内容写入redo日志。

The log buffer size depends on the number of redo strands in the system. One redo strand is allocated for every 16 CPUs and has a default size of 2 MB. Oracle allocates a minimum of 2 redo strands per instance. When the log buffer size is not specified, any remaining memory in the redo granules is given to the log buffer.

LOG_BUFFER的大小取决于redo日志组的数量。一般16个CPU分配一个redo日志组,默认log_buffer 为2MB。Oracle要求一个实例最少2个redo日志组。如果log buffer没有指定大小,内存中仍然会为其分配空间。

LOG_BUFFER (12.2)

默认值:2 MB 到 32 MB, 取决于SGA大小, CPU数量
单位: Big integer
是否立即生效:否
修改范围: 2 MB

官方介绍:(与11g描述基本相同)

Redo log entries contain a record of the changes that have been made to the database block buffers. The LGWR process writes redo log entries from the log buffer to a redo log file.

The log buffer size depends on the number of redo strands in the system. One redo strand is allocated for every 16 CPUs and has a default size of 2 MB. Oracle allocates a minimum of 2 redo strands per instance. When the log buffer size is not specified, any remaining memory in the redo granules is given to the log buffer.

LOG_BUFFER (10.2)

默认值:大于 (512 KB 或 128 KB) * cpu数量
单位: Integer
是否立即生效:否
修改范围: 取决于操作系统

官方介绍:(与11g描述基本相同)

LOG_BUFFER specifies the amount of memory (in bytes) that Oracle uses when buffering redo entries to a redo log file. Redo log entries contain a record of the changes that have been made to the database block buffers. The LGWR process writes redo log entries from the log buffer to a redo log file.

In general, larger values for LOG_BUFFER reduce redo log file I/O, particularly if transactions are long or numerous. In a busy system, a value 65536 or higher is reasonable.

LOG_BUFFER可以降低redo日志的I/O,尤其是在有大量事务或长事务的情况下,某些情况下,大于65536大小的log buffer也是允许的。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DBA大董

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值