SYS@sinitek>select event,count(*) from v$session_wait group by event;
EVENT COUNT(*)
---------------------------------------------------------------- ----------
SQL*Net message from client 70
log file sync 3
wait for a undo record 1
db file async I/O submit 2
rdbms ipc message 10
db file sequential read 12
pmon timer 1
wait for stopper event to be increased 1
Streams AQ: qmn slave idle wait 1
log file parallel write 1
Space Manager: slave idle wait 1
EVENT COUNT(*)
---------------------------------------------------------------- ----------
SQL*Net message to client 1
Streams AQ: qmn coordinator idle wait 1
Streams AQ: waiting for time management or cleanup tasks 1
VKTM Logical Idle Wait 1
direct path read 1
DIAG idle wait 2
发现其中有db file async I/O submit 等待时间
这个事件产生的原因:
在11g数据库中,默认的异步I/O是打开的
SYS@sinitek>show parameter disk
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string
asm_diskstring string
disk_asynch_io boolean TRUE
但是实际filesystemio_options并没有设置
SYS@sinitek>show parameter filesystem
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options string none
我们可以关闭异步I/O 或者启动filesystemio_options两种方法来消除这个等待时间
SYS@sinitek>alter system set disk_asynch_io =false scope=spfile;
or
SYS@sinitek>alter system set filesystemio_options =asynch scope=spfile;
[oracle@db ~]$ cat /proc/slabinfo | grep kio
kioctx 26 40 192 20 1 : tunables 120 60 8 : slabdata 2 2 0
kiocb 8 30 128 30 1 : tunables 120 60 8 : slabdata 1 1 0
可以通过以上命令看是否启用了异步I/O 如果kiocb中有值,就证明启用了异步I/O