1、首先用root用户安装以下必要的rpm包

# rpm -Uvh libaio-0.3.106-3.2.x86_64.rpm
# rpm -Uvh libaio-devel-0.3.106-3.2.x86_64.rpm

2、在系统级支持异步I/O
  与[Note 225751.1]介绍的在RHEL3里面设置异步IO不同,不需要设置aio-max-size,而且'/proc/sys/fs'路径下也没有这个文件。因为从2.6 kernel开始,已经取消了对IO size的限制[Note 549075.1]。另外根据[Note 471846.1],Oracle建议将aio-max-nr的值设置为1048576或更高。

#echo > /proc/sys/fs/aio-max-nr 1048576

3、在数据库级启用异步I/O
  首先修改数据库参数。与[Note 225751.1]在RHEL 3里面设置异步IO不同,Oracle10gR2默认是打开了对异步IO的支持的,不需要重新编译数据库软件。在'$ORACLE_HOME/rdbms/lib'路径下,也没有'skgaioi.o'这个文件。在某些情况下,Oracle无法将IO行为或事件报告给操作系统[Note 365416.1],因此需要做以下操作。

这里开始换成oracle用户

SQL>alter system set disk_asynch_io=TRUE scope=spfile;

SQL>alter system setfilesystemio_options=asynchscope=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

在Oracle10gR2中AIO默认已经是开启的了。可以通过ldd或者nm来检查oracle是否已经启用了AIO支持,有输出代表已经启用。

[oraprod@db01 ~]$/usr/bin/ldd $ORACLE_HOME/bin/oracle | grep libaio
libaio.so.1 => /usr/lib64/libaio.so.1 (0x00002aaaac4a9000)
[oraprod@db01 ~]$/usr/bin/nm $ORACLE_HOME/bin/oracle | grep io_getevent
w io_getevents@@LIBAIO_0.4

4、检查异步I/O是否在使用
   根据[Note 370579.1],可以通过查看slabinfo统计信息查看操作系统中AIO是否运行,slab是Linux的内存分配器,AIO相关的内存结构已经分配,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

