Oracle uses asynchronous IO configuration in Linux

Source: Internet
Author: User
When testing Oracle, I would like to test the performance of using asynchronous IO. However, asynchronous IO requires special configuration, otherwise, it is easy to encounter very famous ldquo; ORA-01578:

When testing Oracle, I would like to test the performance of using asynchronous IO. However, asynchronous IO requires special configuration, otherwise, it is easy to encounter very famous ldquo; ORA-01578:

When testing Oracle, I would like to test the performance of using asynchronous IO. But asynchronous IO requires special configuration, otherwise, it is easy to encounter a very famous "ORA-01578: ORACLE data block parallel upted (file #202, block #257)" problem.

So what is asynchronous IO? What are the advantages of asynchronous IO?

In general, asynchronous I/O is compared with synchronous I/O. If synchronous I/O is used, the application must wait when an I/O operation is executed, until the I/O execution is complete. on the contrary, asynchronous I/O operations are run in the background, and I/O operations and applications can run at the same time, improving the system performance. Using asynchronous I/O will increase the I/O traffic, this advantage is even more obvious if applications operate on bare devices. Therefore, applications such as databases and file servers often use asynchronous I/O to execute multiple I/O operations at the same time.

Oracle does not use Asynchronous IO by default. You can view the filesystemio_options parameter (default value: none). There are four options:

■ 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

The procedure is as follows:


1. First, use the root user to install the following necessary packages

# 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. Supporting asynchronous I/O at the system level


Oracle recommends that you set the aio-max-nr value to 1048576 or higher.

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


3. Enable asynchronous I/O at the database level

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. Check whether asynchronous I/O is in use

Run the following command to check whether asynchronous IO is in use. If the value of kiocb is not 0, it is used. Unlike kernel 2.4.x, kiobuf is not displayed because kiobuf has been removed from the kernel since kernel 2.5.43.

$ 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.