rhel 7安装oracle 11gr2 rac 遇到的问题

 ̄綄美尐妖づ 提交于 2020-02-29 15:41:03

rhel7 安装11g r2 rac的方法跟之前的还是有很大的区别,以至于遇到很多坑,这里汇总下:

1、共享磁盘udev 绑定方式

这个跟rhel7 之前的版本不一样,特别是磁盘uuid命令方式变化了很多,udev启动方式也发生了变化,

 for disk in `ls /dev/sd*`
 do
    echo $disk 
    /usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=$disk
 done

映射文件:

cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c298981418c7e8a25a89d0f836c9", SYMLINK+="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29dce09d16de88f435217838c9e", SYMLINK+="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29c3438303241fd1291834b1bd0", SYMLINK+="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c291dec502efa9d3ae53c99f0028", SYMLINK+="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29e29a4bcd75acea14e982ea49d", SYMLINK+="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"

启动udev:

/sbin/udevadm trigger --type=devices --action=change

udevadm control --reload-rules

2、依赖包缺失

依赖包‘compat-libstdc++’在rhel 7 的ISO 镜像文件中不存在,所以需要自己去下载安装

3、运行 root.sh 脚本错处,启动ohas服务失败:

"Adding Clusterware entries to inittab

ohasd failed to start

Failed to start the Clusterware. Last 20 lines of the alert log follow: 

2015-05-23 23:37:45.460: 

[client(13782)]CRS-2101:The OLR was formatted using version 3."

根本原因是rhel 7 系统服务管理方式发生了变化,由原来的init 变成了  systemctl 来管理,所以这里rac 的集群服务需要使用cyctemctl 来管理,但是11g r2 还是默认使用init来管理,导致系统启动不了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

 

4. 查看运行状态

[root@rac1 init.d]# systemctl status ohas.service

ohas.service - Oracle High Availability Services

   Loaded: loaded (/usr/lib/systemd/system/ohas.service; enabled)

   Active: failed (Result: start-limit) since Fri 2015-09-11 16:07:32 CST; 1s ago

  Process: 5734 ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple (code=exited, status=203/EXEC)

 Main PID: 5734 (code=exited, status=203/EXEC)

 

 

Sep 11 16:07:32 rac1 systemd[1]: Starting Oracle High Availability Services...

Sep 11 16:07:32 rac1 systemd[1]: Started Oracle High Availability Services.

Sep 11 16:07:32 rac1 systemd[1]: ohas.service: main process exited, code=exited, status=203/EXEC

Sep 11 16:07:32 rac1 systemd[1]: Unit ohas.service entered failed state.

Sep 11 16:07:32 rac1 systemd[1]: ohas.service holdoff time over, scheduling restart.

Sep 11 16:07:32 rac1 systemd[1]: Stopping Oracle High Availability Services...

Sep 11 16:07:32 rac1 systemd[1]: Starting Oracle High Availability Services...

Sep 11 16:07:32 rac1 systemd[1]: ohas.service start request repeated too quickly, refusing to start.

Sep 11 16:07:32 rac1 systemd[1]: Failed to start Oracle High Availability Services.

Sep 11 16:07:32 rac1 systemd[1]: Unit ohas.service entered failed state.

 

此时状态为失败,原因是现在还没有/etc/init.d/init.ohasd文件。

 

下面可以运行脚本root.sh 不会再报ohasd failed to start错误了。

 

 

 

如果还是报ohasd failed to start错误,可能是root.sh脚本创建了init.ohasd之后,ohas.service没有马上启动,解决方法参考以下:

 

当运行root.sh时,一直刷新/etc/init.d ,直到出现 init.ohasd 文件,马上手动启动ohas.service服务 命令:systemctl start ohas.service 

 

[root@rac1 init.d]# systemctl status ohas.service

ohas.service - Oracle High Availability Services

   Loaded: loaded (/usr/lib/systemd/system/ohas.service; enabled)

   Active: active (running) since Fri 2015-09-11 16:09:05 CST; 3s ago

 Main PID: 6000 (init.ohasd)

   CGroup: /system.slice/ohas.service

           6000 /bin/sh /etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple

           6026 /bin/sleep 10

 

 

Sep 11 16:09:05 rac1 systemd[1]: Starting Oracle High Availability Services...

Sep 11 16:09:05 rac1 systemd[1]: Started Oracle High Availability Services.

Sep 11 16:09:05 rac1 su[6020]: (to grid) root on none

4、安装db软件报错:

报错标志

安装到86%时出现报错 Error in invoking target ‘agent nmhs’ of makefile 

日志文件:


INFO: make[1]: Leaving directory `/u01/app/oracle/product/11.2.0/db_1/sysman/lib'

INFO: make: *** [emdctl] Error 2

INFO: End output from spawned process.
INFO: ----------------------------------
INFO: Exception thrown from action: make
Exception Name: MakefileException
Exception String: Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk'. See '/u01/app/oraInventory/logs/installActions2019-06-28_0
4-14-49PM.log' for details.
Exception Severity: 1
 

解决办法:

官方解释

Unpublished bug 19692824 
During installation of Oracle Database or Oracle RAC on OL7, the following linking error may be encountered:

Error in invoking target 'agent nmhs' of makefile '<ORACLE_HOME>/sysman/lib/ins_emagent.mk'. See '<installation log>' for details.

If this error is encountered, the user should select Continue. Then, after the installation has completed, the user must download Patch 19692824 from My Oracle Support and apply it per the instructions included in the patch README. 
官方的解释说是先继续安装,然后再打补丁,这个bug19692824是在创建数据库的时候引发的。如果你在安装数据库软件的时候就报错,建议使用下面的解决方法。
推荐解决方法:

在makefile中添加链接libnnz11库的参数 
修改$ORACLE_HOME/sysman/lib/ins_emagent.mk,找到下面这行

$(MK_EMAGENT_NMECTL)
  •  

修改为:

$(MK_EMAGENT_NMECTL) -lnnz11
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!