在安装RAC时,有时候我们可能会安装失败,需要重新安装GI/CRS,如果卸载不干净,重装过程中还可能会失败,下面简单列出了删除GI/CRS的步骤,适应于11g,12c的环境
1.删除集群配置
/pgold/orgrid/oracle/product/121/crs/install/rootcrs.pl -deconfig -verbose -force
/pgold/orgrid/oracle/product/121/crs/install/rootcrs.pl -deconfig -verbose -force -lastnode 注意:最后一个节点要加上-lastnode
2.删除OS上相关配置文件及ORACLE软件
find /etc /tmp /var/tmp/ -ls|egrep 'ohas|oratab|oraInst|crs|CVU|^oracle|^Ora|.oracle' |egrep -v 'release|asm' 查看确认要删除的文件,如果没问题,执行下面的命令
find /etc /tmp /var/tmp/ -ls|egrep 'ohas|oratab|oraInst|crs|CVU|^oracle|^Ora|.oracle' |egrep -v 'release|asm' |awk '{print $11}' |xargs rm -rf
3.清除之前磁盘组的头部
dd if=/dev/zero of=/dev/<device name> bs=1M count=100
删除集群配置
[root@ohs1 /]# /pgold/orgrid/oracle/product/121/crs/install/rootcrs.pl -deconfig -verbose -force
Using configuration parameter file: /pgold/orgrid/oracle/product/121/crs/install/crsconfig_params Network 1 exists Subnet IPv4: 10.0.2.0/255.255.255.0/eth0, dhcp Subnet IPv6: Ping Targets: Network is enabled Network is individually enabled on nodes: Network is individually disabled on nodes: VIP exists: network number 1, hosting node ohs1 VIP IPv4 Address: -/ohs1-vip/10.0.2.148 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: VIP exists: network number 1, hosting node ohs2 VIP IPv4 Address: -/ohs2-vip/10.0.2.147 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: VIP exists: network number 1, hosting node ohs3 VIP IPv4 Address: -/ohs3-vip/10.0.2.144 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false ONS is enabled ONS is individually enabled on nodes: ONS is individually disabled on nodes: CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ohs1' CRS-2673: Attempting to stop 'ora.crsd' on 'ohs1' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'ohs1' CRS-2673: Attempting to stop 'ora.SYSTEMDG.dg' on 'ohs1' CRS-2673: Attempting to stop 'ora.mgmtdb' on 'ohs1' CRS-2677: Stop of 'ora.SYSTEMDG.dg' on 'ohs1' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'ohs1' CRS-2677: Stop of 'ora.asm' on 'ohs1' succeeded CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs1' CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs1' succeeded CRS-2677: Stop of 'ora.mgmtdb' on 'ohs1' succeeded CRS-2673: Attempting to stop 'ora.MGMTLSNR' on 'ohs1' CRS-2677: Stop of 'ora.MGMTLSNR' on 'ohs1' succeeded CRS-2672: Attempting to start 'ora.MGMTLSNR' on 'ohs2' CRS-2676: Start of 'ora.MGMTLSNR' on 'ohs2' succeeded CRS-2672: Attempting to start 'ora.mgmtdb' on 'ohs2' CRS-2676: Start of 'ora.mgmtdb' on 'ohs2' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'ohs1' has completed CRS-2677: Stop of 'ora.crsd' on 'ohs1' succeeded CRS-2673: Attempting to stop 'ora.storage' on 'ohs1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'ohs1' CRS-2673: Attempting to stop 'ora.gpnpd' on 'ohs1' CRS-2677: Stop of 'ora.storage' on 'ohs1' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'ohs1' CRS-2673: Attempting to stop 'ora.ctssd' on 'ohs1' CRS-2673: Attempting to stop 'ora.evmd' on 'ohs1' CRS-2673: Attempting to stop 'ora.asm' on 'ohs1' CRS-2677: Stop of 'ora.mdnsd' on 'ohs1' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'ohs1' succeeded CRS-2677: Stop of 'ora.crf' on 'ohs1' succeeded CRS-2677: Stop of 'ora.ctssd' on 'ohs1' succeeded CRS-2677: Stop of 'ora.evmd' on 'ohs1' succeeded CRS-2677: Stop of 'ora.asm' on 'ohs1' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'ohs1' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'ohs1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'ohs1' CRS-2677: Stop of 'ora.cssd' on 'ohs1' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'ohs1' CRS-2677: Stop of 'ora.gipcd' on 'ohs1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ohs1' has completed CRS-4133: Oracle High Availability Services has been stopped. 2016/09/24 23:43:01 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector. 2016/09/24 23:43:23 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector. 2016/09/24 23:43:23 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node [root@ohs1 /]# ps -ef|grep d.bin root 13133 4062 0 23:45 pts/0 00:00:00 grep d.bin [root@ohs1 /]#[root@ohs2 ~]# /pgold/orgrid/oracle/product/121/crs/install/rootcrs.pl -deconfig -verbose -force
Using configuration parameter file: /pgold/orgrid/oracle/product/121/crs/install/crsconfig_params Network 1 exists Subnet IPv4: 10.0.2.0/255.255.255.0/eth0, dhcp Subnet IPv6: Ping Targets: Network is enabled Network is individually enabled on nodes: Network is individually disabled on nodes: VIP exists: network number 1, hosting node ohs2 VIP IPv4 Address: -/ohs2-vip/10.0.2.147 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: VIP exists: network number 1, hosting node ohs3 VIP IPv4 Address: -/ohs3-vip/10.0.2.144 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false ONS is enabled ONS is individually enabled on nodes: ONS is individually disabled on nodes: CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ohs2' CRS-2673: Attempting to stop 'ora.crsd' on 'ohs2' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'ohs2' CRS-2673: Attempting to stop 'ora.mgmtdb' on 'ohs2' CRS-2673: Attempting to stop 'ora.SYSTEMDG.dg' on 'ohs2' CRS-2677: Stop of 'ora.SYSTEMDG.dg' on 'ohs2' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'ohs2' CRS-2677: Stop of 'ora.mgmtdb' on 'ohs2' succeeded CRS-2673: Attempting to stop 'ora.MGMTLSNR' on 'ohs2' CRS-2677: Stop of 'ora.MGMTLSNR' on 'ohs2' succeeded CRS-2672: Attempting to start 'ora.MGMTLSNR' on 'ohs3' CRS-2677: Stop of 'ora.asm' on 'ohs2' succeeded CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs2' CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs2' succeeded CRS-2676: Start of 'ora.MGMTLSNR' on 'ohs3' succeeded CRS-2672: Attempting to start 'ora.mgmtdb' on 'ohs3' CRS-2676: Start of 'ora.mgmtdb' on 'ohs3' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'ohs2' has completed CRS-2677: Stop of 'ora.crsd' on 'ohs2' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'ohs2' CRS-2673: Attempting to stop 'ora.ctssd' on 'ohs2' CRS-2673: Attempting to stop 'ora.evmd' on 'ohs2' CRS-2673: Attempting to stop 'ora.storage' on 'ohs2' CRS-2673: Attempting to stop 'ora.mdnsd' on 'ohs2' CRS-2673: Attempting to stop 'ora.gpnpd' on 'ohs2' CRS-2677: Stop of 'ora.storage' on 'ohs2' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'ohs2' CRS-2677: Stop of 'ora.crf' on 'ohs2' succeeded CRS-2677: Stop of 'ora.ctssd' on 'ohs2' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'ohs2' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'ohs2' succeeded CRS-2677: Stop of 'ora.evmd' on 'ohs2' succeeded CRS-2677: Stop of 'ora.asm' on 'ohs2' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'ohs2' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'ohs2' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'ohs2' CRS-2677: Stop of 'ora.cssd' on 'ohs2' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'ohs2' CRS-2677: Stop of 'ora.gipcd' on 'ohs2' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ohs2' has completed CRS-4133: Oracle High Availability Services has been stopped. 2016/09/24 23:47:03 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector. 2016/09/24 23:47:26 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector. 2016/09/24 23:47:26 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node[orgrid@ohs3 ~]$ crsctl stat res -t
-------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE ohs3 STABLE ora.LISTENER.lsnr ONLINE ONLINE ohs3 STABLE ora.SYSTEMDG.dg ONLINE ONLINE ohs3 STABLE ora.net1.network ONLINE ONLINE ohs3 STABLE ora.ons ONLINE ONLINE ohs3 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE ohs3 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE ohs3 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE ohs3 STABLE ora.MGMTLSNR 1 ONLINE ONLINE ohs3 169.254.57.172 172.1 6.0.23,STABLE ora.asm 1 ONLINE OFFLINE STABLE 2 ONLINE OFFLINE STABLE 3 ONLINE ONLINE ohs3 Started,STABLE ora.cvu 1 ONLINE ONLINE ohs3 STABLE ora.gns 1 ONLINE ONLINE ohs3 STABLE ora.gns.vip 1 ONLINE ONLINE ohs3 STABLE ora.mgmtdb 1 ONLINE ONLINE ohs3 Open,STABLE ora.oc4j 1 ONLINE ONLINE ohs3 STABLE ora.ohs3.vip 1 ONLINE ONLINE ohs3 STABLE ora.scan1.vip 1 ONLINE ONLINE ohs3 STABLE ora.scan2.vip 1 ONLINE ONLINE ohs3 STABLE ora.scan3.vip 1 ONLINE ONLINE ohs3 STABLE -------------------------------------------------------------------------------- [orgrid@ohs3 ~]$[root@ohs3 ~]# /pgold/orgrid/oracle/product/121/crs/install/rootcrs.pl -deconfig -verbose -force -lastnode
Using configuration parameter file: /pgold/orgrid/oracle/product/121/crs/install/crsconfig_params 2016/09/24 23:49:28 CLSRSC-332: CRS resources for listeners are still configured Network 1 exists Subnet IPv4: 10.0.2.0/255.255.255.0/eth0, dhcp Subnet IPv6: Ping Targets: Network is enabled Network is individually enabled on nodes: Network is individually disabled on nodes: VIP exists: network number 1, hosting node ohs3 VIP IPv4 Address: -/ohs3-vip/10.0.2.144 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false ONS is enabled ONS is individually enabled on nodes: ONS is individually disabled on nodes: CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ohs3' CRS-2673: Attempting to stop 'ora.crsd' on 'ohs3' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'ohs3' CRS-2673: Attempting to stop 'ora.mgmtdb' on 'ohs3' CRS-2677: Stop of 'ora.mgmtdb' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.MGMTLSNR' on 'ohs3' CRS-2673: Attempting to stop 'ora.SYSTEMDG.dg' on 'ohs3' CRS-2677: Stop of 'ora.SYSTEMDG.dg' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'ohs3' CRS-2677: Stop of 'ora.MGMTLSNR' on 'ohs3' succeeded CRS-2677: Stop of 'ora.asm' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs3' CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'ohs3' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'ohs3' has completed CRS-2677: Stop of 'ora.crsd' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.mdnsd' on 'ohs3' CRS-2673: Attempting to stop 'ora.storage' on 'ohs3' CRS-2673: Attempting to stop 'ora.gpnpd' on 'ohs3' CRS-2677: Stop of 'ora.storage' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'ohs3' CRS-2673: Attempting to stop 'ora.ctssd' on 'ohs3' CRS-2673: Attempting to stop 'ora.evmd' on 'ohs3' CRS-2673: Attempting to stop 'ora.asm' on 'ohs3' CRS-2677: Stop of 'ora.mdnsd' on 'ohs3' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'ohs3' succeeded CRS-2677: Stop of 'ora.crf' on 'ohs3' succeeded CRS-2677: Stop of 'ora.ctssd' on 'ohs3' succeeded CRS-2677: Stop of 'ora.evmd' on 'ohs3' succeeded CRS-2677: Stop of 'ora.asm' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'ohs3' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'ohs3' CRS-2677: Stop of 'ora.cssd' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'ohs3' CRS-2677: Stop of 'ora.gipcd' on 'ohs3' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ohs3' has completed CRS-4133: Oracle High Availability Services has been stopped. CRS-4123: Oracle High Availability Services has been started. CRS-2672: Attempting to start 'ora.evmd' on 'ohs3' CRS-2672: Attempting to start 'ora.mdnsd' on 'ohs3' CRS-2676: Start of 'ora.mdnsd' on 'ohs3' succeeded CRS-2676: Start of 'ora.evmd' on 'ohs3' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'ohs3' CRS-2676: Start of 'ora.gpnpd' on 'ohs3' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'ohs3' CRS-2672: Attempting to start 'ora.gipcd' on 'ohs3' CRS-2676: Start of 'ora.cssdmonitor' on 'ohs3' succeeded CRS-2676: Start of 'ora.gipcd' on 'ohs3' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'ohs3' CRS-2672: Attempting to start 'ora.diskmon' on 'ohs3' CRS-2676: Start of 'ora.diskmon' on 'ohs3' succeeded CRS-2676: Start of 'ora.cssd' on 'ohs3' succeeded ASM de-configuration trace file location: /tmp/asmcadc_clean2016-09-24_11-55-33-PM.log ASM Clean Configuration START ASM Clean Configuration END ASM with SID +ASM1 deleted successfully. Check /tmp/asmcadc_clean2016-09-24_11-55-33-PM.log for details. CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ohs3' CRS-2673: Attempting to stop 'ora.mdnsd' on 'ohs3' CRS-2673: Attempting to stop 'ora.gpnpd' on 'ohs3' CRS-2673: Attempting to stop 'ora.ctssd' on 'ohs3' CRS-2673: Attempting to stop 'ora.evmd' on 'ohs3' CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'ohs3' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'ohs3' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'ohs3' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'ohs3' succeeded CRS-2677: Stop of 'ora.ctssd' on 'ohs3' succeeded CRS-2677: Stop of 'ora.evmd' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'ohs3' CRS-2677: Stop of 'ora.cssd' on 'ohs3' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'ohs3' CRS-2677: Stop of 'ora.gipcd' on 'ohs3' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ohs3' has completed CRS-4133: Oracle High Availability Services has been stopped. 2016/09/24 23:58:09 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector. 2016/09/24 23:58:20 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector. 2016/09/24 23:58:20 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node 2016/09/24 23:58:20 CLSRSC-559: Ensure that the GPnP profile data under the 'gpnp' directory in /pgold/orgrid/oracle/product/121 is deleted on each node before using the software in the current Grid Infrastructure home for reconfiguration. [root@ohs3 ~]#查找并删除OS上相关配置文件
[root@ohs1 tmp]# find /etc /tmp /var/tmp/ -ls|egrep 'ohas|oratab|oraInst|crs|CVU|^oracle|^Ora|.oracle' |egrep -v 'release|asm'
2101315 0 lrwxrwxrwx 1 root root 14 Aug 31 10:55 /etc/system-release -> oracle-release 2101305 4 -rw-r--r-- 1 root root 32 May 11 11:51 /etc/oracle-release 2104830 4 -rw-rw-r-- 1 orgrid oinstall 904 Sep 24 23:56 /etc/oratab 2104757 4 -rw-r--r-- 1 root root 54 Sep 22 13:45 /etc/oraInst.loc 2104832 4 drwxr-xr-x 3 root oinstall 4096 Sep 24 23:47 /etc/oracle 1597279 4 -rwxr-xr-x 1 orgrid oinstall 3279 Jan 12 2011 /tmp/CVU_12.1.0.2.0_resource/checksshd.sh ..... 1595969 0 -rw------- 1 orgrid oinstall 0 Sep 22 13:41 /tmp/OraInstall2016-09-22_11-48-46AM/oraInstall2016-09-22_11-48-46AM.err [root@ohs2 ~]#[root@ohs1 tmp]# find /etc /tmp /var/tmp/ -ls|egrep 'ohas|oratab|oraInst|crs|CVU|^oracle|^Ora|.oracle' |egrep -v 'release|asm' |awk '{print $11}' |xargs rm -rf
[root@ohs1 tmp]# find /etc /tmp /var/tmp/ -ls|egrep 'ohas|oratab|oraInst|crs|CVU|^oracle|^Ora|.oracle' |egrep -v 'release|asm'
[root@ohs1 tmp]#
删除ORACLE_BASE,ORACLE_HOME ,oraInventory目录
[root@ohs1 ~]# rm -rf /pgold/oraInventory/* /pgold/orgrid/grid_base/* /pgold/orgrid/oracle/product/121/* [root@ohs1 ~]# ssh ohs2 rm -rf /pgold/oraInventory/* /pgold/orgrid/grid_base/* /pgold/orgrid/oracle/product/121/* root@ohs2's password: [root@ohs1 ~]# ssh ohs3 rm -rf /pgold/oraInventory/* /pgold/orgrid/grid_base/* /pgold/orgrid/oracle/product/121/* root@ohs3's password: [root@ohs1 ~]#
清除磁盘头部信息
[root@ohs1 ~]# dd if=/dev/zero of=/dev/oracleasm/disks/ASMDISK1 bs=1M count=100
100+0 records in 100+0 records out 104857600 bytes (105 MB) copied, 0.257975 s, 406 MB/s [root@ohs1 ~]# od -c /dev/oracleasm/disks/ASMDISK1 -N 128 0000000 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 * 0000200 [root@ohs1 ~]#