Solaris10如何确认DirectIO是否已经启用
对于Oracle而言,如果数据库存储在UFS文件系统上,启用DirectIO能够提高数据库性能。Oracle有个参数filesystemio_options可以控制数据库是否使用DirectIO. 如果在Oracle已经设置了使用DirectIO,怎样才能确认DirectIO是否真起作用了呢?在Solaris10上,可以通过dtrace来确认DirectIO是否已经启用。
1. DirectIO未启用的情况
检查filesystemio_options参数设置
SQL> show parameter filesystem NAME TYPE VALUE ------------------------------------ -------------------------------- ------------------------------ filesystemio_options string ASYNCH
ASYNCH表示数据库只启用了异步IO, 没有启用DirectIO.
Dtrace检查控制文件是否启用DirectIO
root@ofs001 # dtrace -n io:::start'/(args[0]->b_flags & B_READ) == 0 && args[2]->fi_pathname == "/oracle/data1/ACC010C1/control01.dbf"/{@[stack()] = count()}' dtrace: description 'io:::start' matched 6 probes ^C ufs`lufs_write_strategy+0x100 ufs`ufs_putapage+0x4f1 ufs`ufs_putpages+0x308 ufs`ufs_putpage+0x82 genunix`fop_putpage+0x28 genunix`vpm_sync_pages+0xa3 ufs`wrip+0x6f7 ufs`ufs_write+0x211 genunix`fop_write+0x31 genunix`pwrite+0x14f unix`sys_syscall+0x17b 44
系统调用了ufs_write, 表示DirectIO未启用
Dtrace检查数据文件是否启用DirectIO
在一个session上执行dtrace命令,另一session执行一个create table … as select * from xx;的命令.
root@ofs001 # dtrace -n io:::start'/(args[0]->b_flags & B_READ) == 0 && args[2]->fi_pathname == "/oracle/data2/ACC010C1/users01.dbf"/{@[stack()] = count()}' dtrace: description 'io:::start' matched 6 probes ^C ufs`lufs_write_strategy+0x100 ufs`ufs_putapage+0x501 ufs`ufs_putpages+0x308 ufs`ufs_putpage+0x82 genunix`fop_putpage+0x28 genunix`vpm_sync_pages+0xa3 ufs`wrip+0x6f7 ufs`ufs_write+0x211 genunix`fop_write+0x31 genunix`pwrite+0x14f unix`sys_syscall+0x17b 4 ufs`lufs_write_strategy+0x100 ufs`ufs_putapage+0x4f1 genunix`pvn_vplist_dirty+0x3aa ufs`ufs_putpages+0x1c2 ufs`ufs_putpage+0x82 genunix`fop_putpage+0x28 ufs`ufs_fsync+0x1c4 genunix`fop_fsync+0x28 genunix`fdsync+0x28 unix`sys_syscall+0x17b 20 系统调用ufs_write, 表示DirectIO未启用
2. DirectIO启用的情况
检查filesystemio_options参数设置
SQL> show parameter filesystem NAME TYPE VALUE ------------------------------------ -------------------------------- ------------------------------ filesystemio_options string SETALL
SETALL表示数据库同时启用了异步IO和DirectIO.
Dtrace检查控制文件是否启用DirectIO
root@ofs001 # dtrace -n io:::start'/(args[0]->b_flags & B_READ) == 0 && args[2]->fi_pathname == "/oracle/data1/ACC010C1/control01.dbf"/{@[stack()] = count()}' dtrace: description 'io:::start' matched 6 probes ^C ufs`directio_start+0x12c ufs`ufs_directio_write+0x788 ufs`ufs_write+0x383 genunix`fop_write+0x31 genunix`pwrite+0x14f unix`sys_syscall+0x17b 39 系统调用ufs_directio_write, 表示启用了directio.
Dtrace检查数据文件是否启用DirectIO
在一个session上执行dtrace命令,另一session执行一个create table … as select * from xx;的命令.
root@ofs001 # dtrace -n io:::start'/(args[0]->b_flags & B_READ) == 0 && args[2]->fi_pathname == "/oracle/data2/ACC010C1/users01.dbf"/{@[stack()] = count()}' dtrace: description 'io:::start' matched 6 probes ^C ufs`directio_start+0x12c ufs`ufs_directio_write+0x788 ufs`ufs_write+0x383 genunix`fop_write+0x31 genunix`pwrite+0x14f unix`sys_syscall+0x17b 17 系统调用ufs_directio_write, 表示启用了directio.