在前面的两篇文章中,演示了如何向rac环境中添加一个新的节点,集群除了兼备负载均衡,故障转移的特点外,更应该有易于扩展和收缩的属性;本文中讲演示如何将之前添加的节点3彻底删除,使用的数据库版本和操作系统版本均和前面添加节点所使用的环境一致!如何添加节点,请参考下面两篇文章:
http://ylw6006.blog.51cto.com/470441/730519
http://ylw6006.blog.51cto.com/470441/730564
一:关闭rac3节点的数据库实例和ASM实例
[oracle@rac1 ~]$ crs_stat -t -v [oracle@rac1 ~]$ srvctl status database -d racdb [oracle@rac1 ~]$ srvctl status asm -n rac3 |
二:修改spfile文件的相关参数
[oracle@rac1 ~]$ sqlplus /nolog SQL> conn /as sysdba SQL> show parameter spfile; NAME TYPE VALUE SQL> select name,value from v$spparameter where sid='racdb3'; NAME VALUE SQL> alter system reset thread scope=spfile sid='racdb3'; SQL> alter system reset instance_number scope=spfile sid='racdb3'; SQL> alter system reset undo_tablespace scope=spfile sid='racdb3'; SQL> alter system reset service_names scope=spfile sid='racdb3'; SQL> alter system reset local_listener scope=spfile sid='racdb3'; SQL> select sid,name,value from v$spparameter where name='cluster_database_instances'; SID NAME VALUE |
三:关闭rac3节点的监听器并验证
[oracle@rac1 ~]$ srvctl stop listener -n rac3 [oracle@rac1 ~]$ crs_stat -t -v Name Type R/RA F/FT Target State Host ---------------------------------------------------------------------- ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1 ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1 ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1 ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1 ora.rac1.vip application 0/0 0/0 ONLINE ONLINE rac1 ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2 ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2 ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2 ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2 ora.rac2.vip application 0/0 0/0 ONLINE ONLINE rac2 ora....SM3.asm application 0/5 0/0 OFFLINE OFFLINE ora....C3.lsnr application 0/5 0/0 OFFLINE OFFLINE ora.rac3.gsd application 0/5 0/0 ONLINE ONLINE rac3 ora.rac3.ons application 0/3 0/0 ONLINE ONLINE rac3 ora.rac3.vip application 0/0 0/0 ONLINE ONLINE rac3 ora.racdb.db application 0/1 0/1 ONLINE ONLINE rac1 ora....b1.inst application 0/5 0/0 ONLINE ONLINE rac1 ora....b2.inst application 0/5 0/0 ONLINE ONLINE rac2 ora....b3.inst application 0/5 0/0 OFFLINE OFFLINE |
四:使用srvctl工具删除rac3节点上的数据库实例和ASM实例
[oracle@rac1 ~]$ srvctl status database -d racdb [oracle@rac1 ~]$ srvctl status asm -n rac3 [oracle@rac1 ~]$ crs_stat -t -v |
五:使用netca命令删除rac3节点上的监听器配置
[oracle@rac1 ~]$ netca
后台日志信息如下 验证: 清除rac配置信息 |
六:在rac3节点上以root用户身份运行删除节点脚本
[root@rac3 ~]# cd /u01/app/oracle/product/10.2.0/crs_1/install Checking to see if Oracle CRS stack is down... |
备注:在清除rac节点前,需要利用netca来删除监听,否则会报错如下!
CRS resources for listeners are still configured. You must remove the CRS listener resources before deconfiging CRS stack. Use NETCA to remove them.
1
七:在节点1上更新OCR信息
[root@rac1 ~]# cd /u01/app/oracle/product/10.2.0/crs_1/install [root@rac1 install]# ./rootdeletenode.sh rac3,3 CRS-0210: Could not find resource 'ora.rac3.LISTENER_RAC3.lsnr'. CRS-0210: Could not find resource 'ora.rac3.ons'. CRS-0210: Could not find resource 'ora.rac3.vip'. CRS-0210: Could not find resource 'ora.rac3.gsd'. CRS-0210: Could not find resource ora.rac3.vip. CRS nodeapps are deleted successfully clscfg: EXISTING configuration version 3 detected. clscfg: version 3 is 10G Release 2. Successfully deleted 14 values from OCR. Key SYSTEM.css.interfaces.noderac3 marked for deletion is not there. Ignoring. Successfully deleted 5 keys from OCR. Node deletion operation successful. 'rac3,3' deleted successfully |
更新CRS:
[oracle@rac1 ~]$ cd $ORA_CRS_HOME/oui/bin No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed. |
八:验证
[oracle@rac1 ~]$ crs_stat -t -v [oracle@rac1 ~]$ olsnodes -n |
参考文章:
http://yangtingkun.itpub.net/post/468/495334
http://yangtingkun.itpub.net/post/468/495377