rhel 7安裝oracle 11gr2 rac 遇到的問題

rhel7 安裝11g r2 rac的方法跟以前的仍是有很大的區別,以致於遇到不少坑,這裏彙總下:c++

一、共享磁盤udev 綁定方式

這個跟rhel7 以前的版本不同,特別是磁盤uuid命令方式變化了不少,udev啓動方式也發生了變化,數據庫

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

映射文件:oracle

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"app

啓動udev:ui

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

udevadm control --reload-rulesspa

二、依賴包缺失

依賴包‘compat-libstdc++’在rhel 7 的ISO 鏡像文件中不存在,因此須要本身去下載安裝rest

三、運行 root.sh 腳本錯處,啓動ohas服務失敗:

"Adding Clusterware entries to inittab日誌

ohasd failed to startcode

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

四、安裝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
相關文章
相關標籤/搜索