您的位置:首页 > 其它

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

2016-10-28 14:52 513 查看
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是可用实例

srvctl add service -d GRB -s grb_stest01 -r GRB1 -a GRB2
2) 检查service的创建

srvctl config service -d GRB -a 11.2.0.4中弃用-a参数

==>
Service name: grb_stest01
Service is enabled
Server pool: GRB_grb_stest01
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Preferred instances: GRB1
Available instances: GRB2
Service name: grb_test01
Service is enabled
Server pool: GRB_grb_test01
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Preferred instances: GRB1
Available instances:3) 启动grb_stest01服务
srvctl start service -d GRB -s grb_stest01
4) 确认服务正在GRB1上运行
srvctl status service -d GRB

==>
Service grb_stest01 is running on instance(s) GRB1
5) 使用srvctl imemediate(默认)或 abort关闭实例
srvctl stop instance -d GRB -i GRB1

OR

srvctl stop instance -d GRB -i GRB1 -o abort

srvctl status service -d GRB

==>
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配合使用,以使服务在关闭实例时故障切换到可用实例。

srvctl stop instance -d GRB -i GRB1 -f

srvctl status service -d GRB

==>
Service grb_stest01 is running on instance(s) GRB2

在12C中执行的语句和返回的结果将被改变
1) 如果正在停止的实例没有使用 -force 或 -failover选项,然而有service运行在正在停止的实例上时会报错(PRCD-1315,PRCR-1014, PRCR-1065, CRS-2529)

ie)
$srvctl config service -d orcl -s orcl_service01

Service name: orcl_service01
...
....
Preferred instances: orcl1
Available instances: orcl2

$srvctl status service -d orcl
Service orcl_service01 is running on instance(s) orcl1

$ srvctl stop instance -d orcl -i orcl1
PRCD-1315 : failed to stop instances for database orcl
PRCR-1014 : Failed to stop resource ora.orcl.db
PRCR-1065 : Failed to stop resource ora.orcl.db
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”
ie)
$ srvctl status service -d orcl
Service orcl_service01 is running on instance(s) orcl1

$ srvctl stop instance -d orcl -i orcl1 -failover

$ srvctl status service -d orcl
Service orcl_service01 is running on instance(s) orcl23) 如果要停止的实例上运行着实例和AND服务,请使用“-force”选项
$ srvctl status service -d orcl -s orcl_service01
Service orcl_service01 is running on instance(s) orcl1

$ srvctl stop instance -d orcl -i orcl1 -force

$ srvctl status service -d orcl -s orcl_service01
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: