11gR2网格基础结构不正确使用ulimit设置
适用于:
Oracle Server - Standard Edition - Version: 11.2.0.1 and later [Release: 11.2 and later ]
Oracle Server - Enterprise Edition - Version: 11.2.0.1 and later [Release: 11.2 and later]
Generic UNIX
Generic Linux
特征
11gR2合适的ulimit和内核设置的网格基础架构 - 例如在Linux上:
A. ulimit设置
ulimit -a
max locked memory (kbytes, -l) 50000000
open files (-n) 65536
B. OS内核参数
/sbin/sysctl -a|grep file-max
fs.file-max = 6815744
C3.操作系统限制的配置
/bin/cat /etc/security/limits.conf
oracle soft nofile 131072
oracle hard nofile 131072
oracle soft memlock 50000000
oracle hard memlock 50000000
D4。 PAM限制配置:
/bin/cat /etc/pam.d/login | grep pam_limits.so
session required pam_limits.so
虽然网格构架会根据节点的重启尝试自动启动资源,但是各种警告或者错误将会几率在数据的得alert.log文件中或者组织数据库启动或者阻止客户端通过监听器连接数据库,再或者Hugegpages不能被用于Linux上。
1、数据库自动启动但是altert.log显示如下:
WARNING: Oracle instance running on a system with low open file
descriptor limit. Tune your system to increase this limit
to avoid severe performance degradation. Current limit = 992
2。数据库不会自动启动,SRVCTL启动失败:
$GRID_HOME/bin/srvctl start database -d testdb112
PRCR-1079 : Failed to start resource ora.testdb112.db
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
ORA-27123: unable to attach to shared memory segment
CRS-2674: Start of 'ora.testdb112.db' on 'eclnt5' failed
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
CRS-2528: Unable to place an instance of 'ora.testdb112.db' as all possible servers are occupied by the resource already
3。通过监听器无法连接到数据库,下面的错误报告:
sqlplus test/test@testdb112
SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 1 23:12:06 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27123: unable to attach to shared memory segment
Linux Error: 11: Resource temporarily unavailable
Process ID: 0
Session ID: 0 Serial number: 0
4。在Linux上不使用Hugepages
cat /proc/meminfo
..
HugePages_Total: 24576
HugePages_Free: 24576
原因
由于错误9084067,ohasd.bin和oraagent.bin不能使用ulimit设置正确后,网格基础设施的节点重新启动时自动启动
GRID_HOME/log/$HOSTNAME/ohasd/ohasdOUT.log may have similar message like following:
OHASD stderr redirected to ohasdOUT.log
2009-10-31 14:01:53
Changing directory to /ogrid/gbase/log/eclnt5/ohasd
OHASD starting
setrlimit(nofile): failed with -1/1
$GRID_HOME/log/$HOSTNAME/agent/ohasd/oraagent_oracle/oraagent_oracleOUT.log may have following:
setrlimit(nofile): failed with -1/1
解决方案:
该BUG是出现在11.2.0.1 PSU2, 11.2.0.2,如果修复没有成功,请执行以下的解决方法之一:
Option 1. 修改 /etc/init.d/ohasd (could be /etc/ohasd or /sbin/init.d/ohasd depend on platform):
Replace the following:
start()
{
$ECHO -n $"Starting $PROG: "
With
start()
{
$ECHO -n $"Starting $PROG: "
ulimit -n 65536
ulimit -l 50000000
并且重启节点
如果你有更大的SGA中,你需要调整“的ulimit- L”参数相应的例子,其设置到50GB以上
注意:如果应用了网格基础设施(CRS)补丁,那么修改可以生效。
Option 2.在节点重启时禁用集群件的自动启动,并手动启动它:
# For cluster installation:
$GRID_HOME/bin/crsctl disable crs
# For Oracle Restart:
$GRID_HOME/bin/crsctl disable has
注意:你只执行一次上面的命令
To start each time:
# For cluster installation, as root:
$GRID_HOME/bin/crsctl start crs
# For Oracle Restart, as grid user:
$GRID_HOME/bin/crsctl start has
参考文献
BUG:9084067 - 11.2 WARNING: ORACLE INSTANCE RUNNING WITH LOW OPEN FILE CURRENT LIMIT = 992
BUG:9251136 - INSTANCE WILL NOT USE HUGEPAGE IF STARTED BY SRVCTL
显示相关信息
产品
* Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Standard Edition
* Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
关键词
AUTOMATICALLY STARTED; HUGEPAGES; OHASD; INFRASTRUCTURE; OPEN FILE DESCRIPTOR; SRVCTL; LOW OPEN FILE DESCRIPTOR; ULIMIT
错误
ORA-1034; ORA-27101; ORA-27123; CRS-2674; CRS-2528