安装Grid执行root.sh出现ohasd failed解决方案

**这个很大程度上是grid 11.2.0.1 的一个BUG,另外发现在CPU为AMD时会触发这个bug,而intel则不会。

测试环境:OEL5.6 x86 & redhat 6.5 x64

执行root.sh脚本报错 
# ./root.sh
Running Oracle 11g root.sh script..
 
The following environment variables are set as
    ORACLE_OWNER= grid 
    ORACLE_HOME=  /u01/app/11.2.0/grid 
 
Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ..
   Copying oraenv to /usr/local/bin ..
   Copying coraenv to /usr/local/bin ..
 
Entries will be added to the /etc/oratab file as needed by 
Database Configuration Assistant when a database is created 
Finished running generic part of root.sh script
Now product-specific root actions will be performed
2013-04-03 14:53:56: Checking for super user privileges 
2013-04-03 14:53:56: User has super user privileges 
2013-04-03 14:53:56: Parsing the host name 
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params 
/etc/profile: line 6: ulimit: max user processes: cannot modify limit: Operation not permitted 
LOCAL ADD MODE 
Creating OCR keys for user 'grid', privgrp 'oinstall'.
Operation successful
CRS-4664: Node oracle11gr2 successfully pinned
Adding daemon to inittab 
Failed to start oracle-ohasd, error: 
ohasd failed to start: Inappropriate ioctl for device at /u01/app/11.2.0/grid/crs/install/roothas.pl line 296. 

或者可能如下错误:
Adding daemon to inittab
CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
ohasd failed to start: Inappropriate ioctl for device
ohasd failed to start at/u01/app/11.2.0/grid/crs/install/rootcrs.pl line 443.
 
CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
ohasd failed to start: Inappropriate ioctl for device
ohasd failed to start: Inappropriate ioctl for device at /u01/app/11.2.0/grid/crs/install/roothas.pl line 296.


解决方案

第一步:

回退root.sh脚本操作
#/u01/app/11.2.0/grid/crs/install/roothas.pl -deconfig -force -verbose
2013-04-03 14:44:34: Checking for super user privileges
2013-04-03 14:44:34:User has superuser privileges
2013-04-0314:44:34:Parsing the host name
Using configuration parameter file:/u01/app/11.2.0/grid/crs/install/crsconfig_params
CRS-4639:Could notcontact Oracle High Availability Services
CRS-4000:Command Stop failed,orcompleted with errors.
CRS-4639:Could notcontact Oracle High Availability Services
CRS-4000:Command Delete failed,orcompleted with errors.
CRS-4544:Unable toconnect toOHAS
CRS-4000:Command Stop failed,orcompleted with errors.
/u01/app/11.2.0/grid/bin/acfsdriverstate:line51:/lib/acfstoolsdriver.sh:No such file ordirectory
/u01/app/11.2.0/grid/bin/acfsdriverstate:line51:exec:/lib/acfstoolsdriver.sh:cannot execute:No such file ordirectory
Successfully deconfigured Oracle Restart stack 最后应该如下所示一样:

 



第二步:

方法1: 编辑$GRID_HOME/crs/install/s_crsconfig_lib.pm,查找if ($srv eq “ohasd”) { # Start OHASD)

 
# Start OHASD后方插入下列代码:

my$UPSTART_OHASD_SERVICE="oracle-ohasd";

 

my$INITCTL="/sbin/initctl";
($status,@output)=system_cmd_capture("$INITCTL start $UPSTART_OHASD_SERVICE");
if(0!=$status)
{
error("Failed to start $UPSTART_OHASD_SERVICE, error: $!");
return$FAILED;
}


# Check to see if the service is OHASD (推荐)方法2:在执行root.sh脚本时出现Adding daemon to inittab的时候,在另一个窗口使用root立即执行以下命令: # /u01/app/11.2.0/grid/root.sh

 

    if($srv eq"ohasd"){  
# Create the autorun file
        my$AUTORUNFILE=catfile($SCRBASE,$HOST,$HAS_USER,"ohasdrun");
        open(AUTORUN,">$AUTORUNFILE")
            ordie"Can't open $AUTORUNFILE for write: $!";
        print AUTORUN"stopn";
        close(AUTORUN);
        s_set_ownergroup($HAS_USER,$HAS_GROUP,$AUTORUNFILE)
            ordie"Can't change ownership of $AUTORUNFILE: $!";
        s_set_perms("0644",$AUTORUNFILE)
            ordie"Can't change permissions of $AUTORUNFILE: $!";  
        # Add OHASD to inittab
        print"Adding daemon to inittabn";
        s_remove_itab("cssd|evmd|crsd|ohasd")orreturn$FAILED;
        system("$INIT q");
        sleep(5);
        s_add_itab()orreturn$FAILED;
        system("$INIT q");  

        # Start OHASD
####################插在此处地方############################
my$UPSTART_OHASD_SERVICE="oracle-ohasd";
my$INITCTL="/sbin/initctl";  

($status,@output)=system_cmd_capture("$INITCTL start $UPSTART_OHASD_SERVICE");
if(0!=$status)
{
error("Failed to start $UPSTART_OHASD_SERVICE, error: $!");
return$FAILED;
}
#####################################################################
        $status=system("$CRSCTL start has");
      }elsif($srv eq"crsexcl"){
        trace("Starting Oracle clusterware exclusive");
        # Create the autorun file


方法2: 
 执行root.sh时,在另一个窗口执行
dd if=/var/tmp/.oracle/npohasd of=/dev/nullbs=1024 count=1(等待root.sh成功执行完毕后可以ctrl+c取消这里的命令)
 
之后创建以下文件输入以下命令
#vi /etc/init/oracle-ohasd.conf
start on runlevel[35]
stop on runlevel[!35]
respawn
exec/etc/init.d/init.ohasd run>/dev/null2>&1</dev/null
 
如果使用方法1,必须在执行root.sh脚本之前按照上述方法创建conf,否则执行root.sh也会无法通过。

如果使用方法2:则在执行完毕root.sh脚本后也必须创建,否则重启系统后无法自动启动HAS

验证:

 

Running Oracle 11g root.sh script...

 


The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/11.2.0/grid 

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ..

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
2013-04-03 14:45:16: Checking for super user privileges
2013-04-03 14:45:16: User has super user privileges
2013-04-03 14:45:16: Parsing the host name
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
/etc/profile: line 6: ulimit: max user processes: cannot modify limit: Operation not permitted
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node oracle11gr2 successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
ADVM/ACFS is not supported on oraclelinux-release-6Server-3.0.2.x86_64 

oracle11gr2     2013/04/03 14:45:50     /u01/app/11.2.0/grid/cdata/oracle11gr2/backup_20130403_144550.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Updating inventory properties for clusterware
Starting Oracle Universal Installer..

Checking swap space: must be greater than 500 MB.   Actual 4020 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
[root@oracle11gR2 grid]#

 

 

root.sh脚本执行成功

按照方法一的实施方法,会net配置错误,在安装完成后还需要手动netca

所以比较推荐方法二参考:http://www.dbtime.net/failed-executing-root-sh-ohasd-start-the-solution/参考:https://ibrisim.wordpress.com/2013/02/12/grid-infastrusture-11-2-0-1-linux-6-x-uyum-problemi-crs-4124-hatasi/




 
 
posted @ 2017-04-25 23:34  ld1977  阅读(319)  评论(0)    收藏  举报