系统:CentOS7.9
问题描述:单实例安装GI,在执行/u01/app/grid/product/11.2.0/grid/root.sh脚本时,报错ohasd failed to start at /u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl line 377, <ALERTLOG> line 4,如下所示:
[root@leo etc]# /u01/app/grid/product/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/grid/product/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 ...
Creating /etc/oratab file...
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 script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node leo successfully pinned.
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2022-06-01 13:28:58.011:
[client(6481)]CRS-2101:The OLR was formatted using version 3.
2022-06-01 13:28:58.270:
[client(6508)]CRS-1001:The OCR was formatted using version 3.
ohasd failed to start at /u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl line 377, <ALERTLOG> line 4.
/u01/app/grid/product/11.2.0/grid/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid/perl/lib -I/u01/app/grid/product/11.2.0/grid/crs/install /u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl execution failed
解决方案:
先执行/u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl -deconfig -force -verbose命令,回退root.sh脚本
[root@leo etc]# /u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl -deconfig -force -verbose
Can't locate Env.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /u01/app/grid/product/11.2.0/grid/crs/install) at /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_lib.pm line 703.
BEGIN failed--compilation aborted at /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_lib.pm line 703.
Compilation failed in require at /u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl line 166.
BEGIN failed--compilation aborted at /u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl line 166.
如上,回退root.sh脚本时,报错Can't locate Env.pm in @INC (@INC contains,该报错是由bug 18650453导致的,
解决方案两个:
a、补丁程序18650453: OL7: CLUSTERWARE ROOT SCRIPTS FAIL DUE TO: CAN'T LOCATE ENV.PM IN @INC
b、使用gi中绝对路径perl,清空ocr配置和voting disk
此处采用方案b.
[root@leo ~]# /u01/app/grid/product/11.2.0/grid/perl/bin/perl /u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl -deconfig -force
Using configuration parameter file: /u01/app/grid/product/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.
Successfully deconfigured Oracle Restart stack
回到最初问题,当执行root.sh脚本出现“Adding Clusterware entries to inittab”字样时,需在另一个session,root用户执行dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1命令
实际操作过程如下:
[root@leo ~]# /u01/app/grid/product/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/grid/product/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
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 script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node leo successfully pinned.
Adding Clusterware entries to inittab (说明:出现该提示后,立即在另一个session用root用户执行dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1命令)
leo 2022/06/01 13:57:50 /u01/app/grid/product/11.2.0/grid/cdata/leo/backup_20220601_135750.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@leo ~]# dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1
如上所示,root.sh成功执行.
参考网址:
http://blog.itpub.net/26736162/viewspace-2692826/
https://blog.csdn.net/Evils798/article/details/88760579