点击上方“IT那活儿”公众号--专注于企业全栈运维技术分享,不管IT什么活儿,干就完了!!!
按照11g官方文档来删除To remove Oracle RAC from a cluster node, you must delete the database instance and the Oracle RAC software before removing the node from the cluster.
这里直接在节点2打开的状态删除它,-1-1是陈岩的方法,它是移除节点所有的文件,比较麻烦。
------------------ 分割线 -------------------
删除节点1.1 删除实例
dbca
1.2 禁用log
Verify that the dropped instance's redo thread has been removed by using SQL
not disabled, then disable the thread. For example:
SQL> select thread#from v$log;
THREAD#
1
1
1
1
SQL> alter database disable thread 2;
Database altered.
1.3 删除节点2的监听在保留节点执行:
[grid@rac1 ~]$ srvctl disable listener -l listener -n rac2
[grid@rac1 ~]$ srvctl stop listener -l listener -n rac2
查询集群状态:
[root@rac1 grid]# crsctl stat res -t
---------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
---------------------------------------------------------------
Local Resources
---------------------------------------------------------------
ora.ARCH.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.NEWOCR.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
---------------------------------------------------------------
Cluster Resources
---------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac1
ora.oc4j
1 ONLINE ONLINE rac1
ora.rac.db
1 ONLINE ONLINE rac1 Open
ora.rac.sv1.svc
1 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1
1.4 同步orainventory
节点2:
[oracle@rac2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracl
[grid@rac2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/11.2.0/grid
节点1:
[oracle@rac1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracl
[grid@rac1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/11.2.0/grid
1.5 删除软件
oracle用户:
[oracle@rac2 bin]$$ORACLE_HOME/deinstall/deinstall -local
grid用户:
[grid@rac2 bin]$ $ORACLE_HOME/deinstall/deinstall -local
提示你执行这个脚本:
/tmp/deinstall2017-05-10_09-16-01PM/perl/bin/perl -I/tmp/deinstall2017-05-10
执行完之后回到页面回车
1.6 同步orainventroy
PS:这一步可能不需要做,之前已经同步更新了,但是这里删除用户了,为了安全在执行一次。
节点1:
[oracle@rac1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracl
[grid@rac1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/11.2.0/grid
查看crs是否还有rac2:
[root@rac1 bin]# crsctl stat res -t
---------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
---------------------------------------------------------------
Local Resources
---------------------------------------------------------------
ora.ARCH.dg
ONLINE ONLINE rac1
ora.DATA.dg
ONLINE ONLINE rac1
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ora.NEWOCR.dg
ONLINE ONLINE rac1
ora.asm
ONLINE ONLINE rac1 Started
ora.gsd
OFFLINE OFFLINE rac1
ora.net1.network
ONLINE ONLINE rac1
ora.ons
ONLINE ONLINE rac1
ora.registry.acfs
ONLINE ONLINE rac1
---------------------------------------------------------------
Cluster Resources
---------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac1
ora.oc4j
1 ONLINE ONLINE rac1
ora.rac.db
1 ONLINE ONLINE rac1 Open
ora.rac.sv1.svc
1 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.scan1.vip
1 ONLINE ONLINE rac1
rac2已经删除干净。
添加节点2.1 添加节点
[grid@rac1 bin]$ ./addNode.sh -silent "CLUSTER_NEW_NODES={rac2}" "CLUSTER_NE
The following configuration scripts need to be executed as the "root" user i
/u01/11.2.0/grid/root.sh #On nodes rac2
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts in each cluster node
The Cluster Node Addition of u01/11.2.0/grid was successful.
Please check '/tmp/silentInstall.log' for more details.
按照要求在节点2以root用户运行脚本:
[root@rac2 ~]# u01/11.2.0/grid/root.sh
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
2.2 为节点2安装数据库软件在保留节点rac1为节点2按照数据库软件:
[root@rac1 ~]#su - oracle
[oracle@rac1 ~]$ cd $ORACLE_HOME
[oracle@rac1 db_1]$ cd oui/bin/
[oracle@rac1 bin]$ ./addNode.sh -silent "CLUSTER_NEW_NODES={rac2}"
he following configuration scripts need to be executed as the "root" user in
/u01/app/oracle/product/11.2.0/db_1/root.sh #On nodes rac2
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts in each cluster node
The Cluster Node Addition of /u01/app/oracle/product/11.2.0/db_1 was success
Please check '/tmp/silentInstall.log' for more details.
在节点2以root用户运行这个脚本:
2.3 dbca在节点1为节点2添加实例2.4 检查集群状态实例添加完成,查看节点2的状态:
[root@rac2 grid]# crsctl stat res -t
---------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
---------------------------------------------------------------
Local Resources
---------------------------------------------------------------
ora.ARCH.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.NEWOCR.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
---------------------------------------------------------------
Cluster Resources
---------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac1
ora.oc4j
1 ONLINE ONLINE rac1
ora.rac.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.rac.sv1.svc
1 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1
集群起来了。
[oracle@rac2 db_1]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed May 10 22:26:54 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Manageme
Data Mining and Real Application Testing options
SQL> select open_mode from v$database;
OPEN_MODE
READ WRITE
数据库也打开了。至此集群的添加和删除完成。
END