NOTE: 本实例是删的rac002,rac001是保留库
环境:
RHEL 6.5
ORACLE 11.2.0.4
1. 停库
[grid@rac002 ~]$ srvctl stop instance -d orcl -n rac002
2. 删除实例
2.1 验证OCR备份:
[grid@rac002 ~]$ ocrconfig -showbackup
rac002 2017/01/13 22:40:18 /u01/app/11.2.0/grid/cdata/rac-cluster/backup00.ocr
rac002 2017/01/13 22:40:18 /u01/app/11.2.0/grid/cdata/rac-cluster/day.ocr
rac002 2017/01/13 22:40:18 /u01/app/11.2.0/grid/cdata/rac-cluster/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available
2.2 步骤:在保留节点上
图形界面:需要保证被删节点的监听没停
DBCA -->
Oracle Real Application Clusters Database-->
Instance Management-->选中实例,删除
或者: 还可以使用dbca的静默模式进行删除实例:
dbca -silent -deleteInstance [-nodeList node_name] -gdbName gdb_name
-instanceName instance_name -sysDBAUserName sysdba -sysDBAPassword password
示例:
[oracle@rac001 ~]$ dbca -silent -deleteInstance -nodeList rac002 -gdbName orcl -instanceName orcl1 -sysDBAUserName sys -sysDBAPassword oracle
2.3 禁用被删除实例的线程
SQL> ALTER DATABASE DISABLE THREAD
2;
2.4 验证现有实例,应该被删除了才对
[grid@rac001 ~]$ srvctl config database -d orcl
3 移除RAC
此过程从要从集群中删除的节点中删除Oracle RAC,
并更新其余节点上的清单。
3.1 禁用将被删除节点上的监听:
$ srvctl disable listener -l
listener_name
-n
name_of_node_to_delete
$ srvctl stop listener -l
listener_name -n
name_of_node_to_delete
例如:
[grid@rac002 ~]$ srvctl disable listener -l
LISTENER -n
rac002
[grid@rac002 ~]$ srvctl stop listener -l
LISTENER -n
rac002
3.2 更新被删节点清单
--意图不理解,官方文档这么个流程,注意别漏了最后的-local
在
要删除的节点上的$ORACLE_HOME/oui/bin中运行以下命令以更新该节点上的清单:
$ ./runInstaller -updateNodeList ORACLE_HOME=Oracle_home_location "
CLUSTER_NODES={name_of_node_to_delete}" -local
例如
[grid@rac002 ~]$ cd $ORACLE_HOME/oui/bin
[grid@rac002 bin]$ pwd
/u01/app/11.2.0/grid/oui/bin
[grid@rac002 bin]$ export LANG=zh_CN.UTF-8
[grid@rac002 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/11.2.0/grid "CLUSTER_NODES={rac002}" -local
正在启动 Oracle Universal Installer...
检查交换空间: 必须大于 500 MB。 实际为 3999 MB 通过
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' 成功。
3.3 开删
根据您是否具有共享或非共享Oracle主目录,请完成以下两个过程之一以删除Oracle RAC软件:
3.3.1 共享主节点的情况
对于
共享主节点,通过在要删除的每个节点上的$ ORACLE_HOME/oui/bin目录中运行以下命令来分离节点,而不是卸载节点:
没用过,无尝试
$ ./runInstaller -detachHome ORACLE_HOME=Oracle_home_location
3.3.2 非共享情况--也是常见情况
对于非共享主目录,从$ORACLE_HOME/deinstall目录运行以下命令,从要删除的节点中卸载Oracle主目录:
$ ./deinstall -local
建议:对于此步骤,建议英文水平差的开中文
export LANG=zh_CN.UTF-8
3.4 更新清单
从群集中任何一个剩余节点上的$ORACLE_HOME/oui/bin目录运行以下命令,以更新这些节点的清单,并指定以逗号分隔的剩余节点名称列表:
$ ./runInstaller -updateNodeList ORACLE_HOME=Oracle_home_location "
CLUSTER_NODES={remaining_node_list}"
例子:
[grid@rac001 ~]$ cd $ORACLE_HOME/oui/bin
[grid@rac001 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={rac001}"
注意查看节点信息:
[grid@rac004 ~]$
olsnodes -i
rac001
rac001-vip
rac002
[grid@rac004 ~]$
olsnodes -n -t -s
rac001
1
Active Unpinned
rac002
2
Inactive
Unpinned
[root@rac004 install]# cd /u01/app/11.2.0/grid/bin/
[root@rac004 bin]
# ./crsctl delete node -n rac002
[root@rac004 bin]# su - grid
[grid@rac004 ~]$ olsnodes -i
rac001
rac001-vip
[grid@rac004 ~]$ olsnodes -n -t -s
rac001
1
Active
Unpinned
删除节点完成!!!
[grid@rac001 bin]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac001
ora.FRA.dg
ONLINE ONLINE rac001
ora.LISTENER.lsnr
ONLINE ONLINE rac001
ora.OCR.dg
ONLINE ONLINE rac001
ora.asm
ONLINE ONLINE rac001 Started
ora.gsd
OFFLINE OFFLINE rac001
ora.net1.network
ONLINE ONLINE rac001
ora.ons
ONLINE ONLINE rac001
ora.registry.acfs
ONLINE ONLINE rac001
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac001
ora.cvu
1 ONLINE ONLINE rac001
ora.oc4j
1 ONLINE ONLINE rac001
ora.orcl.db
2 ONLINE ONLINE rac001 Open
ora.rac001.vip
1 ONLINE ONLINE rac001
ora.scan1.vip
1 ONLINE ONLINE rac001