Oracle RAC集群删除节点
一,节点环境
[root@node1 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.194 node2 192.168.0.193 node1 192.168.0.183 node1vip 192.168.0.182 node2vip 172.168.0.194 node2prv 172.168.0.193 node1prv 192.168.0.176 dbscan 192.168.0.16 standby
二,操作实例
01,dbca 删除节点host02
登入oracle 用户运行dbca-->进行删除数据库-->delete databases 下一步
!!!----------------------------注意--------------------------!!!
选择数据库请认真核对.确定数据安全性!!,删除前再三思考!!选项是英文,请看懂英文再选择!!
输入用户sys,密码123456,具体根据自己的来填写
为啥到这一步出问题了呢,因为我在node2节点删除node2节点,自己删自己当然不允许啦,现在我换个节点node1操作把
到了node1删除的时候会发现自动选择node2节点
node1 上查看节点是否存在
----------------------------------------------------
三,清理
01,发现节点还在,资源也还在
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 [grid@node1 ~]$ crsctl status resource -t 2 -------------------------------------------------------------------------------- 3 NAME TARGET STATE SERVER STATE_DETAILS 4 -------------------------------------------------------------------------------- 5 Local Resources 6 -------------------------------------------------------------------------------- 7 ora.LISTENER.lsnr 8 ONLINE ONLINE node1 9 ONLINE ONLINE node2 10 ora.OCR_VOTE.dg 11 ONLINE ONLINE node1 12 ONLINE ONLINE node2 13 ora.ORADATA01.dg 14 ONLINE ONLINE node1 15 ONLINE ONLINE node2 16 ora.ORADATA02.dg 17 ONLINE ONLINE node1 18 ONLINE ONLINE node2 19 ora.asm 20 ONLINE ONLINE node1 Started 21 ONLINE ONLINE node2 Started 22 ora.gsd 23 OFFLINE OFFLINE node1 24 OFFLINE OFFLINE node2 25 ora.net1.network 26 ONLINE ONLINE node1 27 ONLINE ONLINE node2 28 ora.ons 29 ONLINE ONLINE node1 30 ONLINE ONLINE node2 31 ora.registry.acfs 32 ONLINE ONLINE node1 33 ONLINE ONLINE node2 34 -------------------------------------------------------------------------------- 35 Cluster Resources 36 -------------------------------------------------------------------------------- 37 ora.LISTENER_SCAN1.lsnr 38 1 ONLINE ONLINE node1 39 ora.cvu 40 1 ONLINE ONLINE node1 41 ora.node1.vip 42 1 ONLINE ONLINE node1 43 ora.node2.vip 44 1 ONLINE ONLINE node2 45 ora.oc4j 46 1 ONLINE ONLINE node1 47 ora.oracle.db 48 1 ONLINE ONLINE node1 Open 49 ora.scan1.vip 50 1 ONLINE ONLINE node1 51 [grid@node1 ~]$
02,停掉监听
格式: srvctl disable listener -l listener_name -n name_of_node_to_delete srvctl stop listener -l listener_name -n name_of_node_to_delete 操作: srvctl disable listener -l listener -n node2 srvctl stop listener -l listener -n node2 查看: [grid@node1 ~]$ crsctl status resource -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE node1 OFFLINE OFFLINE node2 -----停了 ora.OCR_VOTE.dg ONLINE ONLINE node1 ONLINE ONLINE node2 ora.ORADATA01.dg ONLINE ONLINE node1 ONLINE ONLINE node2 ora.ORADATA02.dg ONLINE ONLINE node1 ONLINE ONLINE node2 ora.asm ONLINE ONLINE node1 Started ONLINE ONLINE node2 Started ora.gsd OFFLINE OFFLINE node1 OFFLINE OFFLINE node2 ora.net1.network ONLINE ONLINE node1 ONLINE ONLINE node2 ora.ons ONLINE ONLINE node1 ONLINE ONLINE node2 ora.registry.acfs ONLINE ONLINE node1 ONLINE ONLINE node2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE node1 ora.cvu 1 ONLINE ONLINE node1 ora.node1.vip 1 ONLINE ONLINE node1 ora.node2.vip 1 ONLINE ONLINE node2 ora.oc4j 1 ONLINE ONLINE node1 ora.oracle.db 1 ONLINE ONLINE node1 Open ora.scan1.vip 1 ONLINE ONLINE node1
03,删除Oracle software
操作如下:
1 [oracle@node2 bin]$ cd $ORACLE_HOME/deinstall/ 2 [oracle@node2 deinstall]$ ls 3 bootstrap.pl deinstall.pl jlib response 4 deinstall deinstall.xml readme.txt sshUserSetup.sh 5 [oracle@node2 deinstall]$ ./deinstall -local 6 Checking for required files and bootstrapping ... 7 Please wait ... 8 Location of logs /oracle/app/oraInventory/logs/ 9 10 ############ ORACLE DEINSTALL & DECONFIG TOOL START ############ 11 12 13 ######################### CHECK OPERATION START ######################### 14 ## [START] Install check configuration ## 15 16 17 Checking for existence of the Oracle home location /oracle/app/oracle/product/11.2.0/db_1 18 Oracle Home type selected for deinstall is: Oracle Real Application Cluster Database 19 Oracle Base selected for deinstall is: /oracle/app/oracle 20 Checking for existence of central inventory location /oracle/app/oraInventory 21 Checking for existence of the Oracle Grid Infrastructure home /oracle/11.2.0/grid/crs 22 The following nodes are part of this cluster: node1,node2 23 Checking for sufficient temp space availability on node(s) : 'node1,node2' 24 25 ## [END] Install check configuration ## 26 27 28 Network Configuration check config START 29 30 Network de-configuration trace file location: /oracle/app/oraInventory/logs/netdc_check2019-03-14_04-04-21-PM.log 31 32 Network Configuration check config END 33 34 Database Check Configuration START 35 36 Database de-configuration trace file location: /oracle/app/oraInventory/logs/databasedc_check2019-03-14_04-04-23-PM.log 37 38 Database Check Configuration END 39 40 Enterprise Manager Configuration Assistant START 41 42 EMCA de-configuration trace file location: /oracle/app/oraInventory/logs/emcadc_check2019-03-14_04-04-25-PM.log 43 44 Enterprise Manager Configuration Assistant END 45 Oracle Configuration Manager check START 46 OCM check log file location : /oracle/app/oraInventory/logs//ocm_check4254.log 47 Oracle Configuration Manager check END 48 49 ######################### CHECK OPERATION END ######################### 50 51 52 ####################### CHECK OPERATION SUMMARY ####################### 53 Oracle Grid Infrastructure Home is: /oracle/11.2.0/grid/crs 54 The cluster node(s) on which the Oracle home deinstallation will be performed are:node1,node2 55 Since -local option has been specified, the Oracle home will be deinstalled only on thelocal node, 'node2', and the global configuration will be removed. 56 Oracle Home selected for deinstall is: /oracle/app/oracle/product/11.2.0/db_1 57 Inventory Location where the Oracle home registered is: /oracle/app/oraInventory 58 The option -local will not modify any database configuration for this Oracle home. 59 60 No Enterprise Manager configuration to be updated for any database(s) 61 No Enterprise Manager ASM targets to update 62 No Enterprise Manager listener targets to migrate 63 Checking the config status for CCR 64 node1 : Oracle Home exists with CCR directory, but CCR is not configured 65 node2 : Oracle Home exists with CCR directory, but CCR is not configured 66 CCR check is finished 67 Do you want to continue (y - yes, n - no)? [n]: y 68 A log of this session will be written to: '/oracle/app/oraInventory/logs/deinstall_deconfig2019-03-14_04-04-17-PM.out' 69 Any error messages from this session will be written to: '/oracle/app/oraInventory/logs/deinstall_deconfig2019-03-14_04-04-17-PM.err' 70 71 ######################## CLEAN OPERATION START ######################## 72 73 Enterprise Manager Configuration Assistant START 74 75 EMCA de-configuration trace file location: /oracle/app/oraInventory/logs/emcadc_clean2019-03-14_04-04-25-PM.log 76 77 Updating Enterprise Manager ASM targets (if any) 78 Updating Enterprise Manager listener targets (if any) 79 Enterprise Manager Configuration Assistant END 80 Database de-configuration trace file location: /oracle/app/oraInventory/logs/databasedc_clean2019-03-14_04-04-37-PM.log 81 82 Network Configuration clean config START 83 84 Network de-configuration trace file location: /oracle/app/oraInventory/logs/netdc_clean2019-03-14_04-04-37-PM.log 85 86 De-configuring Local Net Service Names configuration file... 87 Local Net Service Names configuration file de-configured successfully. 88 89 De-configuring backup files... 90 Backup files de-configured successfully. 91 92 The network configuration has been cleaned up successfully. 93 94 Network Configuration clean config END 95 96 Oracle Configuration Manager clean START 97 OCM clean log file location : /oracle/app/oraInventory/logs//ocm_clean4254.log 98 Oracle Configuration Manager clean END 99 Setting the force flag to false 100 Setting the force flag to cleanup the Oracle Base 101 Oracle Universal Installer clean START 102 103 Detach Oracle home '/oracle/app/oracle/product/11.2.0/db_1' from the central inventory on the local node : Done 104 105 Failed to delete the directory '/oracle/app/oracle/product/11.2.0/db_1'. The directory is in use. 106 Delete directory '/oracle/app/oracle/product/11.2.0/db_1' on the local node : Failed <<<< 107 108 Failed to delete the directory '/oracle/app/oracle/product/11.2.0/db_1'. The directory is in use. 109 Failed to delete the directory '/oracle/app/oracle/product/11.2.0/db_1'. The directory is in use. 110 Failed to delete the directory '/oracle/app/oracle/product/11.2.0'. The directory is not empty. 111 Failed to delete the directory '/oracle/app/oracle/product'. The directory is not empty. 112 Failed to delete the directory '/oracle/app/oracle'. The directory is not empty. 113 Delete directory '/oracle/app/oracle' on the local node : Failed <<<< 114 115 Oracle Universal Installer cleanup completed with errors. 116 117 Oracle Universal Installer clean END 118 119 120 ## [START] Oracle install clean ## 121 122 Clean install operation removing temporary directory '/tmp/deinstall2019-03-14_04-04-11PM' on node 'node2' 123 124 ## [END] Oracle install clean ## 125 126 127 ######################### CLEAN OPERATION END ######################### 128 129 130 ####################### CLEAN OPERATION SUMMARY ####################### 131 Cleaning the config for CCR 132 As CCR is not configured, so skipping the cleaning of CCR configuration 133 CCR clean is finished 134 Successfully detached Oracle home '/oracle/app/oracle/product/11.2.0/db_1' from the central inventory on the local node. 135 Failed to delete directory '/oracle/app/oracle/product/11.2.0/db_1' on the local node. 136 Failed to delete directory '/oracle/app/oracle' on the local node. 137 Oracle Universal Installer cleanup completed with errors. 138 139 Oracle deinstall tool successfully cleaned up temporary directories. 140 ####################################################################### 141 142 143 ############# ORACLE DEINSTALL & DECONFIG TOOL END #############
04,删除Grid soft
1 [grid@node2 ~]$ cd $ORACLE_HOME/deinstall 2 [grid@node2 deinstall]$ ls 3 bootstrap.pl deinstall.pl jlib response 4 deinstall deinstall.xml readme.txt sshUserSetup.sh 5 [grid@node2 deinstall]$ ./deinstall -local 6 Checking for required files and bootstrapping ... 7 Please wait ... 8 Location of logs /tmp/deinstall2019-03-14_04-08-22PM/logs/ 9 10 ############ ORACLE DEINSTALL & DECONFIG TOOL START ############ 11 12 13 ######################### CHECK OPERATION START ######################### 14 ## [START] Install check configuration ## 15 16 17 Checking for existence of the Oracle home location /oracle/11.2.0/grid/crs 18 Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Cluster 19 Oracle Base selected for deinstall is: /oracle/11.2.0/11.2.0 20 Checking for existence of central inventory location /oracle/app/oraInventory 21 Checking for existence of the Oracle Grid Infrastructure home /oracle/11.2.0/grid/crs 22 The following nodes are part of this cluster: node1,node2 23 Checking for sufficient temp space availability on node(s) : 'node1,node2' 24 25 ## [END] Install check configuration ## 26 27 Traces log file: /tmp/deinstall2019-03-14_04-08-22PM/logs//crsdc.log 28 29 Network Configuration check config START 30 31 Network de-configuration trace file location: /tmp/deinstall2019-03-14_04-08-22PM/logs/netdc_check2019-03-14_04-08-36-PM.log 32 33 Specify all RAC listeners (do not include SCAN listener) that are to be de-configured [LISTENER]:^C[grid@node2 deinstall]$ ./deinstall -local 34 Checking for required files and bootstrapping ... 35 Please wait ... 36 Location of logs /tmp/deinstall2019-03-14_04-14-58PM/logs/ 37 38 ############ ORACLE DEINSTALL & DECONFIG TOOL START ############ 39 40 41 ######################### CHECK OPERATION START ######################### 42 ## [START] Install check configuration ## 43 44 45 Checking for existence of the Oracle home location /oracle/11.2.0/grid/crs 46 Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Cluster 47 Oracle Base selected for deinstall is: /oracle/11.2.0/11.2.0 48 Checking for existence of central inventory location /oracle/app/oraInventory 49 Checking for existence of the Oracle Grid Infrastructure home /oracle/11.2.0/grid/crs 50 The following nodes are part of this cluster: node1,node2 51 Checking for sufficient temp space availability on node(s) : 'node1,node2' 52 53 ## [END] Install check configuration ## 54 55 Traces log file: /tmp/deinstall2019-03-14_04-14-58PM/logs//crsdc.log 56 57 Network Configuration check config START 58 59 Network de-configuration trace file location: /tmp/deinstall2019-03-14_04-14-58PM/logs/netdc_check2019-03-14_04-15-07-PM.log 60 61 Specify all RAC listeners (do not include SCAN listener) that are to be de-configured [LISTENER]: 62 63 Network Configuration check config END 64 65 Asm Check Configuration START 66 67 ASM de-configuration trace file location: /tmp/deinstall2019-03-14_04-14-58PM/logs/asmcadc_check2019-03-14_04-15-09-PM.log 68 69 70 ######################### CHECK OPERATION END ######################### 71 72 73 ####################### CHECK OPERATION SUMMARY ####################### 74 Oracle Grid Infrastructure Home is: /oracle/11.2.0/grid/crs 75 The cluster node(s) on which the Oracle home deinstallation will be performed are:node1,node2 76 Since -local option has been specified, the Oracle home will be deinstalled only on thelocal node, 'node2', and the global configuration will be removed. 77 Oracle Home selected for deinstall is: /oracle/11.2.0/grid/crs 78 Inventory Location where the Oracle home registered is: /oracle/app/oraInventory 79 Following RAC listener(s) will be de-configured: LISTENER 80 Option -local will not modify any ASM configuration. 81 Do you want to continue (y - yes, n - no)? [n]: y 82 A log of this session will be written to: '/tmp/deinstall2019-03-14_04-14-58PM/logs/deinstall_deconfig2019-03-14_04-15-03-PM.out' 83 Any error messages from this session will be written to: '/tmp/deinstall2019-03-14_04-14-58PM/logs/deinstall_deconfig2019-03-14_04-15-03-PM.err' 84 85 ######################## CLEAN OPERATION START ######################## 86 ASM de-configuration trace file location: /tmp/deinstall2019-03-14_04-14-58PM/logs/asmcadc_clean2019-03-14_04-15-22-PM.log 87 ASM Clean Configuration END 88 89 Network Configuration clean config START 90 91 Network de-configuration trace file location: /tmp/deinstall2019-03-14_04-14-58PM/logs/netdc_clean2019-03-14_04-15-22-PM.log 92 93 De-configuring RAC listener(s): LISTENER 94 95 De-configuring listener: LISTENER 96 Stopping listener on node "node2": LISTENER 97 Warning: Failed to stop listener. Listener may not be running. 98 Listener de-configured successfully. 99 100 De-configuring Naming Methods configuration file... 101 Naming Methods configuration file de-configured successfully. 102 103 De-configuring backup files... 104 Backup files de-configured successfully. 105 106 The network configuration has been cleaned up successfully. 107 108 Network Configuration clean config END 109 110 111 ----------------------------------------> 112 113 The deconfig command below can be executed in parallel on all the remote nodes. Executethe command on the local node after the execution completes on all the remote nodes. 114 115 Run the following command as the root user or the administrator on node "node1". 116 117 /tmp/deinstall2019-03-14_04-14-58PM/perl/bin/perl -I/tmp/deinstall2019-03-14_04-14-58PM/perl/lib -I/tmp/deinstall2019-03-14_04-14-58PM/crs/install /tmp/deinstall2019-03-14_04-14-58PM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2019-03-14_04-14-58PM/response/deinstall_Ora11g_gridinfrahome1.rsp" 118 119 Run the following command as the root user or the administrator on node "node2". 120 121 /tmp/deinstall2019-03-14_04-14-58PM/perl/bin/perl -I/tmp/deinstall2019-03-14_04-14-58PM/perl/lib -I/tmp/deinstall2019-03-14_04-14-58PM/crs/install /tmp/deinstall2019-03-14_04-14-58PM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2019-03-14_04-14-58PM/response/deinstall_Ora11g_gridinfrahome1.rsp" 122 123 Press Enter after you finish running the above commands 124 125 <----------------------------------------提示运行脚本,删除哪个运行哪个不要搞错了
[root@node2 ~]# /tmp/deinstall2019-03-14_04-14-58PM/perl/bin/perl -I/tmp/deinstall2019-03-14_04-14-58PM/perl/lib -I/tmp/deinstall2019-03-14_04-14-58PM/crs/install /tmp/deinstall2019-03-14_04-14-58PM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2019-03-14_04-14-58PM/response/deinstall_Ora11g_gridinfrahome1.rsp" Using configuration parameter file: /tmp/deinstall2019-03-14_04-14-58PM/response/deinstall_Ora11g_gridinfrahome1.rsp Network exists: 1/192.168.0.0/255.255.255.0/eth0, type static VIP exists: /node1vip/192.168.0.183/192.168.0.0/255.255.255.0/eth0, hosting node node1 VIP exists: /node2vip/192.168.0.182/192.168.0.0/255.255.255.0/eth0, hosting node node2 GSD exists ONS exists: Local port 6100, remote port 6200, EM port 2016 CRS-2673: Attempting to stop 'ora.registry.acfs' on 'node2' CRS-2677: Stop of 'ora.registry.acfs' on 'node2' succeeded CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'node2' CRS-2673: Attempting to stop 'ora.crsd' on 'node2' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'node2' CRS-2673: Attempting to stop 'ora.OCR_VOTE.dg' on 'node2' CRS-2673: Attempting to stop 'ora.ORADATA01.dg' on 'node2' CRS-2673: Attempting to stop 'ora.ORADATA02.dg' on 'node2' CRS-2677: Stop of 'ora.ORADATA02.dg' on 'node2' succeeded CRS-2677: Stop of 'ora.ORADATA01.dg' on 'node2' succeeded CRS-2677: Stop of 'ora.OCR_VOTE.dg' on 'node2' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'node2' CRS-2677: Stop of 'ora.asm' on 'node2' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'node2' has completed CRS-2677: Stop of 'ora.crsd' on 'node2' succeeded CRS-2673: Attempting to stop 'ora.ctssd' on 'node2' CRS-2673: Attempting to stop 'ora.evmd' on 'node2' CRS-2673: Attempting to stop 'ora.asm' on 'node2' CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'node2' CRS-2673: Attempting to stop 'ora.mdnsd' on 'node2' CRS-2677: Stop of 'ora.evmd' on 'node2' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'node2' succeeded CRS-2677: Stop of 'ora.ctssd' on 'node2' succeeded CRS-2677: Stop of 'ora.asm' on 'node2' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'node2' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'node2' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'node2' CRS-2677: Stop of 'ora.cssd' on 'node2' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'node2' CRS-2677: Stop of 'ora.drivers.acfs' on 'node2' succeeded CRS-2677: Stop of 'ora.crf' on 'node2' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'node2' CRS-2677: Stop of 'ora.gipcd' on 'node2' succeeded CRS-2673: Attempting to stop 'ora.gpnpd' on 'node2' CRS-2677: Stop of 'ora.gpnpd' on 'node2' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'node2' has completed CRS-4133: Oracle High Availability Services has been stopped.
05,删除相关信息
[root@node2 db_1]# rm -rf /etc/oraInst.loc [root@node2 db_1]# rm -rf /opt/ORCLfmap [root@node2 db_1]# rm -rf /etc/oratab
06,更新dbms inventory
[oracle@node1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME CLUSTER_NODES=node1 Starting Oracle Universal Installer... Checking swap space: must be greater than 500 MB. Actual 1948 MB Passed The inventory pointer is located at /etc/oraInst.loc The inventory is located at /oracle/app/oraInventory 'UpdateNodeList' was successful.
更新
[oracle@node1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList -local ORACLE_HOME=$ORACLE_HOME CLUSTER_NODES=node1 Starting Oracle Universal Installer... Checking swap space: must be greater than 500 MB. Actual 1948 MB Passed The inventory pointer is located at /etc/oraInst.loc The inventory is located at /oracle/app/oraInventory 'UpdateNodeList' was successful.
人生就像一滴水,非要落下才后悔!
--kingle