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的卸載,待測試。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM