oracle 11gr2 deinstall卸载oracle和grid

  在10g中要卸载CRS是件非常繁琐的事。到了11g,oracle提供了卸载工具deinstall,用这个工具可以卸载的非常干净。这个工具默认放在oracle用户下的$ORACLE_HOME/deinstall/deinstall,grid用户下的$ORACLE_HOME/deinstall/deinstall 。google了下,发现只需要执行这个工具一次就可以了。但

是在自己的实际测试当中分别oracle用户和grid用户各执行了一次才卸载完成。猜想可能只需要grid用户执行一次deinstall就可以了,这个以后再测试。

  测试环境

  redhat 5.8 64bit

  oracle 11.2.0.1 rac+asm

   以下只需要在一个节点执行deinstall即可

   1.oracle用户执行deinstall,卸载oracle database 和oracle软件

   deinstall 工具只需要在rac中的一个节点执行就可以了,执行节结束后,oracle database和oracle软件卸载完成,集群没有卸载

#切换到oracle用户执行deinstall
[root@yozhan1 ~]# su - oracle [oracle@yozhan1 ~]$ cd /s01/oracle/app/oracle/product/11.2.0/dbhome_1/deinstall/ [oracle@yozhan1 deinstall]$ ls deinstall deinstall.xml jlib response sshUserSetup.sh [oracle@yozhan1 deinstall]$ ./deinstall Checking for required files and bootstrapping ... Please wait ... Location of logs /g01/grid/app/oraInventory/logs/ ############ ORACLE DEINSTALL & DECONFIG TOOL START ############ ######################## CHECK OPERATION START ######################## Install check configuration START Checking for existence of the Oracle home location /s01/oracle/app/oracle/product/11.2.0/dbhome_1 Oracle Home type selected for de-install is: RACDB Oracle Base selected for de-install is: /s01/oracle/app/oracle Checking for existence of central inventory location /g01/grid/app/oraInventory Checking for existence of the Oracle Grid Infrastructure home /g01/grid/app/11.2.0/grid The following nodes are part of this cluster: yozhan1,yozhan2 Install check configuration END Network Configuration check config START Network de-configuration trace file location: /g01/grid/app/oraInventory/logs/netdc_check6618522273928197876.log Network Configuration check config END Database Check Configuration START Database de-configuration trace file location: /g01/grid/app/oraInventory/logs/databasedc_check6684171349736081098.log Use comma as separator when specifying list of values as input Specify the list of database names that are configured in this Oracle home [PROD]: #此处默认的如果是需要卸载的database name,回车即可 ###### For Database 'PROD' ###### RAC Database The nodes on which this database has instances: [yozhan1, yozhan2] The instance names: [PROD1, PROD2] The local instance name on node: PROD1 The diagnostic destination location of the database: /s01/oracle/app/oracle/diag/rdbms/prod Storage type used by the Database: ASM The details of database(s) PROD have been discovered automatically. Do you still want to modify the details of PROD database(s)? [n]: #猜想可能是这一步导致只卸载了oracle db 和软件 Database Check Configuration END Enterprise Manager Configuration Assistant START EMCA de-configuration trace file location: /g01/grid/app/oraInventory/logs/emcadc_check.log Checking configuration for database PROD Enterprise Manager Configuration Assistant END Oracle Configuration Manager check START OCM check log file location : /g01/grid/app/oraInventory/logs//ocm_check2385.log Oracle Configuration Manager check END ######################### CHECK OPERATION END ######################### ####################### CHECK OPERATION SUMMARY ####################### Oracle Grid Infrastructure Home is: /g01/grid/app/11.2.0/grid The cluster node(s) on which the Oracle home exists are: (Please input nodes seperated by ",", eg: node1,node2,...)yozhan1,yozhan2 Oracle Home selected for de-install is: /s01/oracle/app/oracle/product/11.2.0/dbhome_1 Inventory Location where the Oracle home registered is: /g01/grid/app/oraInventory The following databases were selected for de-configuration : PROD Database unique name : PROD Storage used : ASM Will update the Enterprise Manager configuration for the following database(s): PROD No Enterprise Manager ASM targets to update No Enterprise Manager listener targets to migrate Checking the config status for CCR yozhan1 : Oracle Home exists with CCR directory, but CCR is not configured yozhan2 : Oracle Home exists with CCR directory, but CCR is not configured CCR check is finished Do you want to continue (y - yes, n - no)? [n]: y #这里输入y,选择继续 A log of this session will be written to: '/g01/grid/app/oraInventory/logs/deinstall_deconfig2014-08-30_10-44-15-AM.out' Any error messages from this session will be written to: '/g01/grid/app/oraInventory/logs/deinstall_deconfig2014-08-30_10-44-15-AM.err' ######################## CLEAN OPERATION START ######################## Enterprise Manager Configuration Assistant START EMCA de-configuration trace file location: /g01/grid/app/oraInventory/logs/emcadc_clean.log Updating Enterprise Manager Database Control configuration for database PROD Updating Enterprise Manager ASM targets (if any) Updating Enterprise Manager listener targets (if any) Enterprise Manager Configuration Assistant END Database de-configuration trace file location: /g01/grid/app/oraInventory/logs/databasedc_clean6778388418033064653.log Database Clean Configuration START PROD This operation may take few minutes. Database Clean Configuration END PROD Network Configuration clean config START Network de-configuration trace file location: /g01/grid/app/oraInventory/logs/netdc_clean2297598091973346517.log De-configuring Listener configuration file on all nodes... Listener configuration file 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 Oracle Configuration Manager clean START OCM clean log file location : /g01/grid/app/oraInventory/logs//ocm_clean2385.log Oracle Configuration Manager clean END Oracle Universal Installer clean START Detach Oracle home '/s01/oracle/app/oracle/product/11.2.0/dbhome_1' from the central inventory on the local node : Done Delete directory '/s01/oracle/app/oracle/product/11.2.0/dbhome_1' on the local node : Done Delete directory '/s01/oracle/app/oracle' on the local node : Done Detach Oracle home '/s01/oracle/app/oracle/product/11.2.0/dbhome_1' from the central inventory on the remote nodes 'yozhan2' : Done Delete directory '/s01/oracle/app/oracle/product/11.2.0/dbhome_1' on the remote nodes 'yozhan2' : Done Delete directory '/s01/oracle/app/oracle' on the remote nodes 'yozhan2' : Done Oracle Universal Installer cleanup was successful. Oracle Universal Installer clean END Oracle install clean START Clean install operation removing temporary directory '/tmp/install' on node 'yozhan1' Clean install operation removing temporary directory '/tmp/install' on node 'yozhan2' Oracle install clean END Moved default properties file /tmp/deinstall2014-08-30_10-42-31-AM/response/deinstall_OraDb11g_home1.rsp as /tmp/deinstall2014-08-30_10-42-31-AM/response/deinstall_OraDb11g_home1.rsp2 ######################### CLEAN OPERATION END ######################### ####################### CLEAN OPERATION SUMMARY ####################### #通过clean summary可以看到,只是清理的oracle软件和db Updated Enterprise Manager configuration for database PROD Successfully de-configured the following database instances : PROD Cleaning the config for CCR As CCR is not configured, so skipping the cleaning of CCR configuration CCR clean is finished Successfully detached Oracle home '/s01/oracle/app/oracle/product/11.2.0/dbhome_1' from the central inventory on the local node. Successfully deleted directory '/s01/oracle/app/oracle/product/11.2.0/dbhome_1' on the local node. Successfully deleted directory '/s01/oracle/app/oracle' on the local node. Successfully detached Oracle home '/s01/oracle/app/oracle/product/11.2.0/dbhome_1' from the central inventory on the remote nodes 'yozhan2'. Successfully deleted directory '/s01/oracle/app/oracle/product/11.2.0/dbhome_1' on the remote nodes 'yozhan2'. Successfully deleted directory '/s01/oracle/app/oracle' on the remote nodes 'yozhan2'. Oracle Universal Installer cleanup was successful. Oracle install successfully cleaned up the temporary directories. ####################################################################### ############# ORACLE DEINSTALL & DECONFIG TOOL END #############

   现在来看下数据库和集群的状态,可以看到数据库db的服务已经没有了

