oracle11g GI+RAC卸载

oracle11g GI+RAC卸载

一、关库停资源

需要注意的是,使用root用户来停

[root@host01 ~]# . /home/oracle/grid_profile
[root@host01 ~]# crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘host01’
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘host01’
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘host01’
CRS-2673: Attempting to stop ‘ora.DGRAC.dg’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.FRA.dg’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.registry.acfs’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.racdb.acntpay.svc’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN1.lsnr’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.cvu’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.oc4j’ on ‘host01’
CRS-2677: Stop of ‘ora.racdb.acntpay.svc’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.racdb.db’ on ‘host01’
CRS-2672: Attempting to start ‘ora.racdb.acntpay.svc’ on ‘host02’
CRS-2677: Stop of ‘ora.cvu’ on ‘host01’ succeeded
CRS-2672: Attempting to start ‘ora.cvu’ on ‘host02’
CRS-2676: Start of ‘ora.racdb.acntpay.svc’ on ‘host02’ succeeded
CRS-2677: Stop of ‘ora.LISTENER_SCAN1.lsnr’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.scan1.vip’ on ‘host01’
CRS-2677: Stop of ‘ora.scan1.vip’ on ‘host01’ succeeded
CRS-2672: Attempting to start ‘ora.scan1.vip’ on ‘host02’
CRS-2676: Start of ‘ora.cvu’ on ‘host02’ succeeded
CRS-2677: Stop of ‘ora.racdb.db’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ‘host01’
CRS-2677: Stop of ‘ora.DATA.dg’ on ‘host01’ succeeded
CRS-2677: Stop of ‘ora.registry.acfs’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.ACFS.dg’ on ‘host01’
CRS-2676: Start of ‘ora.scan1.vip’ on ‘host02’ succeeded
CRS-2672: Attempting to start ‘ora.LISTENER_SCAN1.lsnr’ on ‘host02’
CRS-2677: Stop of ‘ora.ACFS.dg’ on ‘host01’ succeeded
CRS-2676: Start of ‘ora.LISTENER_SCAN1.lsnr’ on ‘host02’ succeeded
CRS-2677: Stop of ‘ora.oc4j’ on ‘host01’ succeeded
CRS-2672: Attempting to start ‘ora.oc4j’ on ‘host02’
CRS-2676: Start of ‘ora.oc4j’ on ‘host02’ succeeded
CRS-2677: Stop of ‘ora.DGRAC.dg’ on ‘host01’ succeeded
CRS-2677: Stop of ‘ora.FRA.dg’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ‘host01’
CRS-2677: Stop of ‘ora.asm’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘host01’
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.host01.vip’ on ‘host01’
CRS-2677: Stop of ‘ora.host01.vip’ on ‘host01’ succeeded
CRS-2672: Attempting to start ‘ora.host01.vip’ on ‘host02’
CRS-2676: Start of ‘ora.host01.vip’ on ‘host02’ succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ‘host01’
CRS-2677: Stop of ‘ora.ons’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ‘host01’
CRS-2677: Stop of ‘ora.net1.network’ on ‘host01’ succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘host01’ has completed
CRS-2677: Stop of ‘ora.crsd’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.asm’ on ‘host01’
CRS-2673: Attempting to stop ‘ora.drivers.acfs’ on ‘host01’
CRS-2677: Stop of ‘ora.evmd’ on ‘host01’ succeeded
CRS-2677: Stop of ‘ora.mdnsd’ on ‘host01’ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ‘host01’ succeeded
CRS-2677: Stop of ‘ora.drivers.acfs’ on ‘host01’ succeeded
CRS-2677: Stop of ‘ora.asm’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘host01’
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘host01’
CRS-2677: Stop of ‘ora.cssd’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.crf’ on ‘host01’
CRS-2677: Stop of ‘ora.crf’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘host01’
CRS-2677: Stop of ‘ora.gipcd’ on ‘host01’ succeeded
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘host01’
CRS-2677: Stop of ‘ora.gpnpd’ on ‘host01’ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘host01’ has completed
CRS-4133: Oracle High Availability Services has been stopped.

每个节点都执行

二、运行deinstall脚本

注意又要用oracle用户执行

[oracle@host01-+ASM1 ~]$ /u01/app/11.2.0/grid/deinstall/deinstall
Checking for required files and bootstrapping …
Please wait …
Location of logs /u01/app/oraInventory/logs/

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

######################### CHECK OPERATION START #########################
Install check configuration

Checking for existence of the Oracle home location /u01/app/11.2.0/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Cluster
Oracle Base selected for deinstall is: /u01/app/grid
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/11.2.0/grid
The following nodes are part of this cluster: host01,host02
Checking for sufficient temp space availability on node(s) : ‘host01,host02’

Install check configuration

Traces log file: /u01/app/oraInventory/logs//crsdc.log
Enter an address or the name of the virtual IP used on node “host01”[host01-vip]
>

