Oracle 11g RAC中,發現oc4j以及gsd服務都處於offline狀態,這是Oracle 11g RAC默認情形。即便如此,並不影響數據庫的使用,因為 oc4j 是用於WLM 的一個資源, WLM在 11.2.0.2 才可用。GSD則是用於支持dbca,srvctl,oem等的交互工具。本文描述將這兩個服務切換到online。
- 1、環境
- [root@linux2 ~]# cat /etc/issue
- Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
- Kernel \r on an \m
- [root@linux2 bin]# ./crsctl query crs activeversion
- Oracle Clusterware active version on the cluster is [11.2.0.1.0]
- 2、oc4j與所有的gsd處於offline
- [grid@linux2 ~]$ crs_stat -t | grep OFFLINE
- ora.gsd ora.gsd.type OFFLINE OFFLINE
- ora.linux1.gsd application OFFLINE OFFLINE
- ora.linux2.gsd application OFFLINE OFFLINE
- ora.oc4j ora.oc4j.type OFFLINE OFFLINE
- 3、啟動oc4j服務
- #使用srvctl 來啟動oc4j服務
- [grid@linux2 ~]$ srvctl start oc4j
- OC4J could not be started
- PRCR-1079 : Failed to start resource ora.oc4j
- CRS-2501: Resource 'ora.oc4j' is disabled #提示該服務處於disable狀態
- #嘗試使用crsctl來啟動,依然失敗
- [grid@linux2 ~]$ crsctl start res ora.oc4j -init
- CRS-2613: Could not find resource 'ora.oc4j'.
- CRS-4000: Command Start failed, or completed with errors.
- #下面先將狀態置為enable狀態
- [grid@linux2 ~]$ srvctl enable oc4j
- #再次啟動成功
- [grid@linux2 ~]$ srvctl start oc4j
- [grid@linux2 ~]$ crs_stat -t | grep oc4j
- ora.oc4j ora.oc4j.type ONLINE ONLINE linux2
- 4、啟動gsd服務
- #查看節點linux1上所有的資源狀態,可以看到輸出的信息表明GSD也被disable了
- [grid@linux2 ~]$ srvctl status nodeapps -n linux1
- -n <node_name> option has been deprecated.
- VIP linux1-vip is enabled
- VIP linux1-vip is running on node: linux1
- Network is enabled
- Network is running on node: linux1
- GSD is disabled
- GSD is not running on node: linux1
- ONS is enabled
- ONS daemon is running on node: linux1
- eONS is enabled
- eONS daemon is running on node: linux1
- #下面查看節點linux2上所有的資源狀態,也可以看到輸出的信息表明GSD也被disable了
- [grid@linux2 ~]$ srvctl status nodeapps -n linux2
- -n <node_name> option has been deprecated.
- VIP linux2-vip is enabled
- VIP linux2-vip is running on node: linux2
- Network is enabled
- Network is running on node: linux2
- GSD is disabled
- GSD is not running on node: linux2
- ONS is enabled
- ONS daemon is running on node: linux2
- eONS is enabled
- eONS daemon is running on node: linux2
- #將所有的服務置於enable狀態
- [grid@linux2 ~]$ srvctl enable nodeapps
- PRKO-2415 : VIP is already enabled on node(s): linux1,linux2
- PRKO-2416 : Network resource is already enabled.
- PRKO-2417 : ONS is already enabled on node(s): linux1,linux2
- PRKO-2418 : eONS is already enabled on node(s): linux1,linux2
- #再次查看GSD的狀態已經變成enable了
- [grid@linux2 ~]$ srvctl status nodeapps
- VIP linux1-vip is enabled
- VIP linux1-vip is running on node: linux1
- VIP linux2-vip is enabled
- VIP linux2-vip is running on node: linux2
- Network is enabled
- Network is running on node: linux1
- Network is running on node: linux2
- GSD is enabled
- GSD is not running on node: linux1
- GSD is not running on node: linux2
- ONS is enabled
- ONS daemon is running on node: linux1
- ONS daemon is running on node: linux2
- eONS is enabled
- eONS daemon is running on node: linux1
- eONS daemon is running on node: linux2
- [grid@linux2 ~]$ crs_stat -t | grep OFFLINE
- ora.gsd ora.gsd.type OFFLINE OFFLINE
- ora.linux1.gsd application OFFLINE OFFLINE
- ora.linux2.gsd application OFFLINE OFFLINE
- #啟動GSD服務
- [grid@linux2 ~]$ srvctl start nodeapps
- PRKO-2421 : Network resource is already started on node(s): linux1,linux2
- PRKO-2420 : VIP is already started on node(s): linux1,linux2
- PRKO-2420 : VIP is already started on node(s): linux1,linux2
- PRKO-2422 : ONS is already started on node(s): linux1,linux2
- PRKO-2423 : eONS is already started on node(s): linux1,linux2
- #驗證GSD服務
- [grid@linux2 ~]$ crs_stat -t | grep OFFLINE
- [grid@linux2 ~]$ crs_stat -t | grep gsd
- ora.gsd ora.gsd.type ONLINE ONLINE linux1
- ora.linux1.gsd application ONLINE ONLINE linux1
- ora.linux2.gsd application ONLINE ONLINE linux2
- #Author : Robinson
- #Blog : http://blog.csdn.net/robinson_0612
- 5、關於GSD
- The Global Services Daemon (GSD) runs on each node with one GSD process per node.
- The GSD coordinates with the cluster manager to receive requests from clients such as the DBCA, EM,
- and the SRVCTL utility to execute administrative job tasks such as instance startup or shutdown.
- The GSD is not an Oracle instance background process and is therefore not started with the Oracle instance.
- GSD與rac的管理工具dbca srvctl oem進行交互,用來完成實例的啟動關閉等管理任務。
- 為了保證這些管理工具運行正常必須在所有的節點上先啟動 gsd。
- 一個GSD進程支持在一個節點的多個rac.gsd進程,位於$ORACLE_HOME/bin目錄下。
- 其log文件為$oracle_home /srvm/log/gsdaemon.log。
- 例如:
- 假設使用oem工具來啟動一個實例,oem把該任務傳遞給相應的智能引擎,該智能引擎生成一個包含SRVCTL命令的腳本文件,
- GSD進程讀取該腳本文件並且執行該腳本,最后GSD把執行結果返回給智能引擎,近而智能引擎返回給OEM。
- 又例如假設使用srvctl工具關閉所有的實例,GSD進程接受來自SRVCTL工具發出的請求,並
- 在本地節點上執行該請求,然后把執行結果返回給SRVCTL會話。
- 轉:http://blog.csdn.net/leshami/article/details/8471546