日期:2014-05-16 浏览次数:20672 次
常用的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]$
此命令用来启动所有的集群服务,但是启动的前提是 资源状态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得到)
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 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.
$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 Ta