最近我们因项目需求,需要在redhat linux7.2上安装部署Oracle11.2.0.4版本的grid。由于linux在版本7之后,体系结构都发生了变化,而Oracle 11.2的产品文档中也没有描述对linux7之后版本的支持情况,因此在部署中,执行root.sh脚本启动时遭遇ohasd进程失败的问题,经研究后解决该故障成功完成了项目实施。现将解决方法分享给大家。
操作系统版本:Redhat enterprise linux7.2
数据库版本:Oracle database 11.2.0.4g
一、故障描述
grid安装到执行root.sh脚本时,需要root用户登录到console命令执行提示窗口脚本。当在执行/u01/app/11.2.0/grid/root.sh时,执行过程中出现如下信息:
[client(74694)]CRS-2101:The OLR was formatted using version 3.
执行界面如下:
[root@cd01 ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@cd01 ~]# /u01/app/product/11.2/db/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/product/11.2/db
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/product/11.2/db/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
root wallet
root wallet cert
root cert export
peer wallet
profile reader wallet
pa wallet
peer wallet keys
pa wallet keys
peer cert request
pa cert request
peer cert
pa cert
peer root cert TP
profile reader root cert TP
pa root cert TP
peer pa cert TP
pa peer cert TP
profile reader pa cert TP
profile reader peer cert TP
peer user cert
pa user cert
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2017-12-13 23:21:13.424:
[client(87014)]CRS-2101:The OLR was formatted using version 3.
2017-12-13 23:27:44.388:
[client(88516)]CRS-2101:The OLR was formatted using version 3.
2017-12-13 23:39:10.344:
[ohasd(89949)]CRS-0715:Oracle High Availability Service has timed outwaiting for init.ohasd to be started.
二、故障分析
Oracle 11.g版本支持的linux内核仍遵循2.6 Sysvinit方式管理进程,但实际上从内核3.0之后就发生了新的变化,开始采用systemd方式来替代sysvinit的管理方式,这样就造成了grid在执行root.sh脚本后执行/etc/init.d/init.ohasd run>/dev/null 2>&1
三、操作步骤
1、以root用户创建服务文件
#touch/usr/lib/systemd/system/ohas.service
#chmod777 /usr/lib/systemd/system/ohas.service
2、将以下内容添加到新创建的ohas.service文件中
[root@cd01init.d]# cat /usr/lib/systemd/system/ohas.service
[Unit]
Description=OracleHigh Availability Services
After=syslog.target
[Service]
ExecStart=/etc/init.d/init.ohasdrun >/dev/null 2>&1
Restart=always
[Install]
WantedBy=multi-user.target
3、重新加载服务
#systemctldaemon-reload
#systemctlenable ohas.service
4、重新执行root.sh脚本文件
重新开一个命令行窗口,观察等待生成/etc/init.d/init.ohasd文件,生成后执行systemctlstart ohas.service:
窗口二:cd01#while :; ls -al/etc/init.d/init.ohasd; done;
窗口一:直接运行root.sh脚本
Installing Trace File Analyzer
OLR initialization - successful
root wallet
root wallet cert
root cert export
peer wallet
profile reader wallet
pa wallet
peer wallet keys
pa wallet keys
peer cert request
pa cert request
peer cert
pa cert
peer root cert TP
profile reader root cert TP
pa root cert TP
peer pa cert TP
pa peer cert TP
profile reader pa cert TP
profile reader peer cert TP
peer user cert
pa usercert--
当执行到此,创建init.ohasd进程,只要看到ohasd检查创建,就启动systemctl start ohas.service
Adding Clusterware entries toinittab
当执行启动ohasd.service之后,root.sh执行就ok了,然后在其他节点进行相同的步骤进行root.sh脚本的执行。
如欲了解更多,请登录十大靠谱网赌软件官方网站:lgoh.hzpshiyong.com