log file parallel write&&log buffer space

This wait event is used when waiting for the writes of redo records to the redo log files
to complete. The waits occur in log writer (LGWR) as part of normal activity of copying
records from the redo log buffer to the current online log


这个等待事件是用于等待完成redo records 写入log files,这个事件发生在LGWR 将records从redo log buffer 写入到current online log.


注:由于LGWR不象DBWR那样能够有多个,所以尽可能将REDO放在IO快的磁盘结构上,不要放在象RAID5这样的磁盘上。



log buffer space:

等待log buffer空间,由于会话写入log buffer快于LGWR写出的速度。



log file parallel write: 它有三个参数,第一个参数表示将要写的文件个数,第二个参数表示要写入的block个数,第三个参数表示I/O请求的个数。
测试:


SQL> select * from v$mystat where rownum<2;

       SID STATISTIC#	   VALUE
---------- ---------- ----------
      1632	    0	       1

SQL> truncate table test10;

Table truncated.

SQL> begin
for i in 1 .. 1000
loop
insert into test10 select * from dba_objects;
commit;
end loop;
end;  2    3    4    5    6    7  
  8  /


SQL> select sid, event, p1, p2, p3
  from v$session_wait
 where event not like '%message%'
   and sid = 1651  2    3    4  ;


       SID EVENT								    P1	       P2	  P3
---------- ---------------------------------------------------------------- ---------- ---------- ----------
      1651 log file parallel write						     1	     3414	   3


       SID EVENT								    P1	       P2	  P3
---------- ---------------------------------------------------------------- ---------- ---------- ----------
      1632 log buffer space							     0		0	   0

SQL> /

       SID EVENT								    P1	       P2	  P3
---------- ---------------------------------------------------------------- ---------- ---------- ----------
      1632 log file switch completion						     0		0	   0

SQL> /

       SID EVENT								    P1	       P2	  P3
---------- ---------------------------------------------------------------- ---------- ---------- ----------
      1632 log buffer space							     0		0	   0

1632 为用户会话进程:
log buffer space 是用户commit触发的


SQL> select  sid,program from v$session where sid=1651 ;

       SID PROGRAM
---------- ------------------------------------------------
      1651 oracle@jhoa (LGWR)


log buffer space 是用户进程commit触发的

log file parallel write 是lgwr进程引起的

原文地址:https://www.cnblogs.com/hzcya1995/p/13352035.html