ITPub博客

首页 > Linux操作系统 > Linux操作系统 > log等待事件的测试

log等待事件的测试

原创 Linux操作系统 作者:lcmlsj 时间:2019-06-03 16:00:06 0 删除 编辑

事件描述:

log file parallel write
Writing redo records to the redo log files from the log buffer.

Wait Time: Time it takes for the I/Os to complete. Even though redo records are written in

parallel, the parallel write is not complete until the last I/O is on disk.

Parameter Description
files Number of files to be written
blocks Number of blocks to be written
requests Number of I/O requests


log file sequential read
Waiting for the read from this logfile to return. This is used to read redo records from the log

file.

Wait Time: Time it takes to complete the physical I/O (read)

Parameter Description
log# The relative sequence number of the logfiles within a log group (used only when dumping the

logfiles)
block# See "block#"
blocks The number of blocks to read


log file single write
Waiting for the write to this logfile to complete. This event is used while updating the header

of the logfile. It is signaled when adding a log file member and when incrementing sequence

numbers.

Wait Time: Time it takes for the physical I/O (write) to complete

Parameter Description
log# This is the number of the group/log to which the session is currently writing
block# See "block#"
blocks The number of blocks to write


log file sync
When a user session commits, the session's redo information needs to be flushed to the redo

logfile. The user session will post the LGWR to write the log buffer to the redo log file. When

the LGWR has finished writing, it will post the user session.

Wait Time: The wait time includes the writing of the log buffer and the post.

Parameter Description
buffer# The number of the physical buffer in the redo log buffer that needs to be synchronized


事件描述:

log file parallel write
Writing redo records to the redo log files from the log buffer.

Wait Time: Time it takes for the I/Os to complete. Even though redo records are written in

parallel, the parallel write is not complete until the last I/O is on disk.

Parameter Description
files Number of files to be written
blocks Number of blocks to be written
requests Number of I/O requests


log file sequential read
Waiting for the read from this logfile to return. This is used to read redo records from the log

file.

Wait Time: Time it takes to complete the physical I/O (read)

Parameter Description
log# The relative sequence number of the logfiles within a log group (used only when dumping the

logfiles)
block# See "block#"
blocks The number of blocks to read


log file single write
Waiting for the write to this logfile to complete. This event is used while updating the header

of the logfile. It is signaled when adding a log file member and when incrementing sequence

numbers.

Wait Time: Time it takes for the physical I/O (write) to complete

Parameter Description
log# This is the number of the group/log to which the session is currently writing
block# See "block#"
blocks The number of blocks to write


log file sync
When a user session commits, the session's redo information needs to be flushed to the redo

logfile. The user session will post the LGWR to write the log buffer to the redo log file. When

the LGWR has finished writing, it will post the user session.

Wait Time: The wait time includes the writing of the log buffer and the post.

Parameter Description
buffer# The number of the physical buffer in the redo log buffer that needs to be synchronized

实验测试:

SQL> select * from v$system_event
2 where EVENT like '%log file%';

EVENT TOTAL_WAITS
---------------------------------------------------------------- -----------
log file sequential read 31
log file single write 7
log file parallel write 780
log file sync 16


SQL> commit;

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> /

Commit complete.

SQL> select * from v$system_event
2 where EVENT like '%log file%';

EVENT TOTAL_WAITS
---------------------------------------------------------------- -----------
log file sequential read 31
log file single write 7
log file parallel write 939
log file sync 18
连续执行提交操作产生log file parallel write,log file sync 等待事件。这是由于log file sync 直接与

commit有关。而commit是要写日志文件,log file parallel write与写日志文件有关。


SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> select * from v$system_event
2 where EVENT like '%log file%';

EVENT TOTAL_WAITS T
---------------------------------------------------------------- ----------- -
log file sequential read 53
log file single write 15
log file parallel write 945
log file sync 18
执行alter system switch logfile操作,要更改日志文件的seq#,所以产生log file single write事件,发

现一次alter system switch logfile操作log file single write 写两个日志块,这两个块中还有什么内容,

不清楚?

alter system switch logfile还引起log file sequential read等待事件,是因为日志切换会产生归档操作,

归档时,要读log file,并更新控制文件,在其中记录有关归档的信息。

SQL> alter system archive log current;

System altered.

SQL> select * from v$system_event
2 where EVENT like '%log file%';

EVENT TOTAL_WAITS
---------------------------------------------------------------- -----------
log file sequential read 60
log file single write 17
log file parallel write 945
log file sync 18
执行alter system archive log current操作,归档当前日志,切换到下一个日志组。因此产生log file

sequential read ,log file single write等待事件。

SQL> alter system checkpoint;

System altered.
SQL> select * from v$system_event
2 where EVENT like '%log file%';

EVENT TOTAL_WAITS
---------------------------------------------------------------- -----------
log file sequential read 60
log file single write 17
log file parallel write 947
log file sync 19

执行 alter system checkpoint操作,会产生log file parallel write,log file sync 等待事件。
这是用户进程要等待lgwr写出log buffer,因此产生log file sync事件。写出log buffer,会对日志文件写操

作,产生log file parallel write事件。
当然checkpoint时,还要有与数据文件和控制文件有关的读写事件。

这是执行chekpoint时,对于三个文件读写有关的事件,执行chekpoint前后的对比。
SQL> select * from v$system_event
2 where EVENT like '%log file%'
3 or EVENT like '%control%'
4 or event like '%file%'
5 order by event;

EVENT TOTAL_WAITS
---------------------------------------------------------------- -----------
control file heartbeat 1
control file parallel write 11497
control file sequential read 15701
db file parallel write 2723
db file scattered read 256
db file sequential read 3554
db file single write 14
log file parallel write 2151
log file sequential read 67
log file single write 19
log file sync 21

EVENT TOTAL_WAITS
---------------------------------------------------------------- -----------
switch logfile command 7

12 rows selected.

SQL> alter system checkpoint;

System altered.

SQL>
SQL> select * from v$system_event
2 where EVENT like '%log file%'
3 or EVENT like '%control%'
4 or event like '%file%'
5 order by event;

EVENT TOTAL_WAITS
---------------------------------------------------------------- -----------
control file heartbeat 1
control file parallel write 11513
control file sequential read 15733
db file parallel write 2733
db file scattered read 256
db file sequential read 3554
db file single write 14
log file parallel write 2152
log file sequential read 67
log file single write 19
log file sync 21

EVENT TOTAL_WAITS
---------------------------------------------------------------- -----------
switch logfile command 7

12 rows selected.
不解的是怎么产生许多
control file sequential read等待事件?


这是对control file sequential read事件的描述:
control file sequential read
Reading from the control file. This happens in many cases. For example, while:

Making a backup of the control files

Sharing information (between instances) from the control file

Reading other blocks from the control files

Reading the header block

Wait Time: The wait time is the elapsed time of the read

Parameter Description
file# The control file from which the session is reading
block# Block number in the control file from where the session starts to read. The block size is the physical block size of the port (usually 512 bytes, some UNIX ports have 1 or 2 Kilobytes).
blocks The number of blocks that the session is trying to read

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

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2002-04-09

  • 博文量
    100
  • 访问量
    114100