全部博文(389)
分类: Oracle
2014-10-16 17:00:39
RAC资源清除一例
某日在删除RAC(rac,rac2)的一个节点(rac1节点)后,发现在另一个节点中资源没有完全清除干净,
需要手动重去清理残余的资源,环境是:oracle 12c,rhel 5.8
先看看资源情况,
[root@rac2 .oracle]# crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
ONLINE ONLINE rac2 STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac2 STABLE
ora.LISTENER_SCAN1_NET2.lsnr
1 ONLINE ONLINE rac2 STABLE
ora.asm
1 ONLINE ONLINE rac2 STABLE
2 ONLINE OFFLINE STABLE
ora.tt.db
1 ONLINE OFFLINE STABLE
2 OFFLINE OFFLINE Instance Shutdown,ST
ABLE
........................
只有ora.tt.db和ora.asm这两个资源不正常,其他的资源都是正常,只有一个节点。
移除ora.tt.db中多余的实例
[oracle@rac2 ~]$ srvctl remove instance -db tt -instance tt1
Remove instance from the database tt? (y/[n]) y
查看ora.asm资源的情况
[root@rac2 .oracle]# crsctl stat res ora.asm -f
...
.....
ora.asm还是在两个实例上启动.
修改ora.asm属性,删除在另一个节点上的配置
[root@rac2 .oracle]# crsctl modify res ora.asm -attr "" -delete
发现还是没有修改成功
[root@rac2 .oracle]# crsctl stat res -t
ora.asm
1 ONLINE ONLINE rac2 STABLE
2 ONLINE OFFLINE STABLE
再次查看ora.asm资源的信息
[root@rac2 .oracle]# crsctl stat res ora.asm -f
GEN_USR_ORA_INST_NAME=
HOSTING_MEMBERS=
ID=ora.asm
INSTANCE_COUNT=2
发现其实中的INSTANCE_COUNT还是等于2,这说明还是该资源需要两个实例.看来之前的是没有修改成功
手动修改INSTANCE_COUNT的属性
[root@rac2 .oracle]# crsctl modify res ora.asm -attr "INSTANCE_COUNT=1" -f
CRS-2547: Update of an internal or read-only attribute 'INSTANCE_COUNT (READONLY,INTERNAL)' for resource 'ora.asm' is not allowed
CRS-4000: Command Modify failed, or completed with errors.
该属性不支持手动修改.看来能只能过srvctl修改了,在oracle用户中
[oracle@rac2 ~]$ srvctl modify asm -count 1
再次查看,发现已经修改成功了.
[root@rac2 .oracle]# crsctl stat res -t
...............
1 ONLINE ONLINE rac2 STABLE
ora.asm
1 ONLINE ONLINE rac2 STABLE
ora.cvu
1 ONLINE ONLINE rac2 STABLE
ora.oc4j
1 OFFLINE OFFLINE STABL
1 ONLINE ONLINE rac2 STABLE
ora.tt.db
1 ONLINE ONLINE rac2 Open,STABLE
--------------------------------------------------------------------------------