用SRVCTL在SQLPLUS中启动数据库失败
文章适用于oracle server的10.1-10.2版本,使用系统如下:
Oracle Solaris on x86 (32-bit)
Oracle Solaris on SPARC (64-bit)
Oracle Solaris on x86-64 (64-bit)
Solaris Operating System (Intel)Solaris Operating System (SPARC) (64-bit)Solaris Operating System (x86-64)
Solaris Operating System (x86)Solaris Operating System (SPARC 64-bit)
症状: 用srvctl启动实例/数据库会出一下错误
% srvctl start instance -d test -i test1
PRKP-1001 : Error starting instance test1 on node node1
CRS-0215: Could not start resource 'ora.test.test1.inst'.
下面有两种情况
情况1
告警日志显示
alert.log shows:
WARNING: EINVAL creating segment of size 0x00000004e200c000
fix shm parameters in /etc/system or equivalent
RACG log under $ORACLE_HOME/log/<hostname>/racg/imon_<DBNAME>.log shows:
SQL> ORA-27102: out of memory
SVR4 Error: 22: Invalid argument
SQL> Disconnect'
情况2
告警日志显示:
Fri Jun 4 22:32:44 2010
Starting ORACLE instance (normal)
RACG log under $ORACLE_HOME/log/<hostname>/racg/imon_<DBNAME>.log shows:
2010-06-04 22:32:44.501: [ RACG][6] [18218][6][ora.test.test1.inst]:
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Jun 4 22:32:44 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Enter user-name: Connected to an idle instance.
SQL> ORA-27102: out of memory
SVR4 Error: 28: No space left on device
可是用oracle用户的sqlplus就可以正常启动!
变化:查看/etc/project
system:0::::
user.root:1::::
noproject:2::::
default:3::::process.max-file-descriptor=(priv,4096,deny)
group.staff:10::::
group.dba:100::::process.max-file-descriptor=(priv,4096,deny);process.max-sem-nsems=(priv,12000,deny
);process.max-sem-ops=(priv,4096,deny);project.max-sem-ids=(priv,4096,deny);project.max-shm-ids=(priv,4096,deny);project.max-shm-memory=(priv,30064771072,deny)
oracle的计划是正确的,你可以噶边一个用sqlplus打开实例的方法:
% ps -u oracle -o pid,user,project,args
原因:
不是因为oracle的project
这是因为我们用srvctl打开实例的时候用的是系统的project
crsd.bin里,运行身份是root,而我们需要用的是oracle。
我们可以用root身份这样设定:
ps -ef|grep crsd.bin
prctl <pid of crsd.bin>
对于情况一,project设定的max-shm-memory太小,对于情况二project设定的max-shm-ids太小。
解决:
1、用root身份运行一下命令:
#projmod-s-K "project.max-shm-memory=(privileged,2.00TB,deny)" system
# projmod -s -K "project.max-sem-ids=(privileged,2048,deny)" system
# projmod -s -K "project.max-shm-ids=(privileged,512,deny)" system
然后运行
projects –l
确定以上的系统参数已经设定
2、 用root用户修改
# vi /etc/user_attr
例如一下修改
root::::auths=solaris.*,solaris.grant;profiles=Web Console Management,All;lock_after_retries=no;project=system
3、 用root身份分配crsd.bin
# ps -ef | grep crsd.bin
# newtask -p system -c <pid of crsd.bin>
# prctl -n project.max-shm-memory <pid of crsd.bin>
# prctl -n project.max-sem-ids <pid of crsd.bin>
# prctl -n project.max-shm-ids <pid of crsd.bin>
应该显示新的设置信息:
# prctl -n project.max-shm-memory 29316
process: 29316: /u01/oracle/product/10.2.0/crs/bin/crsd.bin reboot
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
project.max-shm-memory
privileged 2.00TB - deny -
system 16.0EB max deny
4、 现在用srvctl打开数据库应该可以工作
5、 由于节点重启后会改变,所以创建一个rc脚本/etc/rc3.d/S91proj
#!/bin/sh
#
newtask -p system /usr/bin/true