我的实验过程:
[Oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Dec 17 10:37:10 2010
Copyright (c) 1982, 2005, Oracle.All rights reserved.

[oracle@localhost ~]$ /usr/bin/nm $ORACLE_HOME/bin/oracle | grep io_getevent
w io_getevents@@LIBAIO_0.4
[oracle@localhost ~]$
[oracle@localhost ~]$
[oracle@localhost ~]$ /usr/bin/ldd $ORACLE_HOME/bin/oracle | grep libaio
libaio.so.1 => /usr/lib/libaio.so.1 (0x00507000)
[oracle@localhost ~]$ cat /proc/slabinfo | grep kio
kioctx1415256151 : tunables120600 : slabdata110
kiocb00128311 : tunables120600 : slabdata000
## 没有启用:
SQL> show parameter disk_asynch_io

NAMETYPE
------------------------------------ ----------------------
VALUE
------------------------------
disk_asynch_ioboolean
TRUE

SQL> sho parameter filesystemio_options

NAMETYPE
------------------------------------ ----------------------
VALUE
------------------------------
filesystemio_optionsstring
none
SQL>
SQL>
SQL> alter system set filesystemio_options = setallscope=both;
alter system set filesystemio_options = setallscope=both
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified

SQL>
SQL>alter system set filesystemio_options = setallscope=spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area285212672 bytes
Fixed Size1218992 bytes
Variable Size88082000 bytes
Database Buffers192937984 bytes
Redo Buffers2973696 bytes
Database mounted.
Database opened.
[root@localhost ~]# cat /proc/slabinfo | grep kio
kioctx1315256151 : tunables120600 : slabdata110
kiocb731128311 : tunables120600 : slabdata110

http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/ch23_os.htm#sthref749

9.1.1.1Asynchronous I/O
With synchronous I/O, when an I/O request is submitted to the operating system, the writing process blocks until the write is confirmed as complete. It can then continue processing. With asynchronous I/O, processing continues while the I/O request is submitted and processed. Use asynchronous I/O when possible to avoid bottlenecks.

Some platforms support asynchronous I/O by default, others need special configuration, and some only support asynchronous I/O for certain underlying file system types.

9.1.1.2FILESYSTEMIO_OPTIONS Initialization Parameter
You can use theFILESYSTEMIO_OPTIONSinitialization 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_OPTIONScan be set to one of the following values:

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.

转自http://www.linuxidc.com/Linux/2012-08/67929p2.htm

Oracle在Linux下使用异步IO(aio)配置的更多相关文章

  1. 如何提高Linux下块设备IO的整体性能?

    编辑手记:本文主要讲解Linux IO调度层的三种模式:cfp.deadline和noop,并给出各自的优化和适用场景建议. 作者简介: 邹立巍 Linux系统技术专家.目前在腾讯SNG社交网络运营部 ...

  2. 大并发连接的oracle在Linux下内存不足的问题的分析

    大并发连接的oracle在Linux下内存不足的问题的分析 2010-01-28 20:06:21 分类: Oracle 最近一台装有Rhel5.3的40G内存的机器上有一个oracle数据库,数据库 ...

  3. Linux下Qt的安装与配置

    参考资料:http://www.cnblogs.com/emouse/archive/2013/01/28/2880142.html Linux 下编译.安装.配置 QT 下载qt 这里用的是4.7. ...

  4. linux下redis的安装及配置启动

    linux下redis的安装及配置启动 标签: redisnosql 2014-10-24 14:04 19732人阅读 评论(0) 收藏 举报  分类: 数据与性能(41)  wget http:/ ...

  5. linux下vsftpd的安装及配置使用详细步骤(推荐)

    vsftpd 是“very secure FTP daemon”的缩写,安全性是它的一个最大的特点. vsftpd 是一个 UNIX 类操作系统上运行的服务器的名字,它可以运行在诸如 Linux.BS ...

  6. 莫小安 Linux下Redis的安装与配置

    转载自--Linux下Redis的安装与配置 redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcached类似,但很大程度补偿了 memcached的不足,它 ...

  7. Linux下apache+phppgadmin+postgresql安装配置

    Linux下apache+phppgadmin+postgresql安装配置 操作系统:CentOS 安装包:httpd(首选yum), php(包括php以及php-pgsql,php-mbstri ...

  8. Linux 下编译、安装、配置 QT

    转自Linux 下编译.安装.配置 QT 注意:编译安装耗时费力,且很容易出错,要不断调整编译参数,不推荐使用,否则这将会是一个纠结痛苦的过程. 打算做嵌入式图像处理,计划方案嵌入式Linux+Ope ...

  9. 在Linux下,在网络没有配置好前,怎样查看网卡的MAC地址?

    在Linux下,在网络没有配置好前,怎样查看网卡的MAC地址? 使用 dmesg 与 grep 命令来实际,例如以下: [root@localhost ~]# dmesg | grep eth e10 ...

随机推荐

  1. LA 3704 Cellular Automaton

    题意概述: 等价地,本题可以转化为下面的问题: 考虑$n \times n$的$0-1$矩阵$A$,在第$i$行上第$[-d+i, d+i]$(模$n$意义下)列对应的元素为$1$,其余为$0$.求$ ...

  2. poj2395 Out of Hay

    题意就是给你一张无向连通图,试问对于图上所有点对(u,v)从u到v的所有路径中边权最大值的最小值的最大值. 定义f(u,v)表示从u到v所有路径中边权最大值的最小值,对所有点对取其最大. 实际上就是求 ...

  3. Unity-Animator深入系列---状态机面板深入

    回到 Animator深入系列总目录 本篇不讲解所有的面板功能,只是针对一些非常用功能进行介绍. 1.状态 1.1状态简介 简单的不做介绍了,需要特别注意: 1.Paramter勾选后可以指定参数控制 ...

  4. C语言中'\0'与'\n'

    '\0'表示ASCII编号为0的字符,在C语言中最常用于代表字符串结束的标志.'\n'表示ASCII编号为13的字符,代表回车键,输出这个字符就会换一行. '\0'作为字符串的结束标志,本身会占用一个 ...

  5. SqlSever基础 right函数 从右边开始,截取字符串

    镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ ...

  6. #有如下值集合[11,22,33,44,55,66,77,88,99,90...],将所有大于66值保存至字典的一个key中,将小于66的值保存至大二个key的值

    #!/usr/bin/env python #有如下值集合[11,22,33,44,55,66,77,88,99,90...],将所有大于66值保存至字典的一个key中,将小于66的值保存至大二个ke ...

  7. :判断101-200之间有多少个素数,并输出所有素数。 程序分析:判断素数的方法:用一个数分别去除2到sqrt(这个数),如果能被整除, 则表明此数不是素数,反之是素数。

    package C; public class Sushu { public static void main(String[] args) { int sum=0; for (int i = 101 ...

  8. Java_一些特殊的关键字详(?)解

    1. native. 在看JDK源码时,想知道Math包里比如cos, sin等函数是如何实现的(猜想的是用他们在0点的泰勒展开式近似),但是打开之后却发现只有一个函数声明,并且有关键字native, ...

  9. POSTMAN中各种请求方式的区别

    1.form-data:  就是http请求中的multipart/form-data,它会将表单的数据处理为一条消息,以标签为单元,用分隔符分开.既可以上传键值对,也可以上传文件.当上传的字段是文件 ...

  10. [HDOJ5943]Kingdom of Obsession(最大匹配,思路)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5943 题意:n个人编号为[s+1,s+n],有n个座位编号为[1,n],编号为i的人只能坐到编号为它的 ...