Oracle 11.2.0.4 RAC安裝數據庫軟件無法識別主機

        下午同事發來微信說在裝Oracle 11.2.0.4的RAC時,GI已經正常安裝了。但在安裝數據庫軟件的時候,圖形界面不顯示兩臺主機的主機名,沒辦法繼續往下安裝。由於不在一起,於是百度相應的文章來看,但是相關的文章也不多。找到一篇https://blog.csdn.net/MFW333/article/details/71122990,說是inventory.xml文件中缺少了CRS = TRUE。

        於是轉給同事去檢查,反饋的結果是配置文件中是有這一項配置的:

image.png

        那問題出在哪裏了呢,看來不是百度一下就可以解決的。要來服務器信息,自己登錄上去看。其實一開始我覺得是/etc/hosts或hostname配置有錯誤導致的,但是登錄上去之後發現配置都沒有問題。於是自己執行./runInstaller實際看看,到了Grid Installation Options這一步時確是看不到主機的node name信息。由於匆忙沒有截圖,同學們可以自己腦補一下就可以了。

        心想沒有node name信息,看看日誌有沒有什麼報錯呢。但是很遺憾,沒有日誌。沒有日誌信息,就看不到報錯;沒有報錯,問題就很難排查。那就想,我直接點擊下一步看看會是什麼效果呢,結果出來了我想要的報錯信息:[INS-08109] Unexpected error occurred while validating inputs at state 'nodeSelectionPage'.

image.png

        details里居然寫沒有多餘的信息,讓聯繫support或查詢手冊。support是沒有的,那先去MOS上查查相關文檔吧,還真有跟這個一模一樣的報錯信息的文檔。INS-08109 Unexpected error occurred While Validating Inputs At State 'nodeSelectionPage' (文檔 ID 948382.1)。文檔裏寫了7種原因會導致的這種問題,並給出瞭解決辦法

1. ORA_CRS_HOME environment variable is set

OUI calls $GRID_HOME/srvm/admin/getcrshome to get Grid Infrastructure home, if environment variable ORA_CRS_HOME is set to anything but GRID home, the error will be reported. In 11gR2, it's not supported to setup environment variable ORA_CRS_HOME.

The solution is to unset the environment variable and restart OUI.

unset ORA_CRS_HOME

 

2. Database user can not access olr.loc in /etc/oracle or /var/opt/oracle

OUI calls "crsctl query crs activersion" to get active version of clusterware. If it fails to read olr.loc (if grid and database are owned differently), the issue can happen. From strace/truss:

open("/etc/oracle/olr.loc", O_RDONLY) = -1 EACCES (Permission denied)

The solution is to ensure that 'oracle' user has read permission on olr.loc in /etc/oracle or /var/opt/oracle.

 

3. ORACLE_HOME environment variable not set to GRID_HOME

This problem will occur while installing 11.2.0.4 RAC RDBMS software in a 12c Grid Infrastructure environment.

The solution is to set ORACLE_HOME environment variable pointing to GRID_HOME before installing RDBMS software.

export ORACLE_HOME=<GRID_HOME>

4. Database user does not exist on all nodes

This problem will occur if database user does not exist on all nodes in the cluster. For example, 4-node cluster, trying to install a new RAC DB home on two nodes only so the new DB user is created on two nodes. The solution is to have the same DB user on all nodes.

 

5. NLS_LANG environment variable is set to Japanese_Japan.JA16SJIS etc

If NLS_LANG is set to "Japanese_Japan.JA16SJIS" etc, the issue will happen as output of "crsctl query crs activeversion" garbles.

The solution is to unset NLS_LANG.

 

 6. ORA_NLS10 environment variable is set

environment variable is not necessary for Oracle 11g/12c

 

7. Hostnames  in /etc/hosts are incorrect

This error is generated when trying to add new nodes into the cluster if the entries for the hostnames

in /etc/hosts is incorrect.


        看來看去,好像只有第二條比較符合我們當前遇到的問題,於是去機器看olr.loc的權限情況

image.png

又執行了命令crsctl query crs activeversion,也是可以執行成功的。(這裏其實mos的文章裏寫錯了,activeversion寫成了activersion。)

image.png

再執行olsnode -n,也是可以識別到兩個節點

image.png

集羣也是正常狀態

image.png

        看起來也是有讀權限的。那問題怎麼解決呢?又看了幾篇MOS上的文檔,又百度了一些貼子,感覺一般別人遇到的問題就已經在上面7條裏已經列出來了。但我遇到的問題卻沒有列出來。難道又是BUG?想想應該不可能,這麼點小事就出BUG,那Oracle也不可能一下強大到現在。那問題到底出現在哪裏呢?

        其實這時我陷入到了思維定式裏了,把一些我認爲不可能出問題的地方忽略掉了,恰恰這次出問題的,正是這個地方。

        其實還是權限問題,只不過不只是olr.loc的權限問題,而是整個oracle用戶的權限問題。看了很多文章都說是權限問題,我就想,那我看看oracle用戶配置的uid和所屬組吧,當我執行完id oracle命令看到結果時,瞬間明白了問題的根本原因,就是權限問題。

image.png

        熟悉oracle的同學應該一眼就能看出來,這個oracle用戶配置的所屬組是完全錯的。這也就成了造成此次問題的關鍵。把oracle用戶刪掉重新創建,問題完美解決:

image.png

        寫這篇博客,一個是給大家提供一個解決問題的思路,再一個就是提醒自己,不是“你以爲的就是你以爲的”,還是需要仔細的去驗證分析。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章