ITPub博客

首页 > 数据库 > Oracle > rac 正常关闭实例service不会自动漂移,只有在实例异常abort才会发生自动failover

rac 正常关闭实例service不会自动漂移,只有在实例异常abort才会发生自动failover

原创 Oracle 作者:darren__chan 时间:2021-09-13 17:30:17 0 删除 编辑

关于正常计划性地shutdown 实例,服务不会自动漂移,只有在实例异常的情况下才会发生自动failover的情况。

不过我们可以在srvctl stop instance时加上 “-f“ ,作用就是让服务自动failover到另外一个节点。

-f       This option fails the running services over to another instance. (同时也可以参考文档:How to Failover a Service During Instance Shutdown Using SRVCTL (文档 ID 1520454.1))

srvctl stop instance -d t1nnps  -i t1nnps1 -f

  以下是测试过程:

srvctl add service -d t1nnps -s oratest -r t1nnps1 -a t1nnps2 -P basic -e select -m basic -z 180 -w 5

srvctl start service -d t1nnps -s oratest

 

xxxxxx:t1nnps1 > srvctl status service -d t1nnps -s oratest

Service oratest is running on instance(s) t1nnps1《《《《《《《《《《《

 

 

srvctl config service -d t1nnps -s oratest

 

xxxxx:t1nnps1 > srvctl config service -d t1nnps -s oratest

Service name: oratest

Service is enabled

Server pool: t1nnps_oratest

Cardinality: 1

Disconnect: false

Service role: PRIMARY

Management policy: AUTOMATIC

DTP transaction: false

AQ HA notifications: false

Failover type: SELECT

Failover method: BASIC

TAF failover retries: 180

TAF failover delay: 5

Connection Load Balancing Goal: LONG

Runtime Load Balancing Goal: NONE

TAF policy specification: BASIC

Edition:

Preferred instances: t1nnps1  <<<<<<<<<<<<<<<

Available instances: t1nnps2  <<<<<<<<<<<<<<<

 

正常关闭实例,service是也正常关闭了。

 

xxxxxx:t1nnps1 > srvctl stop instance -d t1nnps  -i t1nnps1

xxxxxx:t1nnps1 > srvctl status service -d t1nnps -s oratest

Service oratest is not running. 《《《《《《《《《《《《《《《《《《《

 

 

stop instance 加上-f,可以把service failover 到另外一个实例上

 

xxxxxx:t1nnps2 > srvctl start instance -d t1nnps  -i t1nnps1

xxxxxx:t1nnps1 > srvctl status service -d t1nnps -s oratest

Service oratest is running on instance(s) t1nnps1

xxxxxx:t1nnps1 > srvctl stop instance -d t1nnps  -i t1nnps1 -f  《《《《《《《《

xxxxxx:t1nnps1 >  srvctl status service -d t1nnps -s oratest 《《《《《《《《《

Service oratest is running on instance(s) t1nnps2

 

      


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29863023/viewspace-2791878/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
一思尚存,此志不懈

注册时间:2014-09-09

  • 博文量
    193
  • 访问量
    1189492