您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息

Oracle在Linux下使用异步IO配置

2024/4/16 22:30:39发布6次查看
在测试oracle的时候,很想测试下使用异步io的性能。但是异步io是需要专门配置的,否则的话,容易遇到很著名的ldquo;ora-01578:
在测试oracle的时候,很想测试下使用异步io的性能。但是异步io是需要专门配置的,否则的话,容易遇到很著名的“ora-01578: oracle data block corrupted (file # 202, block # 257)”的问题。
那么什么是异步io呢,异步io有什么好处?
一般说来,异步i/o是和同步i/o相比较来说的,如果是同步i/o,当一个i/o操作执行时,应用程序必须等待,直到此i/o执行完. 相反,异步i/o操作在后台运行,i/o操作和应用程序可以同时运行,提高了系统性能; 使用异步i/o会提高i/o流量,如果应用是对裸设备进行操作,这种优势更加明显, 因此象数据库,文件服务器等应用往往会利用异步i/o,使得多个i/o操作同时执行.
oracle在默认情况是不使用异步io的。可查看参数filesystemio_options(默认值为none),有四种选项
■ asynch: enable asynchronous i/o on file system files, which has no timing requirement for transmission.
■ directio: enable direct i/o on file system files, which bypasses the buffer cache.
■ setall: enable both asynchronous and direct i/o on file system files.
■ none: disable both asynchronous and direct i/o on file system files.
oracle : 11.2.0.0.0
linux:debian  2.6.18-6-amd64
具体步骤如下:
1、首先用root用户安装以下必要的包
# aptitude search libaio
i   libaio-dev                                     - linux kernel aio access library - development files                                                    
i   libaio1                                           - linux kernel aio access library - shared library 
# aptitude install  libaio1 libaio-dev
2、在系统级支持异步i/o
oracle建议将aio-max-nr的值设置为1048576或更高。
# echo > /proc/sys/fs/aio-max-nr 1048576
3、在数据库级启用异步i/o
sql>alter system set disk_asynch_io=true scope=spfile;
sql>alter system set filesystemio_options=setall scope=spfile;
sql>shutdown immediate
$ cd $oracle_home/rdbms/lib
$ ln -s /usr/lib/libaio.so.1 skgaio.o
$ make pl_oralibs=-laio -f ins_rdbms.mk async_on
sql>startup
4、检查异步i/o是否在使用
    用以下命令即可检查异步io是否在使用,,kiocb的值不为0即是已使用。与kernel 2.4.x不同,没有显示kiobuf,因为从kernel 2.5.43开始,kiobuf已经从内核中被移除。
$ cat /proc/slabinfo | grep kio
kioctx 64 110 384 10 1 : tunables 54 27 8 : slabdata 11 11 0
kiocb 13 315 256 15 1 : tunables 120 60 8 : slabdata 21 21 44
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录