设为首页 加入收藏

TOP

ORACLE数据库异步IO介绍(二)
2015-11-21 01:28:56 来源: 作者: 【 】 浏览:2
Tags:ORACLE 数据库 异步 介绍
ibaio-devel-0.3.106-5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ? ? ? ? ? ? ? ?########################################### [100%]
? ?1:libaio-devel ? ? ? ? ? ########################################### [100%]
[root@DB-Server Server]# rpm -ivh ?libaio-devel-0.3.106-5.x86_64.rpm
warning: libaio-devel-0.3.106-5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ? ? ? ? ? ? ? ?########################################### [100%]
? ?1:libaio-devel ? ? ? ? ? ########################################### [100%]
?
[root@DB-Server Server]# rpm -qa | grep libaio
libaio-0.3.106-5
libaio-devel-0.3.106-5
libaio-devel-0.3.106-5
libaio-0.3.106-5
?
3:检查系统是否支持异步I/O
?
根据文档[Note 370579.1] ,可以通过查看slabinfo统计信息查看操作系统中AIO是否运行,slab是Linux的内存分配器,AIO相关的内存结构已经分配,kiocb值的第二列和第三列非0即是已使用
?
[root@DB-Server ~]# cat /proc/slabinfo | grep kio?
kioctx ? ? ? ? ? ? ? ?62 ? ?110 ? ?384 ? 10 ? ?1 : tunables ? 54 ? 27 ? ?8 : slabdata ? ? 11 ? ? 11 ? ? ?0
kiocb ? ? ? ? ? ? ? ? ?0 ? ? ?0 ? ?256 ? 15 ? ?1 : tunables ?120 ? 60 ? ?8 : slabdata ? ? ?0 ? ? ?0 ? ? ?0
kiocb值的第二列和第三列非0表示系统已经启用异步IO。如上所示,表示异步I/O没有在使用。
?
The kioctx and kiocb are Async I/O data structures that are defined in aio.h. If it shows a non zero value that means async io is enabled. source code loaded /usr/src/linux-/include/linux/aio.h
?
4:修改、优化系统内核参数
?
Linux从2.6 kernel开始,已经取消了对IO size的限制,Oracle建议将aio-max-nr的值设置为1048576或更高。
?
[root@DB-Server ~]# cat /proc/sys/fs/aio-max-nr
?
65536
?
命令echo 1048576 > /proc/sys/fs/aio-max-nr修改参数,只对当前环境有效,如果系统重启过后,则会使用默认值,所以最好修改参数文件/etc/sysctl.conf。编辑/etc/sysctl.conf 添加或修改参数fs.aio-max-nr = 1048576,保存后。运行sysctl -p使之生效。
?
?
[root@DB-Serveruat ~]# cat /proc/sys/fs/aio-max-nr
?
1048576
?
5:检查ORACLE软件是否支持开启AIO。
?
如下所示有输出值,表示ORACLE软件支持开启AIO,其实从ORACLE 9i R2开始,ORACLE就已经支持开启异步IO(AIO)了。不过10GR1以前版本需要手动开启AIO,相对而言要麻烦一些。
?
[oracle@DB-Server ~]$ /usr/bin/ldd $ORACLE_HOME/bin/oracle | grep libaio
? ? ? ? libaio.so.1 => /usr/lib64/libaio.so.1 (0x00007f5a247f4000)
[oracle@DB-Server ~]$ ?/usr/bin/nm $ORACLE_HOME/bin/oracle | grep io_getevent?
? ? ? ? ? ? ? ? ?w io_getevents@@LIBAIO_0.4
?
6:数据库级别启用异步I/O
?
将参数disk_asynch_io设置为true,其实ORACLE 10g R2中参数disk_asynch_io默认是为true的。
?
?
SQL> alter system set filesystemio_options = setall scope=spfile;?
?
System altered.
?
SQL> alter system set disk_asynch_io = true scope=spfile;?
?
System altered.
关于参数filesystemio_options有四个值: asynch、directio, setall,none. 一般建议设置为setall比较合适。
?
You can use the FILESYSTEMIO_OPTIONS initialization parameter to enable or disable asynchronous I/O or direct I/O on file system files. This parameter is platform-specific and has a default value that is best for a particular platform. It can be dynamically changed to update the default setting.
?
FILESYTEMIO_OPTIONS can be set to one of the following values:
?
?
?
? ?· ASYNCH: enable asynchronous I/O on file system files, which has no timing requirement for transmission.
?
? ? ? ? ? ? 在文件系统文件上启用异步I/O,在数据传送上没有计时要求。
?
· DIRECTIO: enable direct I/O on file system files, which bypasses the buffer cache.
?
? ? ? ? ? ? 在文件系统文件上启用直接I/O,绕过buffer cache。
?
· SETALL: enable both asynchronous and direct I/O on file system files.
?
? ? ? ? ? ? 在文件系统
首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇给结果集分页 下一篇linux安装oracle常见错误总结

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: