【Oracle】Oracle 11.2.0.4版本Grid無法隨機啟動

dmcatding發表於2016-12-05

系統環境:Linux Server release 7.3

資料庫環境:11.2.0.4.0

參考 MOS 文件:

Install of Clusterware fails while running root.sh on OL7 - ohasd fails to start (文件 ID 1959008.1)

redhat 7.2 安裝oracle 11204 rac的grid執行root.sh報錯:ohasd failed to start

[root@b2i-order-db1 ~]# /app/grid/app/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /app/grid/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file:  /app/grid/app/11.2.0/grid/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
  root wallet
  root wallet cert
  root cert export
  peer wallet
  profile reader wallet
  pa wallet
  peer wallet keys
  pa wallet keys
  peer cert request
  pa cert request
  peer cert
  pa cert
  peer root cert TP
  profile reader root cert TP
  pa root cert TP
  peer pa cert TP
  pa peer cert TP
  profile reader pa cert TP
  profile reader peer cert TP
  peer user cert
  pa user cert
Adding Clusterware entries to inittab
ohasd failed to start


報錯原因:
因為RHEL 7使用systemd而不是initd執行程式和重啟程式,而root.sh透過傳統的initd執行ohasd程式。


解決:
在RHEL 7中ohasd需要被設定為一個服務,在執行指令碼root.sh之前。


步驟:
1. 使用root使用者
 
[root@Oraclelinux ~]# cd /etc/systemd/system/
[root@Oraclelinux system]# touch ohasd.service
--此處oracle MOS 文件描述錯誤,應修改為 touch ohas.service
 

 
2. 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使用者執行以下命令:
 
[root@Oraclelinux ~]# systemctl daemon-reload
[root@Oraclelinux ~]# systemctl enable ohas.service
[root@Oraclelinux ~]# systemctl start ohas.service

4. 檢視執行狀態
[root@b2i-order-db1 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) sincesince Tue 2017-01-03 18:00:27 CST;2s 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)
狀態為failed ,此時狀態為失敗,原因是現在還沒有/etc/init.d/init.ohasd檔案。


5、執行root.sh 指令碼後狀態
● ohas.service - Oracle High Availability Services
   Loaded: loaded (/usr/lib/systemd/system/ohas.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2017-01-03 18:00:27 CST;10s ago
 Main PID: 79660 (init.ohasd)
   CGroup: /system.slice/ohas.service
           └─79660 /bin/sh /etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple


Jan 03 18:00:27 b2i-order-db1 systemd[1]: Started Oracle High Availability Services.
Jan 03 18:00:27 b2i-order-db1 systemd[1]: Starting Oracle High Availability Services...


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30327022/viewspace-2129753/,如需轉載,請註明出處,否則將追究法律責任。

相關文章