常用crs命令集
常用的crs命令如下:
$ORA_CRS_HOME/bin/crs_stat –t
此命令主要用來檢查crs資源狀態
例 如
[oracle@rac2 css]$ $ORA_CRS_HOME/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE ONLINE rac1
ora....CL2.srv application ONLINE ONLINE rac2
ora....TEST.cs application ONLINE ONLINE rac1
ora....L1.inst application ONLINE ONLINE rac1
ora....L2.inst application ONLINE ONLINE rac2
ora.ORCL.db application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
[oracle@rac2 css]$
$ORA_CRS_HOME/bin/crs_start –all
此命令用來啟動所有的叢集服務,但是啟動的前提是 資源狀態State不能是UNKNOWN。
$ORA_CRS_HOME/bin/crs_start 叢集服務名(叢集服務名可以透過$ORA_CRS_HOME/bin/crs_stat得到)
$ORA_CRS_HOME/bin/crs_stop -all
$ORA_CRS_HOME/bin/crs_stop 叢集服務名(叢集服務名可以透過$ORA_CRS_HOME/bin/crs_stat得到)
上面的一組crs命令是用來啟動關閉crs服務的, 下面透過一個真實的環境,具體講解這些命令的使用。
舉例如下:
Oracle RAC在安裝完畢後,重啟RAC,一些服務不能啟動,手動啟動也沒用。
下面是系統自動啟動以後的情況;
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE UNKNOWN rac1
ora....CL2.srv application ONLINE UNKNOWN rac2
ora....TEST.cs application ONLINE UNKNOWN rac2
ora....L1.inst application ONLINE OFFLINE
ora....L2.inst application ONLINE OFFLINE
ora.ORCL.db application ONLINE UNKNOWN rac1
ora....SM1.asm application ONLINE UNKNOWN rac1
ora....C1.lsnr application ONLINE UNKNOWN rac1
ora.rac1.gsd application ONLINE UNKNOWN rac1
ora.rac1.ons application ONLINE UNKNOWN rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE UNKNOWN rac2
ora....C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE UNKNOWN rac2
ora.rac2.ons application ONLINE UNKNOWN rac2
ora.rac2.vip application ONLINE ONLINE rac2
[oracle@rac1 ~]$
可以看到,只有vip是能自動啟 動的!其它資源都處於UNKNOWN狀態下。
手工用srvctl啟動試試!
$ srvctl start nodeapps -n rac1
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.gsd' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.vip' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.ons' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.LISTENER_RAC1.lsnr' has placement error.
測試crs:
$crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[oracle@rac1 bin]$ crsctl start resources
Starting resources.
Successfully started CRS resources
[oracle@rac1 bin]$ pwd
/oracle/app/oracle/oracle/product/10.2.0/crs/bin
[oracle@rac1 bin]$ gsdctl stop
[oracle@rac1 bin]$ gsdctl status
[oracle@rac1 bin]$ ./gsdctl status
[oracle@rac1 bin]$ gsdctl start
[oracle@rac1 bin]$ srvctl start nodeapps -n rac1
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.gsd' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.vip' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.ons' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.LISTENER_RAC1.lsnr' has placement error.
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE UNKNOWN rac1
ora....CL2.srv application ONLINE UNKNOWN rac2
ora....TEST.cs application ONLINE UNKNOWN rac2
ora....L1.inst application ONLINE OFFLINE
ora....L2.inst application ONLINE OFFLINE
ora.ORCL.db application ONLINE UNKNOWN rac1
ora....SM1.asm application ONLINE UNKNOWN rac1
ora....C1.lsnr application ONLINE UNKNOWN rac1
ora.rac1.gsd application ONLINE UNKNOWN rac1
ora.rac1.ons application ONLINE UNKNOWN rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE UNKNOWN rac2
ora....C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE UNKNOWN rac2
ora.rac2.ons application ONLINE UNKNOWN rac2
ora.rac2.vip application ONLINE ONLINE rac2
可以看到,仍然是啟動後的原始狀態。
從上面的顯示可以知道,每個資源 的State顯示為UNKNOWN,應該是由於兩個節點時間不同步,進而造成crs在啟動的時候無法認到系統已經註冊的資源造成的。
解決方法:
首 先,保證兩個節點時間保持同步,ORACLE 10g RAC兩個節點之間有10幾秒的時間誤差,不會對應用造成影響。但是過分大的時間誤差可能導致某個節點down機,或者節點不斷重啟。
然後執行如 下操作:
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop –all
Attempting to stop `ora.rac1.vip` on member `rac1`
Attempting to stop `ora.rac2.vip` on member `rac2`
Stop of `ora.rac2.vip` on member `rac2` succeeded.
Stop of `ora.rac1.vip` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE UNKNOWN rac1
ora....CL2.srv application ONLINE UNKNOWN rac2
ora....TEST.cs application ONLINE UNKNOWN rac2
ora....L1.inst application OFFLINE OFFLINE
ora....L2.inst application OFFLINE OFFLINE
ora.ORCL.db application OFFLINE UNKNOWN rac1
ora....SM1.asm application OFFLINE UNKNOWN rac1
ora....C1.lsnr application OFFLINE UNKNOWN rac1
ora.rac1.gsd application ONLINE UNKNOWN rac1
ora.rac1.ons application ONLINE UNKNOWN rac1
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE UNKNOWN rac2
ora....C2.lsnr application OFFLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE UNKNOWN rac2
ora.rac2.ons application ONLINE UNKNOWN rac2
ora.rac2.vip application OFFLINE OFFLINE
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stat (此命令可以檢視各個資源的完整服務名稱)
NAME=ora.ORCL.ORATEST.ORCL1.srv
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.ORCL.ORATEST.ORCL2.srv
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.ORCL.ORATEST.cs
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac2
NAME=ora.ORCL.ORCL1.inst
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.ORCL.ORCL2.inst
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.ORCL.db
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.rac1.ASM1.asm
TYPE=application
TARGET=OFFLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.LISTENER_RAC1.lsnr
TYPE=application
TARGET=OFFLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.gsd
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.ons
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.vip
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac2.ASM2.asm
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.rac2.LISTENER_RAC2.lsnr
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.rac2.gsd
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac2
NAME=ora.rac2.ons
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac2
NAME=ora.rac2.vip
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
$ORA_CRS_HOME/bin/crs_stop –all只能停掉State為ONLINE的服務,狀態為UNKNOWN的資源不能透過這個命令關閉,因此可以通 過$ORA_CRS_HOME/bin/crs_stop 服務名 的方式單獨停止那些狀態為UNKNOWN的資源。
下面是通 過$ORA_CRS_HOME/bin/crs_stop命令依次停止資源狀態State為UNKNOWN的服務。
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.ORCL.ORATEST.cs
Attempting to stop `ora.ORCL.ORATEST.cs` on member `rac2`
Stop of `ora.ORCL.ORATEST.cs` on member `rac2` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.ASM1.asm
Attempting to stop `ora.rac1.ASM1.asm` on member `rac1`
Stop of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.LISTENER_RAC1.lsnr
Attempting to stop `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1`
Stop of `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.ons
Attempting to stop `ora.rac1.ons` on member `rac1`
Stop of `ora.rac1.ons` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.vip
Attempting to stop `ora.rac1.vip` on member `rac1`
Stop of `ora.rac1.vip` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac2.gsd
Attempting to stop `ora.rac2.gsd` on member `rac2`
Stop of `ora.rac2.gsd` on member `rac2` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac2.ons
Attempting to stop `ora.rac2.ons` on member `rac2`
Stop of `ora.rac2.ons` on member `rac2` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.gsd
Attempting to stop `ora.rac1.gsd` on member `rac1`
Stop of `ora.rac1.gsd` on member `rac1` succeeded.
………….
把所有狀態為UNKNOWN的資源全部停止以後,再次檢視資源狀態:
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application OFFLINE OFFLINE
ora....CL2.srv application OFFLINE OFFLINE
ora....TEST.cs application OFFLINE OFFLINE
ora....L1.inst application OFFLINE OFFLINE
ora....L2.inst application OFFLINE OFFLINE
ora.ORCL.db application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
此時可以重啟所有crs資源了
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_start –all(注意,這裡是在oracle使用者下操作)
Attempting to start `ora.rac1.vip` on member `rac1`
Attempting to start `ora.rac2.vip` on member `rac2`
Start of `ora.rac2.vip` on member `rac2` succeeded.
Attempting to start `ora.rac2.ASM2.asm` on member `rac2`
Start of `ora.rac1.vip` on member `rac1` succeeded.
Attempting to start `ora.rac1.ASM1.asm` on member `rac1`
Start of `ora.rac2.ASM2.asm` on member `rac2` succeeded.
Attempting to start `ora.ORCL.ORCL2.inst` on member `rac2`
Start of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
Attempting to start `ora.ORCL.ORCL1.inst` on member `rac1`
Start of `ora.ORCL.ORCL2.inst` on member `rac2` succeeded.
Attempting to start `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
Start of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
Start of `ora.ORCL.ORCL1.inst` on member `rac1` succeeded.
Attempting to start `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1`
Start of `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1` succeeded.
Attempting to start `ora.ORCL.ORATEST.ORCL1.srv` on member `rac1`
CRS-1002: Resource 'ora.rac1.ons' is already running on member 'rac1'
CRS-1002: Resource 'ora.ORCL.db' is already running on member 'rac1'
CRS-1002: Resource 'ora.rac2.ons' is already running on member 'rac2'
Attempting to start `ora.ORCL.ORATEST.ORCL2.srv` on member `rac2`
Attempting to start `ora.ORCL.ORATEST.cs` on member `rac2`
Attempting to start `ora.rac1.gsd` on member `rac1`
Attempting to start `ora.rac2.gsd` on member `rac2`
Start of `ora.ORCL.ORATEST.cs` on member `rac2` succeeded.
Start of `ora.rac2.gsd` on member `rac2` succeeded.
Start of `ora.ORCL.ORATEST.ORCL2.srv` on member `rac2` succeeded.
Start of `ora.rac1.gsd` on member `rac1` succeeded.
Start of `ora.ORCL.ORATEST.ORCL1.srv` on member `rac1` succeeded.
CRS-0223: Resource 'ora.ORCL.db' has placement error.
CRS-0223: Resource 'ora.rac1.ons' has placement error.
CRS-0223: Resource 'ora.rac2.ons' has placement error.
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE ONLINE rac1
ora....CL2.srv application ONLINE ONLINE rac2
ora....TEST.cs application ONLINE ONLINE rac2
ora....L1.inst application ONLINE ONLINE rac1
ora....L2.inst application ONLINE ONLINE rac2
ora.ORCL.db application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
此時,看到crs所有資源全部啟動,問題解決。
其它一些常用命令:
$ORA_CRS_HOME/bin/crsctl check crs 用於檢查後臺程式狀態
$ORA_CRS_HOME/bin/crsctl start resources 啟動crs資源
$ORA_CRS_HOME/bin/crsctl start crs 啟動crs,需要超級使用者操作。
$ORA_CRS_HOME/bin/crsctl stop crs 關閉crs,需要超級使用者操作。
$ORA_CRS_HOME/bin/crs_unregister 取消註冊crs
$ORA_CRS_HOME/bin/ocrcheck 檢查ocr設定資訊用ocrcheck
$ORA_CRS_HOME/bin/crsctl query css votedisk 檢查表決磁碟資訊
舉例:
[oracle@rac2 css]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104344
Used space (kbytes) : 4568
Available space (kbytes) : 99776
ID : 328160432
Device/File Name : /dev/raw/raw4
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw5
Device/File integrity check succeeded
Cluster registry integrity check succeeded
[oracle@rac2 css]$ $ORA_CRS_HOME/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104344
Used space (kbytes) : 4568
Available space (kbytes) : 99776
ID : 328160432
Device/File Name : /dev/raw/raw4
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw5
Device/File integrity check succeeded
Cluster registry integrity check succeeded
[oracle@rac2 css]$ crsctl query css votedisk
0. 0 /dev/raw/raw6
1. 0 /dev/raw/raw7
2. 0 /dev/raw/raw8
located 3 votedisk(s).
注意:
執 行crsctl命令的可以是root使用者,也可以是oracle使用者,如果是root使用者要指定絕對路徑,但是對於crsctl start crs和crsctl stop crs必須是root使用者來執行。
crs主要程式
(1)crsd
負 責管理ha操作
管理crs資源,如linstener,vip,ons,gsn等
由root使用者管理、啟動
(2)ocssd
管 理各節點的關係,用於節點間通訊
由oracle使用者執行管理
(3)oprocd
叢集程式管理 —Process monitor for the cluster.
僅在沒有使用vendor的叢集軟體狀態下執行
(4)evmd
事 件檢測程式,由oracle使用者執行管理
(5)主要log位置
$ORA_CRS_HOME/log/節點主機名/racg
$ORA_CRS_HOME/log /節點主機名/crsd
$ORA_CRS_HOME/crs/init
$ORA_CRS_HOME/css/log
$ORA_CRS_HOME/css/init
$ORA_CRS_HOME/evm/log
$ORA_CRS_HOME/evm/init
$ORA_CRS_HOME/srvm/log
come from:http://gaoshan.blog.違規廣告.com/742525/290871
$ORA_CRS_HOME/bin/crs_stat –t
此命令主要用來檢查crs資源狀態
例 如
[oracle@rac2 css]$ $ORA_CRS_HOME/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE ONLINE rac1
ora....CL2.srv application ONLINE ONLINE rac2
ora....TEST.cs application ONLINE ONLINE rac1
ora....L1.inst application ONLINE ONLINE rac1
ora....L2.inst application ONLINE ONLINE rac2
ora.ORCL.db application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
[oracle@rac2 css]$
$ORA_CRS_HOME/bin/crs_start –all
此命令用來啟動所有的叢集服務,但是啟動的前提是 資源狀態State不能是UNKNOWN。
$ORA_CRS_HOME/bin/crs_start 叢集服務名(叢集服務名可以透過$ORA_CRS_HOME/bin/crs_stat得到)
$ORA_CRS_HOME/bin/crs_stop -all
$ORA_CRS_HOME/bin/crs_stop 叢集服務名(叢集服務名可以透過$ORA_CRS_HOME/bin/crs_stat得到)
上面的一組crs命令是用來啟動關閉crs服務的, 下面透過一個真實的環境,具體講解這些命令的使用。
舉例如下:
Oracle RAC在安裝完畢後,重啟RAC,一些服務不能啟動,手動啟動也沒用。
下面是系統自動啟動以後的情況;
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE UNKNOWN rac1
ora....CL2.srv application ONLINE UNKNOWN rac2
ora....TEST.cs application ONLINE UNKNOWN rac2
ora....L1.inst application ONLINE OFFLINE
ora....L2.inst application ONLINE OFFLINE
ora.ORCL.db application ONLINE UNKNOWN rac1
ora....SM1.asm application ONLINE UNKNOWN rac1
ora....C1.lsnr application ONLINE UNKNOWN rac1
ora.rac1.gsd application ONLINE UNKNOWN rac1
ora.rac1.ons application ONLINE UNKNOWN rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE UNKNOWN rac2
ora....C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE UNKNOWN rac2
ora.rac2.ons application ONLINE UNKNOWN rac2
ora.rac2.vip application ONLINE ONLINE rac2
[oracle@rac1 ~]$
可以看到,只有vip是能自動啟 動的!其它資源都處於UNKNOWN狀態下。
手工用srvctl啟動試試!
$ srvctl start nodeapps -n rac1
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.gsd' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.vip' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.ons' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.LISTENER_RAC1.lsnr' has placement error.
測試crs:
$crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[oracle@rac1 bin]$ crsctl start resources
Starting resources.
Successfully started CRS resources
[oracle@rac1 bin]$ pwd
/oracle/app/oracle/oracle/product/10.2.0/crs/bin
[oracle@rac1 bin]$ gsdctl stop
[oracle@rac1 bin]$ gsdctl status
[oracle@rac1 bin]$ ./gsdctl status
[oracle@rac1 bin]$ gsdctl start
[oracle@rac1 bin]$ srvctl start nodeapps -n rac1
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.gsd' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.vip' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.ons' has placement error.
CRS-1028: Dependency analysis failed because of:
CRS-0223: Resource 'ora.rac1.LISTENER_RAC1.lsnr' has placement error.
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE UNKNOWN rac1
ora....CL2.srv application ONLINE UNKNOWN rac2
ora....TEST.cs application ONLINE UNKNOWN rac2
ora....L1.inst application ONLINE OFFLINE
ora....L2.inst application ONLINE OFFLINE
ora.ORCL.db application ONLINE UNKNOWN rac1
ora....SM1.asm application ONLINE UNKNOWN rac1
ora....C1.lsnr application ONLINE UNKNOWN rac1
ora.rac1.gsd application ONLINE UNKNOWN rac1
ora.rac1.ons application ONLINE UNKNOWN rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE UNKNOWN rac2
ora....C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE UNKNOWN rac2
ora.rac2.ons application ONLINE UNKNOWN rac2
ora.rac2.vip application ONLINE ONLINE rac2
可以看到,仍然是啟動後的原始狀態。
從上面的顯示可以知道,每個資源 的State顯示為UNKNOWN,應該是由於兩個節點時間不同步,進而造成crs在啟動的時候無法認到系統已經註冊的資源造成的。
解決方法:
首 先,保證兩個節點時間保持同步,ORACLE 10g RAC兩個節點之間有10幾秒的時間誤差,不會對應用造成影響。但是過分大的時間誤差可能導致某個節點down機,或者節點不斷重啟。
然後執行如 下操作:
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop –all
Attempting to stop `ora.rac1.vip` on member `rac1`
Attempting to stop `ora.rac2.vip` on member `rac2`
Stop of `ora.rac2.vip` on member `rac2` succeeded.
Stop of `ora.rac1.vip` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE UNKNOWN rac1
ora....CL2.srv application ONLINE UNKNOWN rac2
ora....TEST.cs application ONLINE UNKNOWN rac2
ora....L1.inst application OFFLINE OFFLINE
ora....L2.inst application OFFLINE OFFLINE
ora.ORCL.db application OFFLINE UNKNOWN rac1
ora....SM1.asm application OFFLINE UNKNOWN rac1
ora....C1.lsnr application OFFLINE UNKNOWN rac1
ora.rac1.gsd application ONLINE UNKNOWN rac1
ora.rac1.ons application ONLINE UNKNOWN rac1
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE UNKNOWN rac2
ora....C2.lsnr application OFFLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE UNKNOWN rac2
ora.rac2.ons application ONLINE UNKNOWN rac2
ora.rac2.vip application OFFLINE OFFLINE
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stat (此命令可以檢視各個資源的完整服務名稱)
NAME=ora.ORCL.ORATEST.ORCL1.srv
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.ORCL.ORATEST.ORCL2.srv
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.ORCL.ORATEST.cs
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac2
NAME=ora.ORCL.ORCL1.inst
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.ORCL.ORCL2.inst
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.ORCL.db
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.rac1.ASM1.asm
TYPE=application
TARGET=OFFLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.LISTENER_RAC1.lsnr
TYPE=application
TARGET=OFFLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.gsd
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.ons
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.vip
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac2.ASM2.asm
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.rac2.LISTENER_RAC2.lsnr
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.rac2.gsd
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac2
NAME=ora.rac2.ons
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac2
NAME=ora.rac2.vip
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
$ORA_CRS_HOME/bin/crs_stop –all只能停掉State為ONLINE的服務,狀態為UNKNOWN的資源不能透過這個命令關閉,因此可以通 過$ORA_CRS_HOME/bin/crs_stop 服務名 的方式單獨停止那些狀態為UNKNOWN的資源。
下面是通 過$ORA_CRS_HOME/bin/crs_stop命令依次停止資源狀態State為UNKNOWN的服務。
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.ORCL.ORATEST.cs
Attempting to stop `ora.ORCL.ORATEST.cs` on member `rac2`
Stop of `ora.ORCL.ORATEST.cs` on member `rac2` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.ASM1.asm
Attempting to stop `ora.rac1.ASM1.asm` on member `rac1`
Stop of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.LISTENER_RAC1.lsnr
Attempting to stop `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1`
Stop of `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.ons
Attempting to stop `ora.rac1.ons` on member `rac1`
Stop of `ora.rac1.ons` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.vip
Attempting to stop `ora.rac1.vip` on member `rac1`
Stop of `ora.rac1.vip` on member `rac1` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac2.gsd
Attempting to stop `ora.rac2.gsd` on member `rac2`
Stop of `ora.rac2.gsd` on member `rac2` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac2.ons
Attempting to stop `ora.rac2.ons` on member `rac2`
Stop of `ora.rac2.ons` on member `rac2` succeeded.
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stop ora.rac1.gsd
Attempting to stop `ora.rac1.gsd` on member `rac1`
Stop of `ora.rac1.gsd` on member `rac1` succeeded.
………….
把所有狀態為UNKNOWN的資源全部停止以後,再次檢視資源狀態:
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application OFFLINE OFFLINE
ora....CL2.srv application OFFLINE OFFLINE
ora....TEST.cs application OFFLINE OFFLINE
ora....L1.inst application OFFLINE OFFLINE
ora....L2.inst application OFFLINE OFFLINE
ora.ORCL.db application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
此時可以重啟所有crs資源了
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_start –all(注意,這裡是在oracle使用者下操作)
Attempting to start `ora.rac1.vip` on member `rac1`
Attempting to start `ora.rac2.vip` on member `rac2`
Start of `ora.rac2.vip` on member `rac2` succeeded.
Attempting to start `ora.rac2.ASM2.asm` on member `rac2`
Start of `ora.rac1.vip` on member `rac1` succeeded.
Attempting to start `ora.rac1.ASM1.asm` on member `rac1`
Start of `ora.rac2.ASM2.asm` on member `rac2` succeeded.
Attempting to start `ora.ORCL.ORCL2.inst` on member `rac2`
Start of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
Attempting to start `ora.ORCL.ORCL1.inst` on member `rac1`
Start of `ora.ORCL.ORCL2.inst` on member `rac2` succeeded.
Attempting to start `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
Start of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
Start of `ora.ORCL.ORCL1.inst` on member `rac1` succeeded.
Attempting to start `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1`
Start of `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1` succeeded.
Attempting to start `ora.ORCL.ORATEST.ORCL1.srv` on member `rac1`
CRS-1002: Resource 'ora.rac1.ons' is already running on member 'rac1'
CRS-1002: Resource 'ora.ORCL.db' is already running on member 'rac1'
CRS-1002: Resource 'ora.rac2.ons' is already running on member 'rac2'
Attempting to start `ora.ORCL.ORATEST.ORCL2.srv` on member `rac2`
Attempting to start `ora.ORCL.ORATEST.cs` on member `rac2`
Attempting to start `ora.rac1.gsd` on member `rac1`
Attempting to start `ora.rac2.gsd` on member `rac2`
Start of `ora.ORCL.ORATEST.cs` on member `rac2` succeeded.
Start of `ora.rac2.gsd` on member `rac2` succeeded.
Start of `ora.ORCL.ORATEST.ORCL2.srv` on member `rac2` succeeded.
Start of `ora.rac1.gsd` on member `rac1` succeeded.
Start of `ora.ORCL.ORATEST.ORCL1.srv` on member `rac1` succeeded.
CRS-0223: Resource 'ora.ORCL.db' has placement error.
CRS-0223: Resource 'ora.rac1.ons' has placement error.
CRS-0223: Resource 'ora.rac2.ons' has placement error.
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....CL1.srv application ONLINE ONLINE rac1
ora....CL2.srv application ONLINE ONLINE rac2
ora....TEST.cs application ONLINE ONLINE rac2
ora....L1.inst application ONLINE ONLINE rac1
ora....L2.inst application ONLINE ONLINE rac2
ora.ORCL.db application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
此時,看到crs所有資源全部啟動,問題解決。
其它一些常用命令:
$ORA_CRS_HOME/bin/crsctl check crs 用於檢查後臺程式狀態
$ORA_CRS_HOME/bin/crsctl start resources 啟動crs資源
$ORA_CRS_HOME/bin/crsctl start crs 啟動crs,需要超級使用者操作。
$ORA_CRS_HOME/bin/crsctl stop crs 關閉crs,需要超級使用者操作。
$ORA_CRS_HOME/bin/crs_unregister 取消註冊crs
$ORA_CRS_HOME/bin/ocrcheck 檢查ocr設定資訊用ocrcheck
$ORA_CRS_HOME/bin/crsctl query css votedisk 檢查表決磁碟資訊
舉例:
[oracle@rac2 css]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104344
Used space (kbytes) : 4568
Available space (kbytes) : 99776
ID : 328160432
Device/File Name : /dev/raw/raw4
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw5
Device/File integrity check succeeded
Cluster registry integrity check succeeded
[oracle@rac2 css]$ $ORA_CRS_HOME/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104344
Used space (kbytes) : 4568
Available space (kbytes) : 99776
ID : 328160432
Device/File Name : /dev/raw/raw4
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw5
Device/File integrity check succeeded
Cluster registry integrity check succeeded
[oracle@rac2 css]$ crsctl query css votedisk
0. 0 /dev/raw/raw6
1. 0 /dev/raw/raw7
2. 0 /dev/raw/raw8
located 3 votedisk(s).
注意:
執 行crsctl命令的可以是root使用者,也可以是oracle使用者,如果是root使用者要指定絕對路徑,但是對於crsctl start crs和crsctl stop crs必須是root使用者來執行。
crs主要程式
(1)crsd
負 責管理ha操作
管理crs資源,如linstener,vip,ons,gsn等
由root使用者管理、啟動
(2)ocssd
管 理各節點的關係,用於節點間通訊
由oracle使用者執行管理
(3)oprocd
叢集程式管理 —Process monitor for the cluster.
僅在沒有使用vendor的叢集軟體狀態下執行
(4)evmd
事 件檢測程式,由oracle使用者執行管理
(5)主要log位置
$ORA_CRS_HOME/log/節點主機名/racg
$ORA_CRS_HOME/log /節點主機名/crsd
$ORA_CRS_HOME/crs/init
$ORA_CRS_HOME/css/log
$ORA_CRS_HOME/css/init
$ORA_CRS_HOME/evm/log
$ORA_CRS_HOME/evm/init
$ORA_CRS_HOME/srvm/log
come from:http://gaoshan.blog.違規廣告.com/742525/290871
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-668566/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- crs常用管理命令
- Mac 常用命令集合Mac
- DG常用命令集
- VI常用命令集合
- 常用指令碼命令集(轉)指令碼
- Linux 常用命令集合Linux
- AIX常用命令集錦AI
- CentOS7常用命令集合CentOS
- Aircrack-ng工具集常用命令集合AI
- redis常用資料型別操作命令集錦Redis資料型別
- 【Linux】CentOS7 常用命令集合LinuxCentOS
- 【附錄】 sqlplus 常用命令集SQL
- Wifite工具常用命令集合大學霸IT達人WiFi
- 總結:ORACLE RAC 常用命令之CRS(1)Oracle
- hacmp命令集ACM
- 【Bat命令集】BAT
- Oracle命令集Oracle
- Git命令集合Git
- ARP監控工具ARPalert常用命令集合大學霸IT達人
- 批次探測工具fpingping常用命令集合大學霸IT達人
- crs_stat -t CRS-0184: Cannot communicate with the CRS daemon
- Linux命令集合Linux
- Git命令集錦Git
- windows命令集(轉)Windows
- SSL_TLS快速掃描器SSLScan常用命令集合大學霸IT達人TLS
- 無線認證資訊抓包工具hcxdumptool常用命令集合大學霸IT達人
- Wifitap是一個WiFi注入工具集常用命令集合大學霸IT達人WiFi
- 無線密碼離線破解工具Pyrit常用命令集合大學霸IT達人密碼
- DB2資料庫常用命令集:部分資料庫維護命令DB2資料庫
- CRS-0184 Cannot communicate with the CRS daemon
- CRS-0184: Cannot communicate with the CRS daemon
- crs之上的resource管理總結(CRS_PROFILE)
- mysql 命令集(轉貼)MySql
- CRS-0184: Cannot communicate with the CRS daemon.
- CRS-1205:Auto-start failed for the CRS resourceAI
- ARP探測目標工具arping常用命令集合大學霸IT達人
- Oracle RAC維護命令集Oracle
- Oracle Clusterware 命令集分類Oracle