Oracle service failover后自动切回原来的node

After database service resources in CRS failed over to another node in a RAC Cluster, they were terminated and automatically fail back to the original node incorrectly.

CAUSE

The "fail back" was actually a relocation of the service resource, initiated by user process(UiServer):


crsd_148.trc:2017-12-19 12:24:32.701587 :UiServer:1239340800: {1:54916:896} Container [ Name: UI_RELOCATE

crsd_148.trc:2017-12-19 12:24:32.701630 :UiServer:1239340800: {1:54916:896} Sending to PE. ctx= 0x7f830003a9f0, ClientPID=96087 ===========>

crsd_148.trc:2017-12-19 12:24:32.707319 :UiServer:1239340800: {1:54916:896} Response: c4|5!ORDERk7|MESSAGEt79|CRS-2673: Attempting to stop 'ora.orcl.orclsrv.svc' on 'node1'k7|MSGTY

PEt1|3k5|OBJIDt33|ora.orcl.orclsrv.svc 1 1k4|WAITt1|0

crsd_148.trc:2017-12-19 12:24:32.777894 :UiServer:1239340800: {1:54916:896} Response: c4|5!ORDERk7|MESSAGEt78|CRS-2677: Stop of 'ora.orcl.orclsrv.svc' on 'node1' succeededk7|MSGTYP

Et1|3k5|OBJIDt33|ora.orcl.orclsrv.svc 1 1k4|WAITt1|0

crsd_148.trc:2017-12-19 12:24:32.780142 : AGFW:1251948288: {1:54916:896} Agfw Proxy Server received the message: RESOURCE_STARTora.orcl.orclsrv.svc 1 1 ID 4098:8698047

crsd_148.trc:2017-12-19 12:24:32.780238 : AGFW:1251948288: {1:54916:896} Creating the resource: ora.orcl.orclsrv.svc 1 1

crsd_148.trc:2017-12-19 12:24:32.780339 : AGFW:1251948288: {1:54916:896} Initializing the resource ora.orcl.orclsrv.svc 1 1 for type ora.service.type

crsd_148.trc:2017-12-19 12:24:32.780380 : AGFW:1251948288: {1:54916:896} SR: acl = owner:oracle:rwx,pgrp:dba:r--,other::r--,group:dba:r-x,user:oracle:r-x

crsd_148.trc:2017-12-19 12:24:32.780665 : AGFW:1251948288: {1:54916:896} Agfw Proxy Server sending message: RESOURCE_ADDora.orcl.orclsrv.svc 1 1 ID 4356:2828 to the agent /u01/app/12.1.0.2/grid/bin/oraagent_oracle

The relocate was initiated by a clientPID 96087, using a "JAVA" program:

2017-12-19 12:24:32.701587 :UiServer:1239340800: {1:54916:896} Container [ Name: UI_RELOCATE

API_HDR_VER:

TextMessage3

CLIENT:

TextMessage\[\]

CLIENT_NAME:
TextMessagejava ==============>

CLIENT_PID:
TextMessage96087 ================>

CLIENT_PRIMARY_GROUP:

TextMessagedba

Further analysis showed that this was caused due to the presence of a custom FAN (Fast Application Notification) script defined inside the $GRID_HOME/racg/usrco directory. The following example of the custom script shows that it forcibly relocates a service back to the preferred node after it has failed over to an available node:

Custom script:

if service is not running, then start it

echo " service stopped, starting" >> "$LOGFILE"

ORACLE_HOME/bin/srvctl start service -d "DATABASE" -s "service" \>\> "LOGFILE"

else

Service is running, but is it running on preferred instance?

RUNNING=( 'echo "$SRVSTATUS" | sed -rne "s/.* (a-zA-Z0-9+)/\1/p" | tr "," "\n"' )

echo "{RUNNING\[@\]} = {PREFERRED@}"

if ! in_array "INSTANCE" "{RUNNING@}" ; then

echo " not running on preferred INSTANCE" \>\> "LOGFILE"

Find the first non-preferred running instance

CURRENT=""

for inst in "${RUNNING@}"; do

if ! in_array "inst" "{PREFERRED@}" ; then

CURRENT="$inst"

break

fi

done

Relocate

if \[ -n "$CURRENT" ]; then

echo " relocate CURRENT -\> INSTANCE" >> "LOGFILE" **ORACLE_HOME/bin/srvctl relocate service -d "DATABASE" -s "service" -i "CURRENT" -t "INSTANCE" >> "$LOGFILE" <<<<<<<<<<<<<<<<<<<<<** <<<

fi

else

Service is already running on preferred instance, no need to do anything

echo " running on preferred INSTANCE" \>\> "LOGFILE"

fi

fi

fi

fi

done

SOLUTION

  1. If the custom script is a requirement in the environment, ignore the relocation.

  2. If the custom script is not a requirement or not wanted, verify and remove any user defined scripts in the '$GRID_HOME/racg/usrco' directory that were created for the services fail back.

相关推荐
深盾科技_Virbox4 分钟前
换机或重装后软件许可怎么恢复:先核对哪四项
java·服务器·数据库
知行产研7 分钟前
亚太工程机械市场:中国制造“换道超车“,价值重心从“卖铁“转向“卖系统“
数据库·制造
云贝贝贝10 分钟前
白天稳如狗半夜就抖:OceanBase 合并转储把读写延迟顶了上去
数据库·sql·oceanbase
ss27313 分钟前
AI时代首先数据库-PostgreSQL实战笔记 | 24 PostgreSQL WAL日志与崩溃恢复原理
数据库·笔记·postgresql
JavaPub-rodert15 分钟前
王仕宇分享:Oxigraph 是什么?用 Rust + RocksDB 搭一个轻量 RDF/SPARQL 知识图谱数据库
数据库·rust·知识图谱
ycydynq25 分钟前
django利用不涉及数据库form自定义表单 表单元素验证
数据库·django·sqlite
木白CPP34 分钟前
Persistence subsystem 笔记
数据库·笔记
广州智造40 分钟前
Radioss破坏模型FAILJOHNSON (Johnson-cook) 和 FAILTAB1
运维·数据库·自动化·仿真·建模·后处理·前处理
冰暮流星41 分钟前
sql之日期函数
数据库·sql
时间售卖铺1 小时前
MySQL 库表设计:数据库范式详解
运维·数据库·mysql·云原生