[root@yozhan1 ~]# su - grid
[grid@yozhan1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.BACKUP.dg
               ONLINE  ONLINE       yozhan1                                      
               ONLINE  ONLINE       yozhan2                                      
ora.DATA.dg
               ONLINE  ONLINE       yozhan1                                      
               ONLINE  ONLINE       yozhan2                                      
ora.DG_EXT1.dg
               ONLINE  ONLINE       yozhan1                                      
               ONLINE  ONLINE       yozhan2                                      
ora.LISTENER.lsnr
               ONLINE  ONLINE       yozhan1                                      
               ONLINE  ONLINE       yozhan2                                      
ora.SYSTEMDG.dg
               ONLINE  ONLINE       yozhan1                                      
               ONLINE  ONLINE       yozhan2                                      
ora.asm
               ONLINE  ONLINE       yozhan1                  Started             
               ONLINE  ONLINE       yozhan2                  Started             
ora.eons
               ONLINE  ONLINE       yozhan1                                      
               ONLINE  ONLINE       yozhan2                                      
ora.gsd
               OFFLINE OFFLINE      yozhan1                                      
               OFFLINE OFFLINE      yozhan2                                      
ora.net1.network
               ONLINE  ONLINE       yozhan1                                      
               ONLINE  ONLINE       yozhan2                                      
ora.ons
               ONLINE  ONLINE       yozhan1                                      
               ONLINE  ONLINE       yozhan2                                      
ora.registry.acfs
               ONLINE  ONLINE       yozhan1                                      
               ONLINE  ONLINE       yozhan2                                      
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       yozhan1                                      
ora.oc4j
      1        ONLINE  ONLINE       yozhan1                                      
ora.scan1.vip
      1        ONLINE  ONLINE       yozhan1                                      
ora.yozhan1.vip
      1        ONLINE  ONLINE       yozhan1                                      
ora.yozhan2.vip
      1        ONLINE  ONLINE       yozhan2      

 

  2.grid用户执行deinstall,卸载crs

[grid@yozhan1 ~]$ cd $ORACLE_HOME
[grid@yozhan1 grid]$ cd deinstall
[grid@yozhan1 deinstall]$ ls
deinstall  deinstall.xml  jlib  response  sshUserSetup.sh
[grid@yozhan1 deinstall]$ ./deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2014-08-30_11-39-59-AM/logs/

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


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


Checking for existence of the Oracle home location /g01/grid/app/11.2.0/grid
Oracle Home type selected for de-install is: CRS
Oracle Base selected for de-install is: /g01/grid/app/grid
Checking for existence of central inventory location /g01/grid/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /g01/grid/app/11.2.0/grid
The following nodes are part of this cluster: yozhan1,yozhan2

Install check configuration END

Traces log file: /tmp/deinstall2014-08-30_11-39-59-AM/logs//crsdc.log

Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2014-08-30_11-39-59-AM/logs/netdc_check232761228034560801.log

Specify all RAC listeners that are to be de-configured [LISTENER]:   #这里需要交互,一般情况下,默认的是listener

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /tmp/deinstall2014-08-30_11-39-59-AM/logs/asmcadc_check9217983085951893702.log

Automatic Storage Management (ASM) instance is detected in this Oracle home /g01/grid/app/11.2.0/grid.
ASM Diagnostic Destination : /g01/grid/app/grid
ASM Diskgroups : +BACKUP,+DATA,+DG_EXT1,+SYSTEMDG
Diskgroups will be dropped
De-configuring ASM will drop all the diskgroups and it's contents at cleanup time. This will affect all of the databases and ACFS that use this ASM instance(s).
#这里提示de-configuring asm将会清除所有数据包括磁盘组,如果需要保留磁盘组,输入y,否则输入n。这里我们不需要保留磁盘组,因此输入n If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify by entering
'y'. Do you want to modify above information (y|n) [n]: ######################### CHECK OPERATION END ######################### ####################### CHECK OPERATION SUMMARY ####################### Oracle Grid Infrastructure Home is: /g01/grid/app/11.2.0/grid The cluster node(s) on which the Oracle home exists are: (Please input nodes seperated by ",", eg: node1,node2,...)yozhan1,yozhan2 Oracle Home selected for de-install is: /g01/grid/app/11.2.0/grid Inventory Location where the Oracle home registered is: /g01/grid/app/oraInventory Following RAC listener(s) will be de-configured: LISTENER ASM instance will be de-configured from this Oracle home Do you want to continue (y - yes, n - no)? [n]: y A log of this session will be written to: '/tmp/deinstall2014-08-30_11-39-59-AM/logs/deinstall_deconfig2014-08-30_11-40-47-AM.out' Any error messages from this session will be written to: '/tmp/deinstall2014-08-30_11-39-59-AM/logs/deinstall_deconfig2014-08-30_11-40-47-AM.err' ######################## CLEAN OPERATION START ######################## ASM de-configuration trace file location: /tmp/deinstall2014-08-30_11-39-59-AM/logs/asmcadc_clean6022882668335404302.log ASM Clean Configuration START ASM Clean Configuration END Network Configuration clean config START Network de-configuration trace file location: /tmp/deinstall2014-08-30_11-39-59-AM/logs/netdc_clean8953324129251920731.log De-configuring RAC listener(s): LISTENER De-configuring listener: LISTENER Stopping listener: LISTENER Listener stopped successfully. Unregistering listener: LISTENER Listener unregistered successfully. 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 #下面蓝色字体的内容是需要在所有节点执行的 ----------------------------------------> Run the following command as the root user or the administrator on node "yozhan2". /tmp/deinstall2014-08-30_11-39-59-AM/perl/bin/perl -I/tmp/deinstall2014-08-30_11-39-59-AM/perl/lib -I/tmp/deinstall2014-08-30_11-39-59-AM/crs/install /tmp/deinstall2014-08-30_11-39-59-AM/crs/install/rootcrs.pl -force -delete -paramfile /tmp/deinstall2014-08-30_11-39-59-AM/response/deinstall_Ora11g_gridinfrahome1.rsp Run the following command as the root user or the administrator on node "yozhan1". /tmp/deinstall2014-08-30_11-39-59-AM/perl/bin/perl -I/tmp/deinstall2014-08-30_11-39-59-AM/perl/lib -I/tmp/deinstall2014-08-30_11-39-59-AM/crs/install /tmp/deinstall2014-08-30_11-39-59-AM/crs/install/rootcrs.pl -force -delete -paramfile /tmp/deinstall2014-08-30_11-39-59-AM/response/deinstall_Ora11g_gridinfrahome1.rsp -lastnode <---------------------------------------- Oracle Universal Installer clean START Detach Oracle home '/g01/grid/app/11.2.0/grid' from the central inventory on the local node : Done Delete directory '/g01/grid/app/11.2.0/grid' on the local node : Done Delete directory '/g01/grid/app/oraInventory' on the local node : Done Delete directory '/g01/grid/app/grid' on the local node : Done Detach Oracle home '/g01/grid/app/11.2.0/grid' from the central inventory on the remote nodes 'yozhan2' : Done Delete directory '/g01/grid/app/11.2.0/grid' on the remote nodes 'yozhan2' : Done Delete directory '/g01/grid/app/oraInventory' on the remote nodes 'yozhan2' : Done Delete directory '/g01/grid/app/grid' on the remote nodes 'yozhan2' : Done Oracle Universal Installer cleanup was successful. Oracle Universal Installer clean END Oracle install clean START Clean install operation removing temporary directory '/tmp/install' on node 'yozhan1' Clean install operation removing temporary directory '/tmp/install' on node 'yozhan2' Oracle install clean END Moved default properties file /tmp/deinstall2014-08-30_11-39-59-AM/response/deinstall_Ora11g_gridinfrahome1.rsp as /tmp/deinstall2014-08-30_11-39-59-AM/response/deinstall_Ora11g_gridinfrahome1.rsp4 ######################### CLEAN OPERATION END ######################### ####################### CLEAN OPERATION SUMMARY ####################### ASM instance was de-configured successfully from the Oracle home Following RAC listener(s) were de-configured successfully: LISTENER Oracle Clusterware is stopped and successfully de-configured on node "yozhan2" Oracle Clusterware is stopped and successfully de-configured on node "yozhan1" Oracle Clusterware is stopped and de-configured successfully. Successfully detached Oracle home '/g01/grid/app/11.2.0/grid' from the central inventory on the local node. Successfully deleted directory '/g01/grid/app/11.2.0/grid' on the local node. Successfully deleted directory '/g01/grid/app/oraInventory' on the local node. Successfully deleted directory '/g01/grid/app/grid' on the local node. Successfully detached Oracle home '/g01/grid/app/11.2.0/grid' from the central inventory on the remote nodes 'yozhan2'. Successfully deleted directory '/g01/grid/app/11.2.0/grid' on the remote nodes 'yozhan2'. Successfully deleted directory '/g01/grid/app/oraInventory' on the remote nodes 'yozhan2'. Successfully deleted directory '/g01/grid/app/grid' on the remote nodes 'yozhan2'. Oracle Universal Installer cleanup was successful. #注意,此处还需要执行下面的步骤才可以卸载干净 Run 'rm -rf /etc/oraInst.loc' as root on node(s) 'yozhan1,yozhan2' at the end of the session. Oracle install successfully cleaned up the temporary directories. ####################################################################### ############# ORACLE DEINSTALL & DECONFIG TOOL END #############

 

  在执行完最后一步,才算真正的完成了oracle 11g rac 的卸载。

 

总结:

  1.虽然用两步才完成rac的卸载,但是也从中发现,deinstall也可以单独卸载oracle软件和database

  2.deinstall一步完成rac的卸载,待测试。

 

posted @ 2014-08-30 23:30  BitMore  阅读(7528)  评论(1编辑  收藏  举报