Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1168396
  • 博文数量: 178
  • 博客积分: 2776
  • 博客等级: 少校
  • 技术积分: 2809
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-22 15:36
文章分类

全部博文(178)

文章存档

2014年(3)

2013年(66)

2012年(109)

分类: Oracle

2013-02-05 11:14:32

By writing cold, dirty buffers to disk, DBWn improves the performance of finding free buffers while keeping recently used buffers resident in memory. For example, blocks that are part of frequently accessed small tables or indexes are kept in the cache so that they do not need to be read in again from disk. The LRU algorithm keeps more frequently accessed blocks in the buffer cache so that when a buffer is written to disk, it is unlikely to contain data that will be useful soon.

写冷,脏块缓存到硬盘,当保存最近使用的缓存在内存中是为了让dbwn提高找到空闲的性能。比如,频繁的访问一个小表和索引放在缓存中,是为了他们不需要再次的从硬盘中读取数量。在高速缓存中用最近最少使用算法保存着频繁访问的块,为了当一个缓存被写到硬盘,不太可能和数据可能被很快就使用。

The initialization parameter DB_WRITER_PROCESSES specifies the number of DBWn processes. The maximum number of DBWn processes is 20. If it is not specified by the user during startup, Oracle determines how to set DB_WRITER_PROCESSES based on the number of CPUs and processor groups.

db_writer_processes初始化参数指定dbwn进程的数量。dbwn进程的数量最多是20。如果在运行期间用户没有指定,oracle会以cpu的数量和进程组来确定db_writer_processes的数量。

The DBWn process writes dirty buffers to disk under the following conditions:

dbwn进程写脏数据到硬盘在下面的几种情况:


When a server process cannot find a clean reusable buffer after scanning a threshold number of buffers, it signals DBWn to write. DBWn writes dirty buffers to disk asynchronously while performing other processing.



当在扫描缓存的数量之后服务进程不能找到一个干净的可复用的缓存,它就标志着dbwn要写。在其它进程在执行dbwn异步的写脏数据到缓存中,


DBWn periodically writes buffers to advance the checkpoint, which is the position in the redo thread (log) from which instance recovery begins. This log position is determined by the oldest dirty buffer in the buffer cache.


dbwn定期的写缓存数据,为了使检查点向前。在高速缓存中重做位置是由最后脏缓存决定的。



LGWR
LGWR(日志写入程序)进程负责把联机重做日志缓冲区的内容写入联机重做日志文件。

触发LGWR的条件:

A commit record when a user process commits a transaction

当用户进程提交一个事务Redo log buffers

Every three seconds超过三分钟

When the redo log buffer is one-third full

当重写缓存达到三分之一时.

When a DBWn process writes modified buffers to disk, if necessary

当dbwn进程写脏缓存到硬盘.

The log writer process (LGWR) is responsible for redo log buffer management-writing the redo log buffer to a redo log file on disk. LGWR writes all redo entries that have been copied into the buffer since the last time it wrote.

LGWR对重做日志缓存负责-------写重做日志缓存到重做日志文件中.LGWR写所有的重做记录,是为了在最后把缓存里的东西复制出来.

The redo log buffer is a circular buffer. When LGWR writes redo entries from the redo log buffer to a redo log file, server processes can then copy new entries over the entries in the redo log buffer that have been written to disk. LGWR normally writes fast enough to ensure that space is always available in the buffer for new entries, even when access to the redo log is heavy.

重做日志缓存区是一循环的缓存区.当LGWR把重做记录从重做日志缓存区写到重做日志文件中.在重做日志缓存服务进程能把新的记录复制到这个记录上,旧的记录被写到硬盘上.

LGWR一般都快速的写以确保在缓存中对于新存的记录能有空闲的空间可以使用,即使当redo log很忙.Oracle培训



阅读(1232) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~