一、rac某个节点文件丢失,重新加入
1、问题重现
节点2由于误操作导致/u01下面的目录被删除,现需要清理节点2后重新加入集群
--登录节点2在不停止集群的情况下模拟
cd /u01/
rm -rf *
--重启节点2,释放资源
--为了保障业务运行,节点1始终不重启
2、清理、初始化异常节点
--登录节点2清理以下文件,否则后面会提示【INS-40915】
rm -rf /etc/oratab
rm -rf /etc/oracle*
rm -rf /etc/oraInst*
--创建GRID和oracle目录
mkdir -p /u01/app/grid
mkdir -p /u01/app/19.0.0/grid
chown -R grid:oinstall /u01
chmod -R 775 /u01
mkdir -p /u01/app/oracle
chown oracle:oinstall /u01/app/oracle
su – oracle
mkdir -p
/u01/app/oracle/product/19.0.0/db_1
--正常节点1删除异常节点2的信息
su - grid
su root
srvctl stop vip -vip rac2-vip
srvctl remove vip -vip rac2-vip
srvctl remove instance -d orcl -i orcl2
crsctl delete node -n rac2
3、正常节点更新集群信息
--更新grid组件信息
--操作命令:
su – grid
cd $ORACLE_HOME/oui/bin/
./runInstaller -updateNodeList ORACLE_HOME=/u01/app/19.0.0/grid
"CLUSTER_NODES={rac1}"
--更新oracle(rdbms)组件信息
--操作命令:
su – oracle
cd $ORACLE_HOME/oui/bin/
./runInstaller
-updateNodeList ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
"CLUSTER_NODES={rac1}"
4、正常节点在线推送安装远端节点
1、Grid组件在线推送安装
su - grid
cd $ORACLE_HOME/addnode
./addnode.sh
-silent -ignoreSysPrereqs -ignorePrereqFailure
"CLUSTER_NEW_NODES={rac2}" "CLUSTER_NEW_PRIVATE_NODE_NAMES={rac2-priv}"
"CLUSTER_NEW_VIRTUAL_HOSTNAMES={rac2-vip}"
--输出信息提示
--告警可忽略
CAUSE: Some of the mandatory prerequisites are not met. See logs for details.
/u01/app/oraInventory/logs/addNodeActions2020-11-05_11-21-13AM.log
ACTION: Identify the list of failed prerequisite checks
from the log:
/u01/app/oraInventory/logs/addNodeActions2020-11-05_11-21-13AM.log. Then either from the log file or from installation manual find the appropriate
configuration to meet the prerequisites and fix it manually.
Copy Files to Remote
Nodes in progress.
.................................................. 6% Done.
.................................................. 11% Done.
....................
--按提示执行脚本
As a root user, execute the following script(s):
1.
/u01/app/oraInventory/orainstRoot.sh
2. /u01/app/19.0.0/grid/root.sh
Execute
/u01/app/oraInventory/orainstRoot.sh on the following nodes:
[rac2]
Execute
/u01/app/19.0.0/grid/root.sh on the following nodes:
[rac2]
The scripts
can be executed in parallel on all the nodes.
Successfully Setup Software with warning(s).
.................................................. 100% Done.
2、Oracle组件在线推送安装
su - oracle
cd $ORACLE_HOME/addnode
./addnode.sh -silent -ignoreSysPrereqs -ignorePrereqFailure
"CLUSTER_NEW_NODES={rac2}"
--告警忽略
[WARNING] [INS-13013] Target
environment does not meet some mandatory
requirements.
CAUSE: Some of the mandatory prerequisites are not met. See logs for details.
/u01/app/oraInventory/logs/addNodeActions2020-11-05_11-44-31AM.log
ACTION: Identify the list of failed prerequisite checks
from the log:
/u01/app/oraInventory/logs/addNodeActions2020-11-05_11-44-31AM.log. Then either from the log file or from installation manual find the appropriate
configuration to meet the prerequisites and fix it manually.
Setup Oracle Base successful.
.................................................. 96% Done.
--记得执行脚本
As a root user, execute the following script(s):
1. /u01/app/oracle/product/19.0.0/db_1/root.sh
Execute
/u01/app/oracle/product/19.0.0/db_1/root.sh on the following nodes:
[rac2]
Successfully Setup Software with warning(s).
.................................................. 100% Done.
5、正常节点为新添加节点创建实例
--在节点1,也就是正常的那个节点操作:
--不是异常节点
su - oracle
dbca
-silent -addInstance -gdbName "orcl" -nodeName "rac2" -instanceName
"orcl2" -sysDBAUserName "sys" -sysDBAPassword
"oracle"
至此,异常数据库节点的删除、重新添加完成。




