在单实例数据库上安装好了Oracle GridInfrastructure 11gR2软件,然后通过grid用户登录执行ASMCA命令后出来Create ASM GUI界面,简单配置后执行create ASM 的过程中报错:Oracle Grid Infrastructure is not configured properly.ASMCA needOracle Grid Infrastructure to configure ASM.详细见如下:
问题处理:
1、 检查has进程是否起来
2、 重新执行/oracle/grid/11.2/crs/install/roothas.pl 起has进程
发现has 进程没有起来,执行 /oracle/grid/11.2/crs/install/roothas.pl ,报以下错误:
[root@yc_wcs_data disks]# /oracle/grid/11.2/crs/install/roothas.pl
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 . /oracle/grid/11.2/crs/install) at /oracle/grid/11.2/crs/install/crsconfig_lib.pm line 703.
BEGIN failed--compilation aborted at /oracle/grid/11.2/crs/install/crsconfig_lib.pm line 703.
Compilation failed in require at /oracle/grid/11.2/crs/install/roothas.pl line 166.
BEGIN failed--compilation aborted at /oracle/grid/11.2/crs/install/roothas.pl line 166.
解决方法:
[root@yc_wcs_data disks]# find / -name Env.pm
/oracle/grid/11.2/perl/lib/5.10.0/Env.pm
[root@yc_wcs_data disks]# cp -p /oracle/grid/11.2/perl/lib/5.10.0/Env.pm /usr/lib64/perl5/vendor_perl
再次执行,报以下错误:
[root@yc_wcs_data disks]# /oracle/grid/11.2/crs/install/roothas.pl
Using configuration parameter file: /oracle/grid/11.2/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
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 yc_wcs_data successfully pinned.
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2019-09-26 14:44:50.794:
[client(11026)]CRS-2101:The OLR was formatted using version 3.
2019-09-26 14:44:51.503:
[client(11092)]CRS-1001:The OCR was formatted using version 3.
ohasd 启动失败,原因如下:
因为RHEL 7使用systemd而不是initd运行进程和重启进程,而root.sh通过传统的initd运行ohasd进程。
解决方法:
在RHEL 7中ohasd需要被设置为一个服务,在运行脚本root.sh之前。
步骤如下:
1. 以root用户创建服务文件
#touch /usr/lib/systemd/system/ohas.service
#chmod 777 /usr/lib/systemd/system/ohas.service
2. 将以下内容添加到新创建的ohas.service文件中
[root@rac1 init.d]# cat /usr/lib/systemd/system/ohas.service
[Unit]
Description=Oracle High Availability Services
After=syslog.target
[Service]
ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple
Restart=always
[Install]
WantedBy=multi-user.target
3. 以root用户运行下面的命令
systemctl daemon-reload
systemctl enable ohas.service
systemctl start ohas.service
查看has 状态:
[root@yc_wcs_data disks]# systemctl status ohas.service
● ohas.service - Oracle High Availability Services
Loaded: loaded (/usr/lib/systemd/system/ohas.service; enabled; vendor preset: disabled)
Active: active (running) since 四 2019-09-26 14:50:37 CST; 20s ago
Main PID: 11626 (init.ohasd)
CGroup: /system.slice/ohas.service
└─11626 /bin/sh /etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple
9月 26 14:50:37 yc_wcs_data systemd[1]: Started Oracle High Availability Services.
9月 26 14:50:37 yc_wcs_data su[11646]: (to grid) root on none
重新配置以下成功:
[root@yc_wcs_data disks]# /oracle/grid/11.2/crs/install/roothas.pl -deconfig
Using configuration parameter file: /oracle/grid/11.2/crs/install/crsconfig_params
CRS-2613: Could not find resource 'ora.cssd'.
CRS-4000: Command Stop failed, or completed with errors.
CRS-2613: Could not find resource 'ora.cssd'.
CRS-4000: Command Delete failed, or completed with errors.
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle Restart stack
[root@yc_wcs_data disks]# /oracle/grid/11.2/crs/install/roothas.pl
Using configuration parameter file: /oracle/grid/11.2/crs/install/crsconfig_params
User ignored Prerequisites during installation
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 yc_wcs_data successfully pinned.
Adding Clusterware entries to inittab
yc_wcs_data 2019/09/26 14:53:36 /oracle/grid/11.2/cdata/yc_wcs_data/backup_20190926_145336.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server