RAC经常容易碰到的几个问题-----时间不同步

1、时间不同步,这是老问题了,官方说两台服务器的时间间隔不要超过30秒,这个数字有待商榷,因为我曾经碰到过在30秒以内出现故障的情况。因此,时间同步是必须的。
时间同步最好的方案就是使用NTP,或者所有节点都采用路由器NTP的方式,或者节点中选择一个NTP作为服务器,最好是使用路由器的NTP功能。

1.通过CRS_STAT查看RAC服务状态
[oracle@silinux2 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.orcl.db    application    ONLINE    UNKNOWN   silinux2   
ora....l1.inst application     ONLINE    ONLINE    silinux1   
ora....l2.inst application     ONLINE    ONLINE    silinux2   
ora....SM1.asm application    ONLINE    ONLINE    silinux1   
ora....X1.lsnr application    ONLINE    OFFLINE               
ora....ux1.gsd application    ONLINE    UNKNOWN   silinux1   
ora....ux1.ons application    ONLINE    UNKNOWN   silinux1   
ora....ux1.vip application    ONLINE    ONLINE    silinux1   
ora....SM2.asm application    ONLINE    ONLINE    silinux2   
ora....X2.lsnr application    ONLINE    ONLINE    silinux2   
ora....ux2.gsd application    ONLINE    UNKNOWN   silinux2   
ora....ux2.ons application    ONLINE    UNKNOWN   silinux2   
ora....ux2.vip application    ONLINE    ONLINE    silinux2
说明:通过crs_stat命令查看,其中多个服务状态显示为UNKNOWN,可通过配置NTP或者直接用date -s XX:XX:XX来修改两节点时间,以保持一致(其中XX:XX:XX为小时:分钟:秒)


2.通过CRS_STOP命令来停止RAC相应服务,并用CRS_STAT确认结果,可见仍有部分服务无法正常关闭
[oracle@silinux2 ~]$ crs_stop -all
Attempting to stop `ora.orcl.db` on member `silinux1`
Stop of `ora.orcl.db` on member `silinux1` succeeded.
Attempting to stop `ora.silinux2.LISTENER_SILINUX2.lsnr` on member `silinux2`
Attempting to stop `ora.silinux1.LISTENER_SILINUX1.lsnr` on member `silinux1`
Stop of `ora.silinux1.LISTENER_SILINUX1.lsnr` on member `silinux1` succeeded.
`ora.orcl.orcl1.inst` is already OFFLINE.
Attempting to stop `ora.silinux1.ASM1.asm` on member `silinux1`
Stop of `ora.silinux2.LISTENER_SILINUX2.lsnr` on member `silinux2` succeeded.
`ora.orcl.orcl2.inst` is already OFFLINE.
Attempting to stop `ora.silinux2.ASM2.asm` on member `silinux2`
Stop of `ora.silinux1.ASM1.asm` on member `silinux1` succeeded.
Attempting to stop `ora.silinux1.vip` on member `silinux1`
Stop of `ora.silinux1.vip` on member `silinux1` succeeded.
Stop of `ora.silinux2.ASM2.asm` on member `silinux2` succeeded.
Attempting to stop `ora.silinux2.vip` on member `silinux2`
Stop of `ora.silinux2.vip` on member `silinux2` succeeded.
CRS-0216: Could not stop resource 'ora.orcl.orcl1.inst'.

CRS-0216: Could not stop resource 'ora.orcl.orcl2.inst'.

[oracle@silinux2 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.orcl.db    application    OFFLINE   OFFLINE               
ora....l1.inst application    OFFLINE   OFFLINE               
ora....l2.inst application    OFFLINE   OFFLINE               
ora....SM1.asm application    OFFLINE   OFFLINE               
ora....X1.lsnr application    OFFLINE   OFFLINE               
ora....ux1.gsd application    ONLINE    UNKNOWN   silinux1   
ora....ux1.ons application    ONLINE    UNKNOWN   silinux1   
ora....ux1.vip application    OFFLINE   OFFLINE               
ora....SM2.asm application    OFFLINE   OFFLINE   
ora....X2.lsnr application    OFFLINE   OFFLINE               
ora....ux2.gsd application    ONLINE    UNKNOWN   silinux2   
ora....ux2.ons application    ONLINE    UNKNOWN   silinux2   
ora....ux2.vip application    OFFLINE   OFFLINE         


3.通过CRS_STAT命令查看状态异常的服务所对应的服务全称
[oracle@silinux2 ~]$ crs_stat
NAME=ora.orcl.db
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.orcl.orcl1.inst
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.orcl.orcl2.inst
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.silinux1.ASM1.asm
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.silinux1.LISTENER_SILINUX1.lsnr
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.silinux1.gsd
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on silinux1

NAME=ora.silinux1.ons
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on silinux1

NAME=ora.silinux1.vip
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.silinux2.ASM2.asm
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.silinux2.LISTENER_SILINUX2.lsnr
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.silinux2.gsd
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on silinux2

NAME=ora.silinux2.ons
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on silinux2

NAME=ora.silinux2.vip
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

4.通过手动的方式逐一停止UNKNOWN状态的服务,最后通过CRS_STAT确认结果
[oracle@silinux2 ~]$ crs_stop ora.silinux1.ons
Attempting to stop `ora.silinux1.ons` on member `silinux1`
Stop of `ora.silinux1.ons` on member `silinux1` succeeded.
[oracle@silinux2 ~]$ crs_stop ora.silinux2.ons
Attempting to stop `ora.silinux2.ons` on member `silinux2`
Stop of `ora.silinux2.ons` on member `silinux2` succeeded.
[oracle@silinux2 ~]$ crs_stop ora.silinux1.gsd
Attempting to stop `ora.silinux1.gsd` on member `silinux1`
Stop of `ora.silinux1.gsd` on member `silinux1` succeeded.
[oracle@silinux2 ~]$ crs_stop ora.silinux2.gsd
Attempting to stop `ora.silinux2.gsd` on member `silinux2`
Stop of `ora.silinux2.gsd` on member `silinux2` succeeded.
[oracle@silinux2 ~]$ crs_stat -t
Name           Type           Target    State     Host     
------------------------------------------------------------
ora.orcl.db    application    OFFLINE   OFFLINE               
ora....l1.inst application    OFFLINE   OFFLINE               
ora....l2.inst application    OFFLINE   OFFLINE               
ora....SM1.asm application    OFFLINE   OFFLINE               
ora....X1.lsnr application    OFFLINE   OFFLINE               
ora....ux1.gsd application    OFFLINE   OFFLINE               
ora....ux1.ons application    OFFLINE   OFFLINE               
ora....ux1.vip application    OFFLINE   OFFLINE               
ora....SM2.asm application    OFFLINE   OFFLINE               
ora....X2.lsnr application    OFFLINE   OFFLINE               
ora....ux2.gsd application    OFFLINE   OFFLINE               
ora....ux2.ons application    OFFLINE   OFFLINE               
ora....ux2.vip application    OFFLINE   OFFLINE   


5.使用CRS_START命令来重启服务,因时间已经修改,可通过此步骤来确保RAC正常启动
[oracle@silinux2 ~]$ crs_start -all
Attempting to start `ora.silinux2.vip` on member `silinux2`
Attempting to start `ora.silinux1.vip` on member `silinux1`
Start of `ora.silinux2.vip` on member `silinux2` succeeded.
Attempting to start `ora.silinux2.ASM2.asm` on member `silinux2`
Start of `ora.silinux1.vip` on member `silinux1` succeeded.
Attempting to start `ora.silinux1.ASM1.asm` on member `silinux1`
Start of `ora.silinux2.ASM2.asm` on member `silinux2` succeeded.
Attempting to start `ora.orcl.orcl2.inst` on member `silinux2`
Start of `ora.silinux1.ASM1.asm` on member `silinux1` succeeded.
Attempting to start `ora.orcl.orcl1.inst` on member `silinux1`
Start of `ora.orcl.orcl2.inst` on member `silinux2` succeeded.
Attempting to start `ora.silinux2.LISTENER_SILINUX2.lsnr` on member `silinux2`
Start of `ora.silinux2.LISTENER_SILINUX2.lsnr` on member `silinux2` succeeded.
Start of `ora.orcl.orcl1.inst` on member `silinux1` succeeded.
Attempting to start `ora.silinux1.LISTENER_SILINUX1.lsnr` on member `silinux1`
Start of `ora.silinux1.LISTENER_SILINUX1.lsnr` on member `silinux1` succeeded.
CRS-1002: Resource 'ora.silinux1.ons' is already running on member 'silinux1'

CRS-1002: Resource 'ora.silinux2.ons' is already running on member 'silinux2'

Attempting to start `ora.silinux2.gsd` on member `silinux2`
Attempting to start `ora.orcl.db` on member `silinux1`
Attempting to start `ora.silinux1.gsd` on member `silinux1`
Start of `ora.orcl.db` on member `silinux1` succeeded.
Start of `ora.silinux1.gsd` on member `silinux1` succeeded.
Start of `ora.silinux2.gsd` on member `silinux2` succeeded.
CRS-0223: Resource 'ora.silinux1.ons' has placement error.

CRS-0223: Resource 'ora.silinux2.ons' has placement error.

[oracle@silinux2 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.orcl.db    application    ONLINE    ONLINE    silinux1   
ora....l1.inst application    ONLINE    ONLINE    silinux1   
ora....l2.inst application    ONLINE    ONLINE    silinux2   
ora....SM1.asm application    ONLINE    ONLINE    silinux1   
ora....X1.lsnr application    ONLINE    ONLINE    silinux1   
ora....ux1.gsd application    ONLINE    ONLINE    silinux1     
ora....ux1.ons application    ONLINE    ONLINE    silinux1   
ora....ux1.vip application    ONLINE    ONLINE    silinux1   
ora....SM2.asm application    ONLINE    ONLINE    silinux2   
ora....X2.lsnr application    ONLINE    ONLINE    silinux2   
ora....ux2.gsd application    ONLINE    ONLINE    silinux2   
ora....ux2.ons application    ONLINE    ONLINE    silinux2   
ora....ux2.vip application    ONLINE    ONLINE    silinux2
标签: 暂无标签
oraunix

写了 199 篇文章,拥有财富 1026,被 339 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

成为第一个吐槽的人

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