1. 程式人生 > >grid軟體,執行root.sh指令碼失敗,解決辦法

grid軟體,執行root.sh指令碼失敗,解決辦法

原帖地址:http://www.vydbs.com/failed-executing-root-sh-ohasd-start-the-solution/
在Red Hat 6.2上安裝Oracle grid 11.2.0.1,執行root.sh指令碼的時候出現一些問題,無法啟動ohasd。


由於Redhat Enterprise Linux 6開始的啟動初始化已由init改用upstart的方式,inittab只保留和支援執行級別的配置,其它配置放到了別的地方,oracle 11.2.0.1的grid在安裝時執行root.sh指令碼還是使用的init方式,會寫啟動配置到inittab,而11.2.0.1還是按照5的init模式配置。


實際上造成11.2.0.1在Red Hat6上安裝錯誤是因為upstart/init不一致性,從RHEL6開始,/etc/inittab檔案內容變了,只有預設的啟動等級。而Oracle 11.2.0.1仍是按照以前的習慣把啟動命令寫在/etc/inittab檔案中。


以下實驗只適合用於測試與實驗環境,生產環境強烈推薦使用Oracle作業系統認證的環境,比如Red Hat6上使用11.2.0.3版本。


執行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.

# ./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.
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 super user privileges
2013-04-03 14:44:34: Parsing the host name
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
/u01/app/11.2.0/grid/bin/acfsdriverstate: line 51: /lib/acfstoolsdriver.sh: No such file or directory
/u01/app/11.2.0/grid/bin/acfsdriverstate: line 51: exec: /lib/acfstoolsdriver.sh: cannot execute: No such file or directory
Successfully deconfigured Oracle Restart stack