The following information can be collected by running “/sbin/ifconfig -a” on node “host01”
Enter the IP netmask of Virtual IP “192.168.23.51” on node “host01”[255.255.255.0]
>

Enter the network interface name on which the virtual IP address “192.168.23.51” is active
>

Enter an address or the name of the virtual IP used on node “host02”[host02-vip]
>

The following information can be collected by running “/sbin/ifconfig -a” on node “host02”
Enter the IP netmask of Virtual IP “192.168.23.61” on node “host02”[255.255.255.0]
>

Enter the network interface name on which the virtual IP address “192.168.23.61” is active
>

Enter an address or the name of the virtual IP[]
>

Network Configuration check config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2019-03-01_02-22-45-PM.log

Specify all RAC listeners (do not include SCAN listener) that are to be de-configured [LISTENER,LISTENER_SCAN1]:

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /u01/app/oraInventory/logs/asmcadc_check2019-03-01_02-22-58-PM.log

ASM configuration was not detected in this Oracle home. Was ASM configured in this Oracle home (y|n) [n]:
ASM was not detected in the Oracle Home

######################### CHECK OPERATION END #########################

####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/11.2.0/grid
The cluster node(s) on which the Oracle home deinstallation will be performed are:host01,host02
Oracle Home selected for deinstall is: /u01/app/11.2.0/grid
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following RAC listener(s) will be de-configured: LISTENER,LISTENER_SCAN1
ASM was not detected in the Oracle Home
Do you want to continue (y - yes, n - no)? [n]: y 这里要回答y
A log of this session will be written to: ‘/u01/app/oraInventory/logs/deinstall_deconfig2019-03-01_02-20-08-PM.out’
Any error messages from this session will be written to: ‘/u01/app/oraInventory/logs/deinstall_deconfig2019-03-01_02-20-08-PM.err’

######################## CLEAN OPERATION START ########################
ASM de-configuration trace file location: /u01/app/oraInventory/logs/asmcadc_clean2019-03-01_02-23-22-PM.log
ASM Clean Configuration END

Network Configuration clean config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2019-03-01_02-23-22-PM.log

De-configuring RAC listener(s): LISTENER,LISTENER_SCAN1

De-configuring listener: LISTENER
Stopping listener: LISTENER
Warning: Failed to stop listener. Listener may not be running.
Listener de-configured successfully.

De-configuring listener: LISTENER_SCAN1
Stopping listener: LISTENER_SCAN1
Warning: Failed to stop listener. Listener may not be running.
Listener de-configured successfully.

De-configuring Naming Methods configuration file on all nodes…
Naming Methods configuration file de-configured successfully.

De-configuring Local Net Service Names configuration file on all nodes…
Local Net Service Names configuration file de-configured successfully.

De-configuring Directory Usage configuration file on all nodes…
Directory Usage configuration file de-configured successfully.

De-configuring backup files on all nodes…
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

---------------------------------------->

The deconfig command below can be executed in parallel on all the remote nodes. Execute the command on the local node after the execution completes on all the remote nodes.

Run the following command as the root user or the administrator on node “host02”.

/tmp/deinstall2019-03-01_02-19-48PM/perl/bin/perl -I/tmp/deinstall2019-03-01_02-19-48PM/perl/lib -I/tmp/deinstall2019-03-01_02-19-48PM/crs/install /tmp/deinstall2019-03-01_02-19-48PM/crs/install/rootcrs.pl -force -deconfig -paramfile “/tmp/deinstall2019-03-01_02-19-48PM/response/deinstall_Ora11g_gridinfrahome1.rsp”

Run the following command as the root user or the administrator on node “host01”.
/tmp/deinstall2019-03-01_02-19-48PM/perl/bin/perl -I/tmp/deinstall2019-03-01_02-19-48PM/perl/lib -I/tmp/deinstall2019-03-01_02-19-48PM/crs/install /tmp/deinstall2019-03-01_02-19-48PM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2019-03-01_02-19-48PM/response/deinstall_Ora11g_gridinfrahome1.rsp"
-lastnode

Press Enter after you finish running the above commands

<----------------------------------------

我是一路默认跑下去的,当然也要看一看有些配置与默认是否不同,注意在执行结束时要运行我标记的这个脚本

脚本又需要root执行
[root@host01 deinstall]# /tmp/deinstall2019-03-01_02-19-48PM/perl/bin/perl -I/tmp/deinstall2019-03-01_02-19-48PM/perl/lib -I/tmp/deinstall2019-03-01_02-19-48PM/crs/install /tmp/deinstall2019-03-01_02-19-48PM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2019-03-01_02-19-48PM/response/deinstall_Ora11g_gridinfrahome1.rsp"
Using configuration parameter file: /tmp/deinstall2019-03-01_02-19-48PM/response/deinstall_Ora11g_gridinfrahome1.rsp
PRCR-1119 : Failed to look up CRS resources of ora.cluster_vip_net1.type type
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.gsd is registered
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.ons is registered
Cannot communicate with crsd

CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
Successfully deconfigured Oracle clusterware stack on this node

在每一个节点都执行这个脚本,注意deinstall脚本不要退出,我是不小心退出了,也可以再次运行,问题不大

Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home ‘/u01/app/11.2.0/grid’ from the central inventory on the local node : Done

Failed to delete the directory ‘/u01/app/11.2.0/grid’. The directory is in use.
Delete directory ‘/u01/app/11.2.0/grid’ on the local node : Failed <<<<

Delete directory ‘/u01/app/grid’ on the local node : Done

Detach Oracle home ‘/u01/app/11.2.0/grid’ from the central inventory on the remote nodes ‘host02’ : Done

Delete directory ‘/u01/app/11.2.0/grid’ on the remote nodes ‘host02’ : Failed <<<<

Could not remove listed directories based on ‘/tmp/OraInstall2019-03-01_02-46-55-PM/installRemoveDirFile.lst’ from nodes ‘host02’. [PRKC-1083 : Failed to remove listed directory in “/tmp/OraInstall2019-03-01_02-46-55-PM/installRemoveDirFile.lst” to any of the given nodes "host02 ".
Error on node host02:/bin/rm: cannot remove directory `/u01/app/11.2.0/grid/’: Permission denied]
Delete directory ‘/u01/app/grid’ on the remote nodes ‘host02’ : Done

Oracle Universal Installer cleanup completed with errors.

Oracle Universal Installer clean END

[START] Oracle install clean

Clean install operation removing temporary directory ‘/tmp/deinstall2019-03-01_02-46-31PM’ on node ‘host01’
Clean install operation removing temporary directory ‘/tmp/deinstall2019-03-01_02-46-31PM’ on node ‘host02’

[END] Oracle install clean

######################### CLEAN OPERATION END #########################

####################### CLEAN OPERATION SUMMARY #######################
Following RAC listener(s) were de-configured successfully: LISTENER,LISTENER_SCAN1
Oracle Clusterware was already stopped and de-configured on node “host01”
Oracle Clusterware is stopped and de-configured successfully.
Successfully detached Oracle home ‘/u01/app/11.2.0/grid’ from the central inventory on the local node.
Failed to delete directory ‘/u01/app/11.2.0/grid’ on the local node.
Successfully deleted directory ‘/u01/app/grid’ on the local node.
Successfully detached Oracle home ‘/u01/app/11.2.0/grid’ from the central inventory on the remote nodes ‘host02’.
Failed to delete directory ‘/u01/app/11.2.0/grid’ on the remote nodes ‘host02’.
Successfully deleted directory ‘/u01/app/grid’ on the remote nodes ‘host02’.
Oracle Universal Installer cleanup completed with errors.

Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################

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

三、卸载后检查确认

1、检查各个节点的/etc/inittab文件,ohasd的内容应该被删除了。
2、检查每个节点是否存在ora或d.bin的进程运行,有即kill掉。
3、铲掉$GRID_HOME和$ORACLE_HOME目录。

先铲gi(顺序无所谓)

[root@host01 deinstall]# rm -rf /u01/app/11.2.0/grid/
[root@host01 deinstall]# ll /u01/app/11.2.0/grid/
ls: /u01/app/11.2.0/grid/: No such file or directory

再铲oracle
[oracle@host01-+ASM1 ~]$ rm -rf /u01/app/oracle/product/11.2.0/dbhome_1/
[oracle@host01-+ASM1 ~]$ ll /u01/app/oracle/product/11.2.0/dbhome_1/
ls: /u01/app/oracle/product/11.2.0/dbhome_1/: No such file or directory

四、删除磁盘
[oracle@host01-+ASM1 ~]$ /sbin/service oracleasm listdisks
DATA01
DATA02
DGRAC01
DGRAC02
DGRAC03
DGRAC04
DGRAC05
RECO01
RECO02
TEST01
TEST02
TEST03

因为我的环境还要用到asm磁盘,就不删除了,删除命令

oracleasm deletedisk 磁盘名

在最后还要去 /u01/app/oraInventory/ContentsXML/inventory.xml这个文件把gi的目录和oracle的目录信息删除,这样在下次重装软件的时候不会出现问题,当然,oraInventory这个目录也可以直接删除
[oracle@host01-+ASM1 ContentsXML]$ vi /u01/app/oraInventory/ContentsXML/inventory.xml






   11.2.0.3.0
   2.1.0.6.0


  这里删掉
   
      
      
   

 这里删掉




~                                                                               
"/u01/app/oraInventory/ContentsXML/inventory.xml" 20L, 645C   10,1          All


至此删除全部完成。

你可能感兴趣的:(ORACLE,oracle,rac,gi,11g)