DB_FILE_MULTIBLOCK_READ_COUNT 与性能有关的参数

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DB_FILE_MULTIBLOCK_READ_COUNT 与性能有关的参数相关的知识,希望对你有一定的参考价值。

一、环境
Oracle 11g RAC

二、测试过程

SQL> show parameter db_file

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_multiblock_read_count        integer     128
db_file_name_convert                 string      /oracle/oradata/, +DATADG
db_files                             integer     200

SQL> set timing on
SQL> select count(*) from tt;

  COUNT(*)
----------
   5524288

Elapsed: 00:00:11.50
SQL> alter system flush buffer_cache;

System altered.

Elapsed: 00:00:00.20
SQL> alter system flush shared_pool;

System altered.

Elapsed: 00:00:00.39
SQL> alter session set db_file_multiblock_read_count=16;

Session altered.

Elapsed: 00:00:00.00
SQL> select count(*) from tt;

  COUNT(*)
----------
   5524288

Elapsed: 00:00:08.91
SQL> alter system flush buffer_cache; 

System altered.

Elapsed: 00:00:00.12

SQL> alter system flush shared_pool;

System altered.

Elapsed: 00:00:00.06
SQL> alter session set db_file_multiblock_read_count=32;

Session altered.

Elapsed: 00:00:00.00
SQL> select count(*) from tt;

  COUNT(*)
----------
   5524288

Elapsed: 00:00:07.87
SQL> alter system flush buffer_cache; 

System altered.

Elapsed: 00:00:00.14
SQL> alter system flush shared_pool;

System altered.

Elapsed: 00:00:00.06
SQL> alter session set db_file_multiblock_read_count=64;

Session altered.

Elapsed: 00:00:00.00
SQL> select count(*) from tt;

  COUNT(*)
----------
   5524288

Elapsed: 00:00:07.05
SQL> alter system flush buffer_cache;

System altered.

Elapsed: 00:00:00.15
SQL> alter system flush shared_pool;

System altered.

Elapsed: 00:00:00.06
SQL> alter session set db_file_multiblock_read_count=128;

Session altered.

Elapsed: 00:00:00.00
SQL> select count(*) from tt;

  COUNT(*)
----------
   5524288

Elapsed: 00:00:06.62
SQL> 
SQL> 

三、小结
1、对于全表扫描来说多块读,增加每次读取的块数,可以提高性能。
2、在OLTP的系统中建议此参数设置为8、16、32
3、在OLAP的系统中建议此参数设置为128最大值

以上是关于DB_FILE_MULTIBLOCK_READ_COUNT 与性能有关的参数的主要内容,如果未能解决你的问题,请参考以下文章