# /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 super user privileges
2013-04-03 14:44:34: Parsing the host name
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
/u01/app/11.2.0/grid/bin/acfsdriverstate: line 51: /lib/acfstoolsdriver.sh: No such file or directory
/u01/app/11.2.0/grid/bin/acfsdriverstate: line 51: exec: /lib/acfstoolsdriver.sh: cannot execute: No such file or directory
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;
}
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
    if ($srv eq "ohasd") {


        # Create the autorun file
        my $AUTORUNFILE = catfile ($SCRBASE, $HOST, $HAS_USER, "ohasdrun");
        open (AUTORUN, ">$AUTORUNFILE")
            or die "Can't open $AUTORUNFILE for write: $!";
        print AUTORUN "stopn";
        close (AUTORUN);
        s_set_ownergroup ($HAS_USER, $HAS_GROUP, $AUTORUNFILE)
            or die "Can't change ownership of $AUTORUNFILE: $!";
        s_set_perms ("0644", $AUTORUNFILE)
            or die "Can't change permissions of $AUTORUNFILE: $!";


        # Add OHASD to inittab


        print "Adding daemon to inittabn";
        s_remove_itab ("cssd|evmd|crsd|ohasd") or return $FAILED;
        system ("$INIT q");
        sleep (5);
        s_add_itab () or return $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

# Check to see if the service is OHASD
    if ($srv eq "ohasd") {
 
        # Create the autorun file
        my $AUTORUNFILE = catfile ($SCRBASE, $HOST, $HAS_USER, "ohasdrun");
        open (AUTORUN, ">$AUTORUNFILE")
            or die "Can't open $AUTORUNFILE for write: $!";
        print AUTORUN "stopn";
        close (AUTORUN);
        s_set_ownergroup ($HAS_USER, $HAS_GROUP, $AUTORUNFILE)
            or die "Can't change ownership of $AUTORUNFILE: $!";
        s_set_perms ("0644", $AUTORUNFILE)
            or die "Can't change permissions of $AUTORUNFILE: $!";
 
        # Add OHASD to inittab
 
        print "Adding daemon to inittabn";
        s_remove_itab ("cssd|evmd|crsd|ohasd") or return $FAILED;
        system ("$INIT q");
        sleep (5);
        s_add_itab () or return $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指令碼時出現Adding daemon to inittab的時候,使用root立即執行命令: 
/bin/dd if=/var/tmp/.oracle/npohasd of=/dev/nullbs=1024 count=1
步驟二:
 vi /etc/init/oracle-ohasd.conf


# Oracle OHASD startup


start on runlevel [35]
stop on runlevel [!35]
respawn
exec /etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null

# Oracle OHASD startup
 
start on runlevel [35]
stop on runlevel [!35]
respawn
exec /etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null


如果使用方法1,必須在執行root.sh指令碼之前按照上述方法建立conf,否則執行root.sh也會無法通過。
如果使用方法2:則在執行完畢root.sh指令碼後也必須建立,否則重啟系統後無法自動啟動HAS


驗證:


# ./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: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.
[
[email protected]
grid]#

# ./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: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.
[
[email protected]
grid]#
root.sh指令碼執行成功


按照方法一的實施方法,會net配置錯誤,在安裝完成後還需要手動netca


所以比較推薦方法二


http://www.itpub.net/forum.php?mod=viewthread&tid=1480563

相關推薦

grid軟體執行root.sh指令碼失敗解決辦法

原帖地址:http://www.vydbs.com/failed-executing-root-sh-ohasd-start-the-solution/ 在Red Hat 6.2上安裝Oracle grid 11.2.0.1,執行root.sh指令碼的時候出現一些問題,無法啟動ohasd。 由於Redhat

安裝12.1.0.2 叢集GRID/GI, 執行root.sh 指令碼失敗的案例

在Linux系統上安裝12.1.0.2 叢集GRID/GI軟體,節點2執行root.sh失敗,螢幕的錯誤資訊: OLR initialization - successful 2015/12/15 13:16:55 CLSRSC-507: The root script c

rac安裝過程中安裝grid infrastructure 時 執行root.sh報錯完全刪除grid infrastructure

未能建立磁碟組DATA,返回訊息如下: ORA-15018:diskgroup connot be create ORA-15020:discovered duplicate ASM disk "OCRVDISK3" Configuration of ASM ... fa

【RAC】安裝cluster軟體 在節點2執行root.sh指令碼

安裝cluster軟體  在節點2執行root.sh指令碼 報錯如下: Running vipca(silent) for configuring nodeapps /db/oracle/product/10.2.0/crs/jdk/jre//bin/java: error

在安裝11gr2 RAC的時候執行root.sh出現CRS-2800 CRS-4000 錯誤

環境,VM workstation Pro15 + redhat 6.10 + 11gr2 在安裝rac的時候,節點1執行root.sh正常,節點2執行root.sh的時候出現錯誤 [[email protected] grid]# sh root

Redhat 6.4安裝ORACLE11R2 執行root.sh報錯:“libcap.so.1:cannot open shared object file”

查詢所缺連結檔案的位置:# find / -name libcap* /lib/libcap.so.2 /lib/libcap.so.2.11 /lib64/libcap.so.2 /lib64/libcap.so.2.11 /lib64/libcap.so.1.10 建立連結檔案:# cd /lib64#

關於winserver2012執行c++程式缺少dll的原因而且c++執行時程式安裝失敗解決辦法

windows server 2012 發現有報錯缺少dll的現象原因: 缺少更新包 解決辦法及步驟 第一步,安裝更新包Windows8.1-KB2919442-x64.m

Ubuntu更新源執行update命令仍失敗解決辦法!!

解決步驟: 1.用編輯器開啟resolv.conf vi /etc/resolv.conf 改為如下內容: search localdomain nameserver 8.8.8.8 //希望修改成的DNS nameserver 8.8.6.6 //備用的DNS  

SpringBoot執行時dataSource建立失敗解決辦法

先貼錯誤資訊: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class p

Anaconda安裝完opencv後仍然出現import cv2失敗解決辦法

報錯 在Elipse使用opencv時報錯,在標頭檔案 import cv2 as cv時,出現錯誤 from .cv2 import * ImportError: DLL load failed: 找不到指定的模組。 但是在 解決辦法: ImportError為匯入模組

Mysql匯出的sql在本地資料庫恢復失敗解決辦法

由於在某些空間商買的空間過期了,你無法通過網站後臺進行備份資料庫,想要轉移資料,只能通過MySQL來匯出匯入,但是有時候由於版本不對或者這樣那樣的問題,導致在本地伺服器(或者你重新買的伺服器)匯入資料失敗,我這次的坑就是如此,百度搜了好久才知道有這麼一個軟體,可以搞定這個問題。 1.下載

Grid軟體安裝過程中orainstRoot.shroot.sh指令碼到底做了什麼?

在Linux平臺上,從Oracle 11gR2開始,不論是單例項的庫,還是RAC庫,如果需要用到ASM時,通常都需要單獨安裝Grid Infrastructure軟體。而在Linux平臺上以圖形介面【OUI Oracle Universal Installer】安裝Oracle 11gR2 Grid軟體過程

rac執行root.sh失敗以後查詢問題的方法

Oracle 將rootcrs.pl 配置指令碼執行的所有操作記錄在rootcrs_<hostname>.log 檔案中,並將該檔案儲存在$GRID_HOME/cfgtools/crsconfig 目錄中,在確認導致root.sh故障的操作/命令時,這個是第一個

Oracle:GRIDroot.sh 指令碼

root.sh指令碼主要用於完成對叢集的初始化和很多配置任務 一、內容  $GRID_HOME/install/utl/rootmacro.sh:負責一些和GI_HOME相關的驗證工作  $GRI

kettle-linux環境下部署kettle執行kitchen.sh檔案報錯後安裝 libwebkitgtk提示沒有可用軟體包libwebkitgtk。

執行./kitchen.sh 報錯資訊: [[email protected] data-integration]# ./kitchen.sh ##########################################################

aix7.1安裝12c執行root.sh無法啟動ohasd服務案例

ohasd root.sh install_assist /etc/inittab 一、安裝環境操作系統版本:IBM AIX 7100-03-05-1524ORACLE版本:ORACLE DATABASE 12C 12.1.0.2.0-64BIT RAC 二、安裝報錯該環境安裝的為12c RA

ftp連線Linux伺服器時root使用者登入失敗普通使用者登入成功。

如題,在windows環境下按windows鍵+R鍵喚出執行視窗,輸入FTP敲回車出現win7自帶的FTP工具。 open IP後提示出入使用者名稱:輸入root後敲回車提示不被允許登入。但是普通使用者能登陸成功。   進入vsftp安裝目錄下檢視: cd 

Linux Crontab執行hadoop命令指令碼失敗

   最近在寫一個Hadoop系列操作的排程指令碼,由crontab排程執行。指令碼單獨執行沒有任何問題,但是一旦執行hadoop相關操作,如hive、Hadoop相關命令,就莫名其妙的失敗。查了很多資料,後來才發現是環境變數的問題,需要在指令碼中新增“source /et

【已解決】VMware Linux虛擬機器執行提示“鎖定檔案失敗虛擬機器開啟模組snapshot失敗”的解決辦法

原因:本人因在設定虛擬機器時CD/DVD硬體連線方式將使用iso映像檔案改成了物理驅動連線,導致VMware Linux虛擬機器啟動時提示“鎖定檔案失敗...” 、 (注:期間碰到程序被佔用問題

分散式叢集批量執行命令sh指令碼

#!/bin/bash echo -e command template as follow: "\n sh ~/sh/dist_batch_exec.sh [--background] \"date