最近处理过好几个关于RAC在重启时个别资源无法启动,例instance、tns 等。
资源情况如下:
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
ora.DATA.dg
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
ora.LISTENER.lsnr
OFFLINE OFFLINE resdb1
OFFLINE OFFLINE resdb2
ora.asm
ONLINE ONLINE resdb1 Started
ONLINE ONLINE resdb2 Started
ora.gsd
OFFLINE OFFLINE resdb1
OFFLINE OFFLINE resdb2
ora.net1.network
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
ora.ons
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
ora.registry.acfs
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE resdb1
ora.cvu
1 ONLINE ONLINE resdb2
ora.oc4j
1 ONLINE ONLINE resdb1
ora.resdb.db
1 OFFLINE OFFLINE resdb1
2 OFFLINE OFFLINE resdb2
从上面状态信息可以看出,resdb数据库的resdb1和resdb2两个实例及监听的TARGET和STATE值都为OFFLINE。
而大多数初级DBA在关闭数据库和监听是基本都是sqlplus shut immediate,这样以来就会出现上边的问题。(这样会导致cluster 无法正常管理资源)
查看
查看每个资源属性的值如下:
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r--
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=%CRS_HOME%/bin/racgwrap%CRS_SCRIPT_SUFFIX%
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
ALIAS_NAME=ora.%CRS_CSS_NODENAME_LOWER_CASE%.LISTENER_%CRS_CSS_NODENAME_UPPER_CASE%.lsnr
AUTO_START=restore----此属性
CHECK_INTERVAL=60
CHECK_TIMEOUT=120
DEFAULT_TEMPLATE=PROPERTY(RESOURCE_CLASS=listener) PROPERTY(LISTENER_NAME=PARSE(%NAME%, ., 2))
DEGREE=1
DESCRIPTION=Oracle Listener resource
ENABLED=1
ENDPOINTS=TCP:1521
LOAD=1
LOGGING_LEVEL=1
NAME=ora.resdb.db
TYPE=ora.database.type
ACL=owner:oracle:rwx,pgrp:oinstall:r--,other::r--,group:dba:r-x,group:oper:r-x,user:grid:r-x
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
ACTIVE_PLACEMENT=1
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
AUTO_START=restore----此属性
CARDINALITY=2
CHECK_INTERVAL=1
CHECK_TIMEOUT=30
CLUSTER_DATABASE=true
避免此问题发生,可修改如下属性:(root用户)
./crsctl modify resource "ora.LISTENER.lsnr" -attr "AUTO_START=always"
./crsctl modify resource "ora.resdb.db" -attr "AUTO_START=always"
而10G数据库的crs和11G还是有一定差别的。
10G 的属性如下:
$ crs_stat -p
NAME=ora.dba.LISTENER_RACDB1.lsnr
TYPE=application
ACTION_SCRIPT=/oracle/oracle10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=600
.......
NAME=ora.dbb.LISTENER_RACDB2.lsnr
TYPE=application
ACTION_SCRIPT=/oracle/oracle10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=600
DESCRIPTION=CRS application for listener on node
NAME=ora.RACDB.db
TYPE=application
ACTION_SCRIPT=/oracle/crs10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=600
NAME=ora.RACDB.RACDB1.inst
TYPE=application
ACTION_SCRIPT=/oracle/oracle10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
NAME=ora.RACDB.RACDB2.inst
TYPE=application
ACTION_SCRIPT=/oracle/oracle10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
属性说明:
AUTO_START值
0,表示:启动到资源重启之前的状态
1,表示: 启动资源
2,表示:不启动资源
可以用如下命令进行修改
crs_register resource_name -update -o as=2 ---(root下)
一般在安装11GR2 RAC时,有经验的dba都会对资源属性进行修改
如:
./crsctl modify res ora.crf -attr AUTO_START=never
./crsctl modify res ora.crf ENABLE=0 –init
./crsctl modify resource "ora.LISTENER.lsnr" -attr "AUTO_START=always"
./crsctl modify resource "ora.racdb.db" -attr "AUTO_START=always"
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。