十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
一、环境
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最大值