消除11.2上的db file parallel read

客户在11.2.0.3环境中进行压力测试,发现出现大量的db file parallel read等待事件。
这个等待是11g以后才出现的,而在11g以前,一般这个等待事件发生在数据文件的恢复过程中。而11g新增了prefetch的特性,也可能导致这个等待事件的产生。
当运行压力测试时,后台的等待事件如下:

SQL> SELECT event, COUNT(*) FROM v$session WHERE username = USER GROUP BY event ORDER BY 2;
EVENT                                                              COUNT(*)
---------------------------------------------------------------- ----------
SQL*Net message FROM client                                               1
SQL*Net message TO client                                                 1
db file sequential READ                                                  24
db file scattered READ                                                   33
db file parallel READ                                                    42

可以看到用户进程经历比较严重的IO等待,而此时的db file parallel read,并不会带来性能提升。
可以通过添加隐含参数的方法来屏蔽prefetch功能,从而避免db file parallel read等待事件的产生:

_db_block_prefetch_limit=0
_db_block_prefetch_quota=0
_db_file_noncontig_mblock_read_count=0

参数文件添加这三个隐含参数后,重启数据库,再次运行压力测试,发现db file parallel read等待事件已经消失:

SQL> SELECT event, COUNT(*) FROM v$session WHERE username = USER GROUP BY event ORDER BY 2;
EVENT                                                              COUNT(*)
---------------------------------------------------------------- ----------
SQL*Net message TO client                                                 1
db file scattered READ                                                   30
db file sequential READ                                                  70
This entry was posted in ORACLE and tagged , , , , , . Bookmark the permalink.

2 Responses to 消除11.2上的db file parallel read

Leave a Reply

Your email address will not be published. Required fields are marked *