一个隐含参数:
_serial_direct_read = false 禁用direct path read
_serial_direct_read = true 启用direct path read
alter system set "_serial_direct_read"=never scope=both sid='*'; 可以显着减少direct path read
测试如下:
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Apr 24 14:55:32 2019
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ
2 FROM SYS.x$ksppi x, SYS.x$ksppcv y
3 where x.indx = y.indx
4 AND (x.ksppinm ='_small_table_threshold' or x.ksppinm='_serial_direct_read');
NAME VALUE DESCRIB
---------------------------------------- -------------------- -------------------------------------------------------
_small_table_threshold 1023 lower threshold level of table size for direct reads
_serial_direct_read AUTO enable direct read in serial
在线修改_serial_direct_read是动态参数
SQL> alter system set "_serial_direct_read"=never scope=both sid='*';
System altered.
验证:
SQL> r
1 SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ
2 FROM SYS.x$ksppi x, SYS.x$ksppcv y
3 where x.indx = y.indx
4* AND (x.ksppinm ='_small_table_threshold' or x.ksppinm='_serial_direct_read')
NAME VALUE DESCRIB
---------------------------------------- -------------------- -------------------------------------------------------
_small_table_threshold 1023 lower threshold level of table size for direct reads
_serial_direct_read NEVER enable direct read in serial