sitemap

RSS地图

收藏本站

设为首页

Oracle研究中心

当前位置:Oracle研究中心 > 产品DBA > Oracle RAC >

案例讲解 OracleRAC11g删除节点 操作过程与注意事项

时间:2016-03-25 21:44   来源:Oracle研究中心   作者:网络   点击:

天萃荷净

   Oracle 11G RAC 删除节点简单为分3个步骤

        删除实例、删除DB软件、删除GI软件。


        增加节点:http://oracleplus.net/arch/aljj_OracleRAC11gzjjd_czgcyzysx_22.html

  实验环境

  数据库:11.2.0.4 RAC双节点

  系统 :OEL6.5

  一般对CRS层面数据结构做重要操作之前一定要先备份OCR

  [root@enmoedu1 ~]# ocrconfig -manual backup

  enmoedu2 2015/08/2613:32:57 /u01/app/11.2.0/grid/cdata/enmoedu-cluster/backup_20150826_133257.ocr

  

  一. 删除实例

  step1. 关闭被删除实例

  [grid@enmoedu1 ~]$ srvctl status database -d PROD -f

  Instance PROD1 is running on node enmoedu1

  Instance PROD2 is running on node enmoedu2

  [grid@enmoedu1 ~]$ srvctl stopinstance -d PROD -n enmoedu2

  [grid@enmoedu1 ~]$ srvctl statusdatabase -d PROD -f

  Instance PROD1 is running on node enmoedu1

  Instance PROD2 is not running on node enmoedu2

  step2. 删除实例

  [oracle@enmoedu1 ~]$ dbca -silent-delete Instance -nodeList enmoedu2.us.oracle.com -gdbName PROD-instanceName PROD2 -sysDBAUserName sys -sysDBAPasswordoracle

  Deleting instance

  20% complete

  21% complete

  22% complete

  26% complete

  33% complete

  40% complete

  46% complete

  53% complete

  60% complete

  66% complete

  Completing instance management.

  100% complete

  Look at the log file"/u01/app/oracle/cfgtoollogs/dbca/PROD.log" for furtherdetails.

  step3. 再次检查

  [oracle@enmoedu1 ~]$ srvctl status database -d PROD -f

  Instance PROD1 is running on node enmoedu1

  二. 删除DB软件

  step1. 更新inventory

  [oracle@enmoedu2 ~]$$ORACLE_HOME/oui/bin/runInstaller -updateNodeListORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=enmoedu2"-local

  Starting Oracle Universal Installer...

  Checking swap space: must be greater than 500 MB. Actual 9999 MB Passed

  The inventory pointer is located at /etc/oraInst.loc

  The inventory is located at /u01/app/oraInventory

  'UpdateNodeList' was successful.

  step2. 卸载DB软件

  [oracle@enmoedu2 ~]$$ORACLE_HOME/deinstall/deinstall -local

  Checking for required files and bootstrapping ...

  Please wait ...

  Location of logs /u01/app/oraInventory/logs/

  ############ ORACLE DEINSTALL & DECONFIG TOOL START############

  .

  .

  Oracle deinstall tool successfully cleaned up temporarydirectories.

  #######################################################################

  ############# ORACLE DEINSTALL & DECONFIG TOOL END#############

  step3. 更新inventory

  [oracle@enmoedu1 ~]$$ORACLE_HOME/oui/bin/runInstaller -updateNodeListORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=enmoedu1"-local

  Starting Oracle Universal Installer...

  Checking swap space: must be greater than 500 MB. Actual 9999 MB Passed

  The inventory pointer is located at /etc/oraInst.loc

  The inventory is located at /u01/app/oraInventory

  'UpdateNodeList' was successful.

  step4. 如果卸载不干净,需要人为手工执行下面命令

  [oracle@enmoedu2 ~]$ rm -rf$ORACLE_HOME/*

  三. 删除GI软件

  step1. 检查被删除节点状态

  [grid@enmoedu1 ~]$ olsnodes -s-t

  enmoedu1 Active Unpinned

  enmoedu2 Active Unpinned

  step2. 节点被PIN住,需要UNPIN

  [root@enmoedu1 ~]# crsctl unpin css-n enmoedu2

  step3. 停止被删节点HAS服务

  [root@enmoedu2 ~]# exportORACLE_HOME=/u01/app/11.2.0/grid

  [root@enmoedu2 ~]# cd$ORACLE_HOME/crs/install

  [root@enmoedu2 install]# perlrootcrs.pl -deconfig -force

  Using configuration parameter file: ./crsconfig_params

  Network exists: 1/192.168.0.0/255.255.255.0/bond0, typestatic

  VIP exists:/enmoedu1-vip/192.168.0.12/192.168.0.0/255.255.255.0/bond0, hostingnode enmoedu1

  VIP exists:/enmoedu2-vip/192.168.0.13/192.168.0.0/255.255.255.0/bond0, hostingnode enmoedu2

  .

  .

  CRS-4133: Oracle High Availability Services has beenstopped.

  Removing Trace File Analyzer

  Successfully deconfigured Oracle clusterware stack on thisnode

  step4. 检查集群资源状态

  [grid@enmoedu1 ~]$ crsctl statusresource -t

  --------------------------------------------------------------------------------

  NAME TARGET STATE SERVER STATE_DETAILS

  --------------------------------------------------------------------------------

  Local Resources

  --------------------------------------------------------------------------------

  ora.DATA.dg

  ONLINE ONLINE enmoedu1

  ora.FRA.dg

  ONLINE ONLINE enmoedu1

  ora.LISTENER.lsnr

  ONLINE ONLINE enmoedu1

  ora.OCR.dg

  ONLINE ONLINE enmoedu1

  ora.asm

  ONLINE ONLINE enmoedu1 Started

  ora.gsd

  OFFLINE OFFLINE enmoedu1

  ora.net1.network

  ONLINE ONLINE enmoedu1

  ora.ons

  ONLINE ONLINE enmoedu1

  --------------------------------------------------------------------------------

  Cluster Resources

  --------------------------------------------------------------------------------

  ora.LISTENER_SCAN1.lsnr

  1 ONLINE ONLINE enmoedu1

  ora.LISTENER_SCAN2.lsnr

  1 ONLINE ONLINE enmoedu1

  ora.LISTENER_SCAN3.lsnr

  1 ONLINE ONLINE enmoedu1

  ora.cvu

  1 ONLINE ONLINE enmoedu1

  ora.enmoedu1.vip

  1 ONLINE ONLINE enmoedu1

  ora.oc4j

  1 ONLINE ONLINE enmoedu1

  ora.prod.db

  1 ONLINE ONLINE enmoedu1 Open

  ora.scan1.vip

  1 ONLINE ONLINE enmoedu1

  ora.scan2.vip

  1 ONLINE ONLINE enmoedu1

  ora.scan3.vip

  1 ONLINE ONLINE enmoedu1

  step5. 检查集群下所有节点状态

  [grid@enmoedu1 ~]$ olsnodes-s

  enmoedu1 Active

  enmoedu2 Inactive

  step6. 更新inventory

  [grid@enmoedu2 ~]$$ORACLE_HOME/oui/bin/runInstaller -updateNodeListORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=enmoedu2" CRS=TRUE -silent-local

  Starting Oracle Universal Installer...

  Checking swap space: must be greater than 500 MB. Actual 9999 MB Passed

  The inventory pointer is located at /etc/oraInst.loc

  The inventory is located at /u01/app/oraInventory

  'UpdateNodeList' was successful.

  step7. 卸载GI软件

  [grid@enmoedu2 ~]$$ORACLE_HOME/deinstall/deinstall –local

  Checking for required files and bootstrapping ...

  Please wait ...

  Location of logs/tmp/deinstall2015-08-26_02-04-52PM/logs/

  ############ ORACLE DEINSTALL & DECONFIG TOOL START############

  .

  Oracle deinstall tool successfully cleaned up temporarydirectories.

  #######################################################################

  ############# ORACLE DEINSTALL & DECONFIG TOOL END#############

  step8. 更新inventory

  [grid@enmoedu1 ~]$$ORACLE_HOME/oui/bin/runInstaller -updateNodeListORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=enmoedu1" CRS=TRUE-silent

  Starting Oracle Universal Installer...

  Checking swap space: must be greater than 500 MB. Actual 9999 MB Passed

  The inventory pointer is located at /etc/oraInst.loc

  The inventory is located at /u01/app/oraInventory

  'UpdateNodeList' was successful.

  step9. 检查集群下所有节点状态

  [grid@enmoedu1 ~]$ olsnodes-s

  enmoedu1 Active

  enmoedu2 Inactive

  step10. 如果卸载不干净,需要人为手工执行下面命令

  ps -ef |grep ora |awk '{print $2}'|xargs kill -9

  ps -ef |grep grid |awk '{print $2}'|xargs kill -9

  ps -ef |grep asm |awk '{print $2}'|xargs kill -9

  ps -ef |grep storage |awk '{print$2}' |xargs kill -9

  ps -ef |grep ohasd |awk '{print $2}'|xargs kill -9

  ps -ef |grep grid

  ps -ef |grep ora

  ps -ef |grep asm

  exportORACLE_BASE=/u01/app/grid

  exportORACLE_HOME=/u01/app/11.2.0/grid

  cd $ORACLE_HOME

  rm -rf *

  cd $ORACLE_BASE

  rm -rf *

  rm -rf/etc/rc5.d/S96ohasd

  rm -rf/etc/rc3.d/S96ohasd

  rm -rf/rc.d/init.d/ohasd

  rm -rf /etc/oracle

  rm -rf /etc/ora*

  rm -rf /etc/oratab

  rm -rf/etc/oraInst.loc

  rm -rf/opt/ORCLfmap/

  rm -rf/taryartar/12c/oraInventory

  rm -rf/usr/local/bin/dbhome

  rm -rf/usr/local/bin/oraenv

  rm -rf/usr/local/bin/coraenv

  rm -rf /tmp/*

  rm -rf/var/tmp/.oracle

  rm -rf /var/tmp

  rm -rf /home/grid/*

  rm -rf/home/oracle/*

  rm -rf/etc/init/oracle*

  rm -rf/etc/init.d/ora

  rm -rf /tmp/.*

  step11. 从集群中删除节点

  [root@enmoedu1 ~]#/u01/app/11.2.0/grid/bin/crsctl delete node -nenmoedu2

  CRS-4661: Node enmoedu2 successfully deleted.

  step12. 检查集群下所有节点状态

  [root@enmoedu1 ~]# olsnodes-s

  enmoedu1 Active

  step13. 检查节点删除是否成功

  这步非常重要,关系以后是否可以顺利增加节点到集群中。

  [grid@enmoedu1 ~]$ cluvfy stage -postnodedel -n enmoedu2 -verbose

  Performing post-checks for noderemoval

  Checking CRS integrity...

  Clusterware version consistency passed

  The Oracle Clusterware is healthy on node "enmoedu1"

  CRS integrity check passed

  Result:

  Node removal check passed

  Post-check for node removal wassuccessful.

  step14. 备份OCR

  [root@enmoedu1 ~]# ocrconfig-manualbackup

  enmoedu1 2015/08/2614:25:53 /u01/app/11.2.0/grid/cdata/enmoedu-cluster/backup_20150826_142553.ocr

  enmoedu2 2015/08/2613:32:57 /u01/app/11.2.0/grid/cdata/enmoedu-cluster/backup_20150826_133257.ocr


-----------------温馨提示--------------------
操作有风险,动手需谨慎
Oracle研究中心 www.oracleplus.net
本文由大师惜分飞分享,转载请尽量保留本站网址。


--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之案例讲解 OracleRAC11g删除节点 操作过程与注意事项

本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/23.html

Oracle研究中心

关键词:

案例讲解

OracleRAC11g删除节点