文档 ID 1324574.1 11gR2 RAC 服务在实例关闭时不会故障转移到其他节点

11gR2 RAC Service Not Failing Over To Other Node When Instance Is Shut Down (文档 ID 1324574.1)
11gR2 RAC 服务在实例关闭时不会故障转移到其他节点

Oracle Database - Enterprise Edition - Version 11.2.0.2 and later
Information in this document applies to any platform.


一、现象

'srvctl stop instance'使实例关闭,但服务没有故障转移到可用实例
在11.2之前,通过srvctl/sqlplus停止实例触发服务故障切换到可用实例


1) 在GRB DB上创建名为“grb_test01”的服务,GRB1是首选实例,GRB2是可用实例

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. srvctl add service -d GRB -s grb_stest01 -r GRB1 -a GRB2  

2) 检查service的创建

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. srvctl config service -d GRB -a         11.2.0.4中弃用-a参数  
  2.   
  3. ==>  
  4. Service name: grb_stest01  
  5. Service is enabled  
  6. Server pool: GRB_grb_stest01  
  7. Cardinality: 1  
  8. Disconnect: false  
  9. Service role: PRIMARY  
  10. Management policy: AUTOMATIC  
  11. DTP transaction: false  
  12. AQ HA notifications: false  
  13. Failover type: NONE  
  14. Failover method: NONE  
  15. TAF failover retries: 0  
  16. TAF failover delay: 0  
  17. Connection Load Balancing Goal: LONG  
  18. Runtime Load Balancing Goal: NONE  
  19. TAF policy specification: NONE  
  20. Preferred instances: GRB1  
  21. Available instances: GRB2  
  22. Service name: grb_test01  
  23. Service is enabled  
  24. Server pool: GRB_grb_test01  
  25. Cardinality: 1  
  26. Disconnect: false  
  27. Service role: PRIMARY  
  28. Management policy: AUTOMATIC  
  29. DTP transaction: false  
  30. AQ HA notifications: false  
  31. Failover type: NONE  
  32. Failover method: NONE  
  33. TAF failover retries: 0  
  34. TAF failover delay: 0  
  35. Connection Load Balancing Goal: LONG  
  36. Runtime Load Balancing Goal: NONE  
  37. TAF policy specification: NONE  
  38. Preferred instances: GRB1  
  39. Available instances:  
3) 启动grb_stest01服务
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. srvctl start service -d GRB -s grb_stest01  
4) 确认服务正在GRB1上运行
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. srvctl status service -d GRB  
  2.   
  3. ==>  
  4. Service grb_stest01 is running on instance(s) GRB1  
5) 使用srvctl imemediate(默认)或 abort关闭实例
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. srvctl stop instance -d GRB -i GRB1  
  2.   
  3. OR  
  4.   
  5. srvctl stop instance -d GRB -i GRB1 -o abort  
  6.   
  7. srvctl status service -d GRB  
  8.   
  9. ==>  
  10. Service grb_stest01 is not running  
此时服务不会故障转移,但服务会停止。

二、CHANGES

Upgrade to 11.2

三、原因

这是11.2中的预期行为


如果使用sqlplus关闭实例
在10g,11g中,服务将会故障切换到可用实例


如果使用srvctl关闭实例
在11.2之前,服务将故障切换到可用实例。
在11.2中,服务不会故障转移,但服务会停止


在11.2中,在使用srvctl停止实例时,如果希望服务故障转移(在另一个实例中启动)到可用实例需要指定-f选项(即srvctl stop instance -d xxx -i xxx1 -f)。

或者,您可以在通过srvctl停止实例之前将服务重定位到另一个实例  srvctl relocate service -d exdb -s testsv -i exdb1 -t exdb2


四、 解决方案

将-f选项与srvctl配合使用,以使服务在关闭实例时故障切换到可用实例。

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. srvctl stop instance -d GRB -i GRB1 -f  
  2.   
  3. srvctl status service -d GRB  
  4.   
  5. ==>  
  6. Service grb_stest01 is running on instance(s) GRB2  


在12C中执行的语句和返回的结果将被改变

1) 如果正在停止的实例没有使用 -force 或 -failover选项,然而有service运行在正在停止的实例上时会报错(PRCD-1315,PRCR-1014, PRCR-1065, CRS-2529)

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. ie)  
  2. $srvctl config service -d orcl -s orcl_service01  
  3.   
  4. Service name: orcl_service01  
  5. ...  
  6. ....  
  7. Preferred instances: orcl1  
  8. Available instances: orcl2  
  9.   
  10. $srvctl status service -d orcl  
  11. Service orcl_service01 is running on instance(s) orcl1  
  12.   
  13. $ srvctl stop instance -d orcl -i orcl1  
  14. PRCD-1315 : failed to stop instances for database orcl  
  15. PRCR-1014 : Failed to stop resource ora.orcl.db  
  16. PRCR-1065 : Failed to stop resource ora.orcl.db  
  17. CRS-2529: Unable to act on 'ora.orcl.db' because that would require stopping or relocating 'ora.orcl.orcl_service01.svc', but the force option was not specified  
2) 如果要停止实例并将服务故障转移到另一个实例,则需要使用“-failover”选项而不是“-force”

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. ie)  
  2. $ srvctl status service -d orcl  
  3. Service orcl_service01 is running on instance(s) orcl1  
  4.   
  5. $ srvctl stop instance -d orcl -i orcl1 -failover  
  6.   
  7. $ srvctl status service -d orcl  
  8. Service orcl_service01 is running on instance(s) orcl2  
3) 如果要停止的实例上运行着实例和AND服务,请使用“-force”选项
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $ srvctl status service -d orcl -s orcl_service01  
  2. Service orcl_service01 is running on instance(s) orcl1  
  3.   
  4. $ srvctl stop instance -d orcl -i orcl1 -force  
  5.   
  6. $ srvctl status service -d orcl -s orcl_service01  
  7. Service orcl_service01 is not running.  


引用:
Oracle Real Application Clusters Administration and Deployment Guide
11g Release 2 (11.2)
Part Number E16795-08

-----------------------------
srvctl stop instance
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值