PRCR-1065 Failed to stop resource ora.asm 处理
在网上看到的一些关闭Oracle Grid Infrastructure教程中,很多在关闭数据后就开始关闭ASM,结果提示如下的错误。
[grid@rhvm1 ~]$ srvctl stop asm
PRCR-1065 : Failed to stop resource ora.asm
CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.ASM.dg', but the force option was not specified
原因: 从11.2 Grid Infrastructure开始, ASM diskgroups也注册为CRS资源。而diskgroup资源是依赖于ASM的,所以不能首先要停止'ora.ASM.dg'这个服务,或者直接使用-f选项强制停止ASM。
在我的单实例(11gR2)+ASM测试环境上,可以看到还有两个dg资源属于在线状态。
[grid@rhvm1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASM.dg
ONLINE ONLINE rhvm1
ora.DATA.dg
ONLINE ONLINE rhvm1
ora.asm
ONLINE ONLINE rhvm1 Started
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE rhvm1
ora.diskmon
1 ONLINE ONLINE rhvm1
ora.test.db
1 OFFLINE OFFLINE Instance Shutdown
因此正确的姿势是先停止dg资源。
[grid@rhvm1 ~]$ srvctl stop diskgroup -g data
[grid@rhvm1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASM.dg
ONLINE ONLINE rhvm1
ora.DATA.dg
OFFLINE OFFLINE rhvm1
ora.asm
ONLINE ONLINE rhvm1 Started
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE rhvm1
ora.diskmon
1 ONLINE ONLINE rhvm1
ora.test.db
1 OFFLINE OFFLINE Instance Shutdown
[grid@rhvm1 ~]$ srvctl stop diskgroup -g asm
[grid@rhvm1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASM.dg
OFFLINE OFFLINE rhvm1
ora.DATA.dg
OFFLINE OFFLINE rhvm1
ora.asm
ONLINE ONLINE rhvm1 Started
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE rhvm1
ora.diskmon
1 ONLINE ONLINE rhvm1
ora.test.db
1 OFFLINE OFFLINE Instance Shutdown
-- EOF --