Friday, January 13, 2012

Enabling Asynchronous I/O and direct I/O in Oracle 11g R2 running on Red Hat Linux

I found a really good paper by Red Hat titled "Oracle 10g Server on Red Hat Enterprise Linux 5 Deployment Recommendations"

I have an Oracle 11g R2 (11.2.0.1.0) database running on Red Hat Linux version 2.6.18-274.7.1.el5, and wanted to try out if the recommendation still worked. So all the stuff you see below is right out of the above Red Hat document.The conclusion is, the recommendations by Red Hat still stand good for 11g R2.

To enable async I/O in Oracle, the disk_asynch_io parameter needs to be set to true in the init.ora file:
disk_asynch_io=true

The parameter disk_asynch_io is set to true by default in Oracle 11g:

SQL> show parameter disk_asynch_io;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
disk_asynch_io                       boolean     TRUE
SQL>

In my case the data files are on a file system(ext3) which supports asynchronous I/O.

To do async I/O on file systems, the filesystemio_options parameter needs to be set to "asynch" in addition to
disk_asynch_io=true:

filesystemio_options=asynch

This parameter is platform-specific. By default, this parameter is set to none for Linux and thus needs to be changed:

SQL> show parameter filesystemio_options;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options                 string      none
SQL>

The filesystemio_options variable can have the following values:
asynch: Enables asynchronous I/O on file system files
directio: Enables direct I/O on file system files
setall: Enables both asynchronous and direct I/O on file system files
none: Disables both asynchronous and direct I/O on file system files

If you also wish to enable Direct I/O Support, set filesystemio_options to "setall".

As per the documentation "For Red Hat Enterprise Linux 5, it is strongly recommended to use “setall” for ext2, ext3, GFS, NFS and OCFS2 file systems."

Below is what I did to enable asynchronous I/O and direct I/O for my Oracle 11g R2 database.


SQL> alter system set filesystemio_options=setall scope=spfile;

System altered.

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

Total System Global Area 2.6991E+10 bytes
Fixed Size                  2213976 bytes
Variable Size            1.7448E+10 bytes
Database Buffers         9395240960 bytes
Redo Buffers              145174528 bytes
Database mounted.
Database opened.
SQL> show parameter filesystemio_options;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options                 string      SETALL
SQL>

No comments: