- 浏览: 76541 次
- 性别:
- 来自: 成都
文章分类
最新评论
HP-UX: Asynchronous i/o [ID 139272.1]
PURPOSE
-------
The purpose of this document is to discuss the implementation of
asynchronous i/o (aio) on HP-UX, specifically to enable aio for the Oracle
RDBMS Server.
SCOPE & APPLICATION
-------------------
This note is intended for DBAs and Support Personnel.
1.0 Introduction
================
On HP-UX, when the Oracle datafiles reside on a filesystem, then the DBWR
process(es) make synchronous writes to these datafiles. This means that each
write must return with a 'succesful completion' before the next write is
issued. This serial operation can lead to a i/o bottleneck. There are two ways
to counteract this:
a. configure multiple DBWR processes
b. use asynchronous i/o
Before deciding on one of these two options, it should be noted that on HP-UX,
aio is *only* possible on a raw device. Put in another way, aio *cannot* be used
on a filesystem.
Multiple DBWRs can be used on a filesystem.
It is not recommended to use both multiple DBWRs and aio.
2.0 Configuring asynchronous i/o
================================
aio requires configuration of both Oracle and HP-UX
2.1 HP-UX Configuration
-----------------------
a. create the /dev/async character device
% /sbin/mknod /dev/async c 101 0x0
% chown oracle:dba /dev/async
% chmod 660 /dev/async
If the device does not exist, then ENODEV (Err #19) is returned when the device
is accessed:
Async driver not configured : errno=19
If the permissions are incorrect, then EACCES (Err #13) is returned:
Async driver not configured : errno=13
b. configure the async driver in the kernel
Using SAM
-> Kernel Configuration
-> Drivers
-> the driver is called 'asyncdsk'
Generate new kernel
Reboot
c. set max_async_ports
Using SAM
-> Kernel Configuration
-> Configurable Parameters
-> max_async_ports
max_async_ports limits the maximum number of processes that can concurrently
use /dev/async. Set this parameter to the sum of
'processes' from init.ora + number of background processes
The background processes started at instance startup will open /dev/async
twice.
If max_async_ports is reached, subsequent processes will use synchronous i/o.
d. set aio_max_ops
Using SAM
-> Kernel Configuration
-> Configurable Parameters
-> aio_max_ops
aio_max_ops limits the maximum number of asynchronous i/o operations that
can be queued at any time. Set this parameter to the default value (2048),
and monitor over time (use glance).
e. if HP-UX patch PHKL_22126 (or one that supersedes it) is installed, then
see Section 3.0
2.2 Oracle Configuration
------------------------
The following init.ora parameters are required.
a. pre 7.3.0
no init.ora parameters required
b. 7.3.X
use_async_io = TRUE
c. 8.X
disk_asynch_io = TRUE
3.0 Implications of HP-UX Patch PHKL_22126
==========================================
This patch is called:
PHKL_22126: s700_800 11.00 VM,async,hyperfabric
The HP-UX patch description says:
The effective user ID of the process calling async driver,
typically called by a process for database applications such
as Oracle, must be a superuser or the user must
be a member of a group that has the MLOCK privilege.
In essence, aio will not work for Oracle, unless the dba group has the MLOCK
privilege.
To check if a group has the MLOCK privilege, execute:
% /usr/bin/getprivgrp <group-name>
If the dba group is not listed, then set it:
% /usr/sbin/setprivgrp <group-name> MLOCK
Note, the next reboot will clear this privilege. To automate this at startup,
create /etc/privgroup with the entry
dba MLOCK
This can be tested with
% /usr/sbin/setprivgrp -f /etc/privgroup
See 'man 1m setprivgrp' for more information.
If the MLOCK privilege is not granted to the dba group, then instance startup
will exhibit the following:
a. prior to 8.1.7, each background and shadow process will dump a trace file
with the following:
Ioctl ASYNC_CONFIG error, errno = 1
errno 1 is EPERM (Not super-user).
Such trace files may be found in
$ORACLE_HOME/rdbms/log
background_dump_dest
user_dump_dest
Additionally, a tusc of instance startup will show the following for
each background process:
[16044] open("/dev/async", O_RDWR, 01760) ................ = 14
...
[16044] ioctl(14, 0x80106101, 0x7f7f51b0) ................ ERR#1 EPERM
Similar output will be given for a tusc of a shadow process.
The instance does start, but i/o is synchronous
b. in 8.1.7, the instance will not start, and will error with:
SVRMGR> startup
ORA-00445: background process "PMON" did not start after 120 seconds
See Note:133007.1 for the alert on this.
c. in 9.0.1, the behaviour is similar to pre-8.1.7, in that trace files with
the following are dumped:
Ioctl ASYNC_CONFIG error, errno = 1
Additionally, the following is also seen:
Ioctl ASYNC_ADDSEG error, errno = 1
The instance does start, but i/o is synchronous.
4.0 Checking that Asynchronous i/o is being used
================================================
Async i/o is being used if both the following are true:
a. /dev/async is open by DBWR
b. the relevant init.ora partameter is set (see Section 2.2)
c. the datafiles are on raw devices
To check if /dev/async is open by DBWR, do one of:
i. % fuser /dev/async
ii. % lsof -p <dbwr pid>
lsof can be downloaded from ftp://vic.cc.purdue.edu/pub/tools/unix/lsof
iii. use glance/gpm to check files opened by DBWR
NB - Oracle server processes (background and foreground) will attempt to open
/dev/async if the async driver is enabled in the HP-UX kernel, regardless
of init.ora settings.
If (a), (b)and (c) are true, and i/o is still perceived to be synchronous, attach
to DBWR with tusc, and check that write calls to /dev/async are not returning an
error. The file descriptor for /dev/async will be needed, which can be retrieved
using lsof.
5.0 The fs_async kernel parameter
=================================
The kernel parameter fs_async can be set to allow asynchronous writes to file
systems. However, write calls can return without the data being physically
written to disk (the write sits in the UNIX buffer cache). The data in question
is file-system metadata such as free space lists, blocks and inodes.
A system crash would potentially lose this data, and leave the filesystem in an
inconsistent state, causing database corruption.
Oracle still opens files with the O_DSYNC flag (see 'tusc' snipet
below), which insists that writes are physically written:
open("/oracle/datafiles/system01.dbf", O_RDWR|O_LARGEFILE|O_DSYNC, 0) = 19
In summary, fs_async is ignored for datafiles(due to open() with O_DSYNC).
However, filesystem metadata may be lost, potentially causing datafile
corruption.
Oracle does not recommend setting fs_async to '1'.
Settings:
fs_async=0 Do not use async writes to file systems
fs_async=1 Do async writes to file systems
RELATED DOCUMENTS
-----------------
Note:174487.1 - ALERT:HP-UX: RDBMS May Not Start if Async Disk Driver is
Configured
Note:133007.1 - ALERT: HP/UX: 8.1.7 RDBMS will not start if the async disk
driver is configured
Oracle Server Installation FAQ [ID 168607.1]
PURPOSE
-------
The purpose of this document is to discuss the implementation of
asynchronous i/o (aio) on HP-UX, specifically to enable aio for the Oracle
RDBMS Server.
SCOPE & APPLICATION
-------------------
This note is intended for DBAs and Support Personnel.
1.0 Introduction
================
On HP-UX, when the Oracle datafiles reside on a filesystem, then the DBWR
process(es) make synchronous writes to these datafiles. This means that each
write must return with a 'succesful completion' before the next write is
issued. This serial operation can lead to a i/o bottleneck. There are two ways
to counteract this:
a. configure multiple DBWR processes
b. use asynchronous i/o
Before deciding on one of these two options, it should be noted that on HP-UX,
aio is *only* possible on a raw device. Put in another way, aio *cannot* be used
on a filesystem.
Multiple DBWRs can be used on a filesystem.
It is not recommended to use both multiple DBWRs and aio.
2.0 Configuring asynchronous i/o
================================
aio requires configuration of both Oracle and HP-UX
2.1 HP-UX Configuration
-----------------------
a. create the /dev/async character device
% /sbin/mknod /dev/async c 101 0x0
% chown oracle:dba /dev/async
% chmod 660 /dev/async
If the device does not exist, then ENODEV (Err #19) is returned when the device
is accessed:
Async driver not configured : errno=19
If the permissions are incorrect, then EACCES (Err #13) is returned:
Async driver not configured : errno=13
b. configure the async driver in the kernel
Using SAM
-> Kernel Configuration
-> Drivers
-> the driver is called 'asyncdsk'
Generate new kernel
Reboot
c. set max_async_ports
Using SAM
-> Kernel Configuration
-> Configurable Parameters
-> max_async_ports
max_async_ports limits the maximum number of processes that can concurrently
use /dev/async. Set this parameter to the sum of
'processes' from init.ora + number of background processes
The background processes started at instance startup will open /dev/async
twice.
If max_async_ports is reached, subsequent processes will use synchronous i/o.
d. set aio_max_ops
Using SAM
-> Kernel Configuration
-> Configurable Parameters
-> aio_max_ops
aio_max_ops limits the maximum number of asynchronous i/o operations that
can be queued at any time. Set this parameter to the default value (2048),
and monitor over time (use glance).
e. if HP-UX patch PHKL_22126 (or one that supersedes it) is installed, then
see Section 3.0
2.2 Oracle Configuration
------------------------
The following init.ora parameters are required.
a. pre 7.3.0
no init.ora parameters required
b. 7.3.X
use_async_io = TRUE
c. 8.X
disk_asynch_io = TRUE
3.0 Implications of HP-UX Patch PHKL_22126
==========================================
This patch is called:
PHKL_22126: s700_800 11.00 VM,async,hyperfabric
The HP-UX patch description says:
The effective user ID of the process calling async driver,
typically called by a process for database applications such
as Oracle, must be a superuser or the user must
be a member of a group that has the MLOCK privilege.
In essence, aio will not work for Oracle, unless the dba group has the MLOCK
privilege.
To check if a group has the MLOCK privilege, execute:
% /usr/bin/getprivgrp <group-name>
If the dba group is not listed, then set it:
% /usr/sbin/setprivgrp <group-name> MLOCK
Note, the next reboot will clear this privilege. To automate this at startup,
create /etc/privgroup with the entry
dba MLOCK
This can be tested with
% /usr/sbin/setprivgrp -f /etc/privgroup
See 'man 1m setprivgrp' for more information.
If the MLOCK privilege is not granted to the dba group, then instance startup
will exhibit the following:
a. prior to 8.1.7, each background and shadow process will dump a trace file
with the following:
Ioctl ASYNC_CONFIG error, errno = 1
errno 1 is EPERM (Not super-user).
Such trace files may be found in
$ORACLE_HOME/rdbms/log
background_dump_dest
user_dump_dest
Additionally, a tusc of instance startup will show the following for
each background process:
[16044] open("/dev/async", O_RDWR, 01760) ................ = 14
...
[16044] ioctl(14, 0x80106101, 0x7f7f51b0) ................ ERR#1 EPERM
Similar output will be given for a tusc of a shadow process.
The instance does start, but i/o is synchronous
b. in 8.1.7, the instance will not start, and will error with:
SVRMGR> startup
ORA-00445: background process "PMON" did not start after 120 seconds
See Note:133007.1 for the alert on this.
c. in 9.0.1, the behaviour is similar to pre-8.1.7, in that trace files with
the following are dumped:
Ioctl ASYNC_CONFIG error, errno = 1
Additionally, the following is also seen:
Ioctl ASYNC_ADDSEG error, errno = 1
The instance does start, but i/o is synchronous.
4.0 Checking that Asynchronous i/o is being used
================================================
Async i/o is being used if both the following are true:
a. /dev/async is open by DBWR
b. the relevant init.ora partameter is set (see Section 2.2)
c. the datafiles are on raw devices
To check if /dev/async is open by DBWR, do one of:
i. % fuser /dev/async
ii. % lsof -p <dbwr pid>
lsof can be downloaded from ftp://vic.cc.purdue.edu/pub/tools/unix/lsof
iii. use glance/gpm to check files opened by DBWR
NB - Oracle server processes (background and foreground) will attempt to open
/dev/async if the async driver is enabled in the HP-UX kernel, regardless
of init.ora settings.
If (a), (b)and (c) are true, and i/o is still perceived to be synchronous, attach
to DBWR with tusc, and check that write calls to /dev/async are not returning an
error. The file descriptor for /dev/async will be needed, which can be retrieved
using lsof.
5.0 The fs_async kernel parameter
=================================
The kernel parameter fs_async can be set to allow asynchronous writes to file
systems. However, write calls can return without the data being physically
written to disk (the write sits in the UNIX buffer cache). The data in question
is file-system metadata such as free space lists, blocks and inodes.
A system crash would potentially lose this data, and leave the filesystem in an
inconsistent state, causing database corruption.
Oracle still opens files with the O_DSYNC flag (see 'tusc' snipet
below), which insists that writes are physically written:
open("/oracle/datafiles/system01.dbf", O_RDWR|O_LARGEFILE|O_DSYNC, 0) = 19
In summary, fs_async is ignored for datafiles(due to open() with O_DSYNC).
However, filesystem metadata may be lost, potentially causing datafile
corruption.
Oracle does not recommend setting fs_async to '1'.
Settings:
fs_async=0 Do not use async writes to file systems
fs_async=1 Do async writes to file systems
RELATED DOCUMENTS
-----------------
Note:174487.1 - ALERT:HP-UX: RDBMS May Not Start if Async Disk Driver is
Configured
Note:133007.1 - ALERT: HP/UX: 8.1.7 RDBMS will not start if the async disk
driver is configured
Oracle Server Installation FAQ [ID 168607.1]
发表评论
-
Oracle 9i/10g/11g数据库升级路线图upgrade
2011-09-14 14:17 998From: http://www.orac ... -
相关网址
2011-08-17 14:58 715锁:http://blog.csdn.net/tianleso ... -
10g11gConfiguration of TAF(Transparent Application Failover) and Load Balancing
2010-09-26 15:01 142210g & 11g :Configuration of ... -
SELECT containing a MIN or MAX into a CHAR variable inside a PL/SQL block Fails
2010-09-08 09:50 1785简单描述下:主机HP 11.31 数据库ORACLE 920 ... -
在UNIX裸设备和文件系统之间移动ORACLE(转载)
2010-09-04 17:19 1378一、关于裸设备 1.1 什 ... -
Troubleshooting ORA-29740 in a RAC Environment
2010-06-10 16:15 1918最近要更换新存储,早上在机房布置光纤的时候,不小心把HP服务器 ... -
(转metalink)Troubleshooting ORA-27300 ORA-27301 ORA-27302 errors [ID 579365.1]
2010-05-11 14:47 8396Troubleshooting ORA-27300 ORA-2 ... -
ORA-27054 ERRORS WHEN RUNNING RMAN WITH NFS
2010-05-07 14:43 1895Subject: ORA-27054 ERRORS WHEN ... -
DBA日常工作职责(转载 eygle)
2010-01-13 09:12 1853DBA的工作职责是什么?每天DBA应该做哪些工作?稳定环境中的 ... -
Parameter DIRECT: Conventional Path Export Versus Direct Path Export
2009-12-10 10:11 11491. Introduction. 1.1. Starting ... -
ORA-600 [srsnext_1] when running 9.2 on AIX 5.2 [ID 262851.1]
2009-12-02 14:49 1032ORA-600 [srsnext_1] when runnin ... -
PSU--Oracle数据库补丁管理的重要改进
2009-11-30 15:23 29312009年10月20日,Oracle公 ... -
监听文件 LISTENER.ORA 各参数意思
2009-11-20 21:55 2070监听文件 LISTENER.ORA 各参数意思 The fo ... -
dba要做的事
2009-11-14 18:40 946dba要做的事 ORACLE数据库管理员应按如下方式对ORAC ... -
ORA-00600 [kglobpn_1] -- metalink
2009-11-11 13:35 1572Application Received ORA-00600 ... -
软分析--快速软分析
2009-10-06 15:48 1139一、SQL执行过程 客户端发出一个SQL,会经历如下步骤后才会 ... -
ORACLE 查看用户密码修改时间
2009-10-06 15:46 5912ORACLE 查看用户密码修改时间 1。当前数据库版本为 ...
相关推荐
Asynchronous Http Client for Android Build Status An asynchronous, callback-based Http client for Android built on top of Apache's HttpClient libraries. Changelog See what is new in version 1.4.9 ...
介绍android 异步任务不可多得的好书,主要介绍了AsyncTask, handler,looper,loader,IntentService,AlarmManager等
Asynchronous Http Client for Android An asynchronous, callback-based Http client for Android built on top of Apache's HttpClient libraries. Changelog See what is new in version 1.4.9 released on 19th...
Current release v3.0.0.0 (Oct 28, 2007) in version v3.0.0.0 <br>- New : support for C++Builder 2007(支持C++ Builder 2007) - New : asynchronous events added to almost all controls....
Spring入门指南弹簧导轨 异步方法: : 消费休息: : 休息服务: ... //spring.io/guides/gs/reactor-thumbnailer/ 非弹簧指南:async-rest-service: http : //www.jayway.com/2014/09/09/asynchronous-spring-service/
http://ws.apache.org/axis2/1_0/Axis2ArchitectureGuide.html for an overview on Axis2 architecture. Axis2/C supports both SOAP 1.1 and SOAP 1.2. The soap processing model is built on the AXIOM XML...
## How do I install it and how do I get started? Installing `keras-rl` is easy. Just run the following commands and you should be good to go: ```bash pip install keras-rl ``` This will install `keras-...
l I/O programming and PCI bus programming l AGP variants and graphic systems l Universal serial bus l Local storage from the diskette to DVD l Memory systems, SDRAM, EDO, flas, RAM bus, and ...
This project not using asynchronous sockets! The Project contains simple low level non-visual objects for easiest programming without problems. (no required multithread synchronisation, no need for ...
移动 LED 消息检测###有用的链接 - 在 android studio 中配置 opencv: : - communication standard: http://en.wikipedia.org/wiki/Asynchronous_serial_communication- coercing android to set the camera fps: ...
auto sessionId = res.cookie("SessionId"); std::cout << sessionId.value() << std::endl; std::cout << sessionId.httpOnly() << std::endl; std::cout << sessionId.secure() << std::end
Simple HTTP asynchronous library for modern C++. Depends on coro. Here's the basic usage: auto coro = coro::start([]{ try { auto res = http::post( "https://192.168.1.154/user/login", "{ \"UserId...
这是一个用于与网站交互的 Node.js 包,允许您从任何存储库异步获取任意数量的提交。 文档 安装包 ... 在此之后,您可以通过运行npm install @viral32111/facepunch-commits来安装该软件包。 导入包 ...
libuv is a multi-platform support library with a focus on asynchronous I/O. It was primarily developed for use by [Node.js][], but it's also used by [Luvit](http://luvit.io/), [Julia]...
Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients. Netty is a NIO client server framework which ...
RO11 - Building Asynchronous Clients... RO12 - Consuming an Existing SOAP Based... RO13 - Smart Project: Creating Scalable... RO14 - Introducing the DiscoveryClient... RO15 - Behind the Scenes: Inside...
[FLIP-12: Asynchronous I/O Design and Implementation]。 其设计的核心是对原有的每条处理后的消息发送至下游operator的执行流程进行改进。其核心实现是引入了一个AsyncWaitOperator,在其processElement/...