一.检查共享设备
一般情况下,存放OCR和VotingDisk的OCFS2或者raw都是自动启动的。如果他们没有启动,RAC肯定是启动不了的。
1.1如果使用ocfs2的,检查ocfs2状态
/etc/init.d/o2cbstatus
在挂载之前,/etc/init.d/o2cbstatus显示为CheckingO2CBheartbeat:Notactive。
在格式化和挂载文件系统之前,应验证O2CB在两个节点上均联机;O2CB心跳当前没有
活动,因为文件系统还没有挂载。挂载之后就会变成active。
mount-tocfs2-odatavolume/dev/sdb1/u02/oradata/orcl
1,2.如果使用rawdevice.
[root@raw1~]#cd/dev/raw/
[root@raw1raw]#ls
raw1raw2
或者:
[root@raw1init.d]#/etc/init.d/rawdevicesstatus
/dev/raw/raw1:boundtomajor8,minor17
/dev/raw/raw2:boundtomajor8,minor18
1.3.检查ASM
/etc/init.d/oracleasmlistdisks
二.自动启动RAC并检查相关进程
RAC在启动的时候crs等进程都是自动启动的:
[root@rac1init.d]#ls-l/etc/init.d/init.*
-r-xr-xr-x1rootroot1951Feb2622:38/etc/init.d/init.crs
-r-xr-xr-x1rootroot4714Feb2622:38/etc/init.d/init.crsd
-r-xr-xr-x1rootroot35394Feb2622:38/etc/init.d/init.cssd
-r-xr-xr-x1rootroot3190Feb2622:38/etc/init.d/init.evmd
我们要查看一下crs的状态:
正常情况下,进程都是online的:
[root@raw1bin]#./crs_stat-t
NameTypeTargetStateHost
------------------------------------------------------------
ora.raw.dbapplicationONLINEONLINEraw1
ora.raw.raw.csapplicationONLINEONLINEraw1
ora....aw1.srvapplicationONLINEONLINEraw1
ora....aw2.srvapplicationONLINEONLINEraw2
ora....w1.instapplicationONLINEONLINEraw1
ora....w2.instapplicationONLINEONLINEraw2
ora....SM1.asmapplicationONLINEONLINEraw1
ora....W1.lsnrapplicationONLINEONLINEraw1
ora.raw1.gsdapplicationONLINEONLINEraw1
ora.raw1.onsapplicationONLINEONLINEraw1
ora.raw1.vipapplicationONLINEONLINEraw1
ora....SM2.asmapplicationONLINEONLINEraw2
ora....W2.lsnrapplicationONLINEONLINEraw2
ora.raw2.gsdapplicationONLINEONLINEraw2
ora.raw2.onsapplicationONLINEONLINEraw2
ora.raw2.vipapplicationONLINEONLINEraw2
如果出现以下情况:
[root@rac2bin]#./crs_stat-t
NameTypeTargetStateHost
------------------------------------------------------------
ora.rac.dbapplicationONLINEUNKNOWNrac1
ora....orcl.csapplicationONLINEUNKNOWNrac1
ora....ac1.srvapplicationOFFLINEOFFLINE
ora....ac2.srvapplicationOFFLINEOFFLINE
ora....c1.instapplicationONLINEUNKNOWNrac1
ora....c2.instapplicationONLINEUNKNOWNrac2
ora....SM1.asmapplicationONLINEONLINErac1
ora....C1.lsnrapplicationONLINEUNKNOWNrac1
ora.rac1.gsdapplicationONLINEUNKNOWNrac1
ora.rac1.onsapplicationONLINEONLINErac1
ora.rac1.vipapplicationONLINEONLINErac1
ora....SM2.asmapplicationONLINEONLINErac2
ora....C2.lsnrapplicationONLINEUNKNOWNrac2
ora.rac2.gsdapplicationONLINEUNKNOWNrac2
ora.rac2.onsapplicationONLINEONLINErac2
ora.rac2.vipapplicationONLINEONLINErac2
解决方法:
1.用crs_stat查看进程全部信息:
[root@rac2bin]#./crs_stat
NAME=ora.rac.db
TYPE=application
TARGET=ONLINE
STATE=ONLINEonrac2
NAME=ora.rac1.LISTENER_RAC1.lsnr
TYPE=application
TARGET=ONLINE
STATE=UNKNOWNonrac1
NAME=ora.rac1.gsd
TYPE=application
TARGET=ONLINE
STATE=UNKNOWNonrac1
NAME=ora.rac2.LISTENER_RAC2.lsnr
TYPE=application
TARGET=ONLINE
STATE=UNKNOWNonrac2
......
2.对于offline的进程,我们可以直接手动的启动它
[root@rac2bin]#./crs_startora.rac.orcl.rac1.srv
Attemptingtostart`ora.rac.orcl.rac1.srv`onmember`rac1`
Startof`ora.rac.orcl.rac1.srv`onmember`rac1`succeeded.
3.对于UNKNOWN的进程,我们可以先stop它,在start。
[root@rac2bin]#./crs_stopora.rac2.gsd
Attemptingtostop`ora.rac2.gsd`onmember`rac2`
Stopof`ora.rac2.gsd`onmember`rac2`succeeded.
[root@rac2bin]#./crs_startora.rac2.gsd
Attemptingtostart`ora.rac2.gsd`onmember`rac2`
Startof`ora.rac2.gsd`onmember`rac2`succeeded.
4.如果crs_stop不能结束,crs_start不能启动的进程,我们有2中方法来解决:
4.1)是用crs_stop-f参数把crs中状态是UNKNOWN的服务关掉,然后再用crs_start-f(加一个-f的参数)启动所有的服务就可以。要分别在两个节点上执行;
[oracle@rac2~]$crs_start-fora.ora9i.ora9i2.inst
Attemptingtostart`ora.ora9i.ora9i2.inst`onmember`rac2`
Startof`ora.ora9i.ora9i2.inst`onmember`rac2`succeeded.
[oracle@rac2~]$crs_stop-fora.ora9i.db
Attemptingtostop`ora.ora9i.db`onmember`rac2`
Stopof`ora.ora9i.db`onmember`rac2`succeeded.
4.2)转换到root用户下用/etc/init.d/init.crsstop先禁用crs,然后再用/etc/init.d/init.crsstart去启用crs,启用crs后会自动启动crs的一系列服务,注意此种方法需要在两台节点上都执行;
5.可以用命令一次启动和关闭相关进程
[root@rac2bin]#./crs_stop-all
[root@rac2bin]#./crs_start-all
三.手动启动RAC
一般情况下每次节点启动的时候,所有服务都会自动启动,如果需要关闭或者启动某个节点,如下所示
停止RAC:
emctlstopdbconsole
srvctlstopinstance-draw-iraw1
srvctlstopinstance-draw-iraw2
srvctlstopasm-nraw1
srvctlstopasm-nraw2
srvctlstopnodeapps-nraw1
srvctlstopnodeapps-nraw2
启动RAC:
和上面的步骤正好相反即
srvctlstartnodeapps-nraw1
srvctlstartnodeapps-nraw2
srvctlstartasm-nraw1
srvctlstartasm-nraw2
srvctlstartinstance-draw-iraw2
srvctlstartinstance-dorcl-iraw1
emctlstartdbconsole
使用SRVCTL启动/停止所有实例及其启用的服务。
srvctlstartdatabase-dorcl
srvctlstopdatabase-dorcl
注:CRSResource包括GSD(GlobalServeiceDaemon),ONS(OracleNotificationService),VIP,Database,Instance和Service.这些资源被分成2类:
GSD,ONS,VIP和Listener属于Noteapps类
Database,Instance和Service属于Database-RelatedResource类。
有关OracleRAC的概念,请参考我的blog:
RAC的一些概念性和原理性的知识
http://blog.csdn.net/tianlesoftware/archive/2010/02/27/5331067.aspx
示例:
[root@raw1bin]#./crs_stat-t
NameTypeTargetStateHost
------------------------------------------------------------
ora.raw.dbapplicationONLINEONLINEraw1
ora.raw.raw.csapplicationONLINEONLINEraw1
ora....aw1.srvapplicationONLINEONLINEraw1
ora....aw2.srvapplicationONLINEONLINEraw2
ora....w1.instapplicationONLINEONLINEraw1
ora....w2.instapplicationONLINEONLINEraw2
ora....SM1.asmapplicationONLINEONLINEraw1
ora....W1.lsnrapplicationONLINEONLINEraw1
ora.raw1.gsdapplicationONLINEONLINEraw1
ora.raw1.onsapplicationONLINEONLINEraw1
ora.raw1.vipapplicationONLINEONLINEraw1
ora....SM2.asmapplicationONLINEONLINEraw2
ora....W2.lsnrapplicationONLINEONLINEraw2
ora.raw2.gsdapplicationONLINEONLINEraw2
ora.raw2.onsapplicationONLINEONLINEraw2
ora.raw2.vipapplicationONLINEONLINEraw2
[oracle@raw1~]$emctlstopdbconsole
TZsettoPRC
OracleEnterpriseManager10gDatabaseControlRelease10.2.0.1.0
Copyright(c)1996,2005OracleCorporation.Allrightsreserved.
http://raw1:1158/em/console/aboutApplication
StoppingOracleEnterpriseManager10gDatabaseControl...
...Stopped.
[oracle@raw1~]$srvctlstopinstance-draw-iraw1
[oracle@raw1~]$srvctlstopinstance-draw-iraw2
[oracle@raw1~]$srvctlstopasm-nraw1
[oracle@raw1~]$srvctlstopasm-nraw2
[oracle@raw1~]$srvctlstopnodeapps-nraw1
[oracle@raw1~]$srvctlstopnodeapps-nraw2
[oracle@raw1bin]$crs_stat-t
NameTypeTargetStateHost
------------------------------------------------------------
ora.raw.dbapplicationOFFLINEOFFLINE
Ora.raw.raw.csapplicationOFFLINEOFFLINE
ora....aw1.srvapplicationOFFLINEOFFLINE
ora....aw2.srvapplicationOFFLINEOFFLINE
ora....w1.instapplicationOFFLINEOFFLINE
ora....w2.instapplicationOFFLINEOFFLINE
ora....SM1.asmapplicationOFFLINEOFFLINE
ora....W1.lsnrapplicationOFFLINEOFFLINE
ora.raw1.gsdapplicationOFFLINEOFFLINE
ora.raw1.onsapplicationOFFLINEOFFLINE
ora.raw1.vipapplicationOFFLINEOFFLINE
ora....SM2.asmapplicationOFFLINEOFFLINE
ora....W2.lsnrapplicationOFFLINEOFFLINE
ora.raw2.gsdapplicationOFFLINEOFFLINE
ora.raw2.onsapplicationOFFLINEOFFLINE
ora.raw2.vipapplicationOFFLINEOFFLINE
四.在启动的过程中最好检测着crs、ASM和数据库的日志:
crs日志:
[oracle@rac1~]$tail-f/u01/app/oracle/product/10.2.0/crs_1/log/rac1/alertrac1.log
[oracle@rac2~]$tail-f/u01/app/oracle/product/10.2.0/crs_1/log/rac2/alertrac2.log
ASM日志:
[oracle@rac1~]$tail-f/u01/app/oracle/admin/+ASM/bdump/alert_+ASM1.log
[oracle@rac2~]$tail-f/u01/app/oracle/admin/+ASM/bdump/alert_+ASM2.log
数据库日志:
[oracle@rac1~]$tail-f/u01/app/oracle/admin/ora9i/bdump/alert_ora9i1.log
[oracle@rac2~]$tail-f/u01/app/oracle/admin/ora9i/bdump/alert_ora9i2.log
注:tail-f命令可用于监视另一个进程正在写入的文件的增长。