天天看點

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。

        于是轉給同僚去檢查,回報的結果是配置檔案中是有這一項配置的:

Oracle 11.2.0.4 RAC安裝資料庫軟體無法識别主機

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

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

Oracle 11.2.0.4 RAC安裝資料庫軟體無法識别主機
        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的權限情況

Oracle 11.2.0.4 RAC安裝資料庫軟體無法識别主機

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

Oracle 11.2.0.4 RAC安裝資料庫軟體無法識别主機

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

Oracle 11.2.0.4 RAC安裝資料庫軟體無法識别主機

叢集也是正常狀态

Oracle 11.2.0.4 RAC安裝資料庫軟體無法識别主機

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

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

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

Oracle 11.2.0.4 RAC安裝資料庫軟體無法識别主機

繼續閱讀