ORACLE RAC 删除 RAC 节点

wojiaoao

贡献于2015-01-08

字数:0 关键词: Oracle 数据库服务器

ORACLE RAC 删除 RAC 节点 删除 RAC 节点有分为 2 种情况,一种是 2 台 RAC 节点都完好,但是要删除其中一 个节点,另外一种情况是,某个 RAC 节点由于硬件问题或者软件问题出现问题导 致机器已经关闭。 2 种情况的删除其实都可以使用后一种方法来做,即直接通过操作来清除 OCR 和 voting disk 的 RAC 节点信息。但是当你一个完好的 RAC 我们还是使用正规的删除方 法。 先介绍一个完好无损的 RAC 删除节点的方法: [root@rac1 ~]# /u01/app/crs/bin/crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.orcl.db application ONLINE ONLINE rac1 ora....l1.inst application ONLINE ONLINE rac1 ora....l2.inst application ONLINE ONLINE rac2 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 ora....SM2.asm application ONLINE ONLINE rac2 ora....C2.lsnr application ONLINE ONLINE rac2 ora.rac2.gsd application ONLINE ONLINE rac2 ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip application ONLINE ONLINE rac2 以上是一个非常正常的 RAC。下面来删除节点 RAC2. 在删除之前简单介绍一下 RAC 结构的构成,在 RAC 当中,每个服务诸如 database,listener,ons,gsd 等都是一个 service 注册在 OCR 当中以及节点信息存储在 voting disk。所以在删除时也同样是以删除注册信息的方式来达到目的。 一般的删除步骤为:删除 database--->删除 ORACLE_HOME 信息—>删除 CRS_HOME 信 息 综合上面,其实就是先清除 ORACLE 本身服务信息,然后再清除 CRS 服务信息. 下面开始删除动作: 1) 启动 dbca(在保留节点启动),删除 instance. 检查 CRS 状态: [root@rac2 ~]# /u01/app/crs/bin/crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.orcl.db application ONLINE ONLINE rac1 ora....l1.inst application ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 ora....SM2.asm application ONLINE ONLINE rac2 ora....C2.lsnr application ONLINE ONLINE rac2 ora.rac2.gsd application ONLINE ONLINE rac2 ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip application ONLINE ONLINE rac2 可以看到 rac2 的 instance 信息已经消失了。表示删除 instance 完毕。 2)删除 RAC2 的 ASM 先停止 RAC2 的 ASM instance: srvctl stop asm -n rac2 删除 ASM home 目录:[oracle@rac2 admin]$ pwd /u01/app/oracle/admin , rm -rf +ASM 3) 删除 rac2 listener,启动 netca(在删除节点运行) 检查 CRS 服务: [oracle@rac1 ~]$ /u01/app/crs/bin/crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.orcl.db application ONLINE ONLINE rac1 ora....l1.inst application ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 ora....SM2.asm application OFFLINE OFFLINE ora....C2.lsnr application OFFLINE OFFLINE ora.rac2.gsd application ONLINE ONLINE rac2 ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip application ONLINE ONLINE rac2 可以看到 ASM 和 listener_rac2 已经 OFFline 但是此时 listener 只是 offline,并没有从 OCR 移除,通过下面方法来移除: /u01/app/crs/bin/crs_unregister ora.rac2.LISTENER_RAC2.lsnr (ORACLE RAC 修改 listener 只有通过 NETCA 才可以做到,所以也可以通过进入 cluster instance 去删除 listener,然后在保留节点新建 listener 方法,这样就可以直 接移除 OCR 信息,而不需要通过/u01/app/crs/bin/crs_unregister ) srvctl remove asm -n rac2 移除 ASM 实例 Name Type Target State Host ------------------------------------------------------------ ora.orcl.db application ONLINE ONLINE rac1 ora....l1.inst application ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 ora.rac2.vip application OFFLINE OFFLINE 4)更新 ORACLE_HOME 信息(保留节点运行) [oracle@rac1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 "CLUSTER_NODES=rac1" Starting Oracle Universal Installer... No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed. 'UpdateNodeList' was successful. 5) 移除 VIP 信息和 ONS 服务 racgons remove_config rac2:6200 (保留节点运行) oifcfg delif -node rac2 (保留节点运行) 6) 删除 RAC2 节点 CRS 服务,进入/u01/app/crs/install 目录,执行 rootdelete.sh [root@rac2 install]# ./rootdelete.sh (在删除节点运行) CRS-0210: Could not find resource 'ora.rac2.LISTENER_RAC2.lsnr'. Shutting down Oracle Cluster Ready Services (CRS): Stopping resources. Successfully stopped CRS resources Stopping CSSD. Shutting down CSS daemon. Shutdown request successfully issued. Shutdown has begun. The daemons should exit soon. Checking to see if Oracle CRS stack is down... Oracle CRS stack is not running. Oracle CRS stack is down now. Removing script for Oracle Cluster Ready services Updating ocr file for downgrade Cleaning up SCR settings in '/etc/oracle/scls_scr' [oracle@rac1 bin]$ /u01/app/crs/bin/crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.orcl.db application ONLINE ONLINE rac1 ora....l1.inst application ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 ora....SM2.asm application OFFLINE OFFLINE ora.rac2.vip application OFFLINE OFFLINE 可以看到 nodeapps 服务全部已经从 OCR 删除了。 移除 VIP: [root@rac1 ~]# /u01/app/crs/bin/ Display all 125 possibilities? (y or n) [root@rac1 ~]# /u01/app/crs/bin/srvctl remove nodeapps -n rac2 Please confirm that you intend to remove the node-level applications on node rac2 (y/[n]) y PRKO-2112 : Some or all node applications are not removed successfully on node: rac2 [root@rac1 ~]# /u01/app/crs/bin/crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.orcl.db application ONLINE ONLINE rac1 ora....l1.inst application ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 所有 RAC2 信息已经移除。 最后就是删除 node 了,在保留节点运行更新 OCR : [root@rac1 ~]# /u01/app/crs/install/rootdeletenode.sh rac2,2 CRS-0210: Could not find resource 'ora.rac2.LISTENER_RAC2.lsnr'. CRS-0210: Could not find resource 'ora.rac2.ons'. CRS-0210: Could not find resource 'ora.rac2.vip'. CRS-0210: Could not find resource 'ora.rac2.gsd'. CRS-0210: Could not find resource ora.rac2.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.noderac2 marked for deletion is not there. Ignoring. Successfully deleted 5 keys from OCR. Node deletion operation successful. 'rac2,2' deleted successfully [root@rac1 ~]# /u01/app/crs/bin/olsnodes -n rac1 1 删除完毕! [root@rac1 ~]# /u01/app/crs/bin/crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.orcl.db application ONLINE ONLINE rac1 ora....l1.inst application ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 结论,从以上的步骤可以看的出,所有的动作不管是删除 instance,asm,vip,nodeapps 等等 都是通过 ORACLE 命令移除 OCR 的节点信息。 所以,当我们需要删除一个节点,但是这个 节点因为硬件或者软件的问题,机器关机了,我们不可能在删除节点做任何动作了,这样 我们只需要移除 OCR 的信息就可以了。 下面再讲如何删除一个出问题的节点,假设这个节点已经关机了。我们通过从保留节点来 完成这些操作。 [root@rac1 ~]# ping 43.82.127.87 PING 43.82.127.87 (43.82.127.87) 56(84) bytes of data. From 43.82.127.86 icmp_seq=1 Destination Host Unreachable From 43.82.127.86 icmp_seq=2 Destination Host Unreachable 模拟 RAC2 节点已经关闭,public ip 已经不能 ping 通了。 [root@rac1 ~]# /u01/app/crs/bin/crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.orcl.db application ONLINE ONLINE rac1 ora....l1.inst application ONLINE ONLINE rac1 ora....l2.inst application ONLINE OFFLINE ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 ora....SM2.asm application ONLINE OFFLINE ora....C2.lsnr application ONLINE OFFLINE ora.rac2.gsd application ONLINE OFFLINE ora.rac2.ons application ONLINE OFFLINE ora.rac2.vip application ONLINE OFFLINE 所有 RAC2 节点的服务已经 OFFLINE。 下面开始删除过程: [root@rac1 ~]# /u01/app/crs/bin/srvctl remove nodeapps -n rac2 [root@rac1 ~]# /u01/app/crs/bin/crs_unregister ora.orcl.orcl2.inst [root@rac1 ~]# /u01/app/crs/bin/crs_unregister ora.rac2.ASM2.asm [root@rac1 ~]# /u01/app/crs/bin/crs_unregister ora.rac2.vip 通过以上方法取消 RAC2 的信息注册。 [oracle@rac1 bin]$ /u01/app/crs/bin/crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.orcl.db application ONLINE ONLINE rac1 ora....l1.inst application ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 可以发现 RAC2 的信息已经全部逐出 OCR。 但是并没有完成所有的工作,还需要像开始一 样更新 CRS_HOME 和 ORACLE_HOME [oracle@rac1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 "CLUSTER_NODES=rac1" Starting Oracle Universal Installer... No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed. 'UpdateNodeList' was successful. [oracle@rac1 bin]$ cd /u01/app/crs/oui/bin/ [oracle@rac1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/crs "CLUSTER_NODES=rac1" Starting Oracle Universal Installer... No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed. 'UpdateNodeList' was successful. [oracle@rac1 bin]$ /u01/app/crs/bin/olsnodes -n rac1 1 rac2 2 至此还有 2 个节点的信息,使用以下命令删除: [root@rac1 ~]# /u01/app/crs/install/rootdeletenode.sh rac2,2 CRS-0210: Could not find resource 'ora.rac2.LISTENER_RAC2.lsnr'. CRS-0210: Could not find resource 'ora.rac2.ons'. CRS-0210: Could not find resource 'ora.rac2.vip'. CRS-0210: Could not find resource 'ora.rac2.gsd'. CRS-0210: Could not find resource ora.rac2.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.noderac2 marked for deletion is not there. Ignoring. Successfully deleted 5 keys from OCR. Node deletion operation successful. 'rac2,2' deleted successfully [oracle@rac1 bin]$ /u01/app/crs/bin/olsnodes -n rac1 1 到此节点删除完毕。 通过以上可以看出,这种删除不过是把 OCR 信息移除。

下载文档,方便阅读与编辑

文档的实际排版效果,会与网站的显示效果略有不同!!

需要 8 金币 [ 分享文档获得金币 ] 0 人已下载

下载文档

相关文档