主要有以下几个条件触发LGWR执行写操作:
1.超时(timeout)
当LGWR处于空闲状态时,它依赖于rdbms ipc message等待,处于休眠状态,直到3秒超时时间到。
如果LGWR发现有redo需要写出,那么LGWR将执行写出操作,log file parallel write等待事件将会出现。
启用10046事件,从LGWR跟踪日志中可以清楚的观察到这些事件:
WAIT #0: nam=’rdbms ipc message’ ela= 2999554 p1=300 p2=0 p3=0
WAIT #0: nam=’rdbms ipc message’ ela= 2999470 p1=300 p2=0 p3=0
WAIT #0: nam=’rdbms ipc message’ ela= 566819 p1=300 p2=0 p3=0
WAIT #0: nam=’log file parallel write’ ela= 115 p1=1 p2=2 p3=1
WAIT #0: nam=’rdbms ipc message’ ela= 45752 p1=213 p2=0 p3=0
WAIT #0: nam=’log file parallel write’ ela= 94 p1=1 p2=3 p3=1
WAIT #0: nam=’rdbms ipc message’ ela= 51762 p1=208 p2=0 p3=0
WAIT #0: nam=’log file parallel write’ ela= 91 p1=1 p2=1 p3=1
WAIT #0: nam=’rdbms ipc message’ ela= 29033 p1=200 p2=0 p3=0
WAIT #0: nam=’log file parallel write’ ela= 99 p1=1 p2=2 p3=1
WAIT #0: nam=’rdbms ipc message’ ela= 40293 p1=197 p2=0 p3=0
WAIT #0: nam=’log file parallel write’ ela= 87 p1=1 p2=1 p3=1
2.只要一个进程在log buffer中分配空间,已经使用的Log buffer的数量将被计算。如果使用的块的