oracle 10g rac 解除安裝

renjixinchina發表於2012-12-12
適用於10G --11Gr1
1 使用DBCA刪除資料庫
2 利用Netca工具刪除監聽設定

3 解除安裝ASM
3.1 查詢所有的磁碟組
select * from v$asm_diskgroup
3.2 刪除磁碟組
第二個節點
$ export ORACLE_SID=+ASM2
SQL> alter diskgroup DATA dismount;

Diskgroup altered.


第一個節點
SQL> drop diskgroup DATA including contents;

Diskgroup dropped.
這裡要注意的,要先在一個節點上將diskgroup dismount後, 在另一個節點進行drop。不然會報:
       ORA-15073: diskgroup DATA is mounted by another ASM instance


3.3 關閉ASM例項

$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Tue Dec 11 14:52:48 2012

Copyright (c) 1982, 2007, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> shutdown immediate
ORA-15100: invalid or missing diskgroup name


ASM instance shutdown

3.4 檢查ASM狀態 確保是OFFLINE 狀態
 

$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM3.asm application    OFFLINE   OFFLINE               
ora....db3.gsd application    ONLINE    ONLINE    zzwsjdb3    
ora....db3.ons application    ONLINE    ONLINE    zzwsjdb3    
ora....db3.vip application    ONLINE    ONLINE    zzwsjdb3    
ora....SM2.asm application    OFFLINE   OFFLINE               
ora....db4.gsd application    ONLINE    ONLINE    zzwsjdb4    
ora....db4.ons application    ONLINE    ONLINE    zzwsjdb4    
ora....db4.vip application    ONLINE    ONLINE    zzwsjdb4  


3.5 刪除ASM資源
 srvctl remove asm -n node1
 srvctl remove asm -n node2
 如:srvctl remove asm –n rac1, 如果刪除不掉,就加上 –f 引數。
    如果使用了ASMLIB 按照以下步驟執行
a oracleasm listdisks
b. oracleasm deletedisks (do this for every disk listed above)
c. oracleasm listdisks (to verify they have been deleted)
d. on other RAC nodes: oracleasm listdisks (to verify they have been deleted too)
e. On all nodes(RAC) : 
As root run:
# /etc/init.d/oracleasm stop
# /etc/init.d/oracleasm disable

3.6 刪除 ASM pfile or spfile

3.7 從/etc/oratab 移除ASM

4 刪除Oracle 軟體
   進入$ORACLE_HOME/oui/bin/ 目錄,執行runInstaller命令。 進入WELCOME介面後,直接點選Installed Products,這時會彈出一個對話方塊,在Oracle Homes中有兩個物件:OraCrs10g_home和OraDb10g_home。
 
在刪除的時候一定要先選擇解除安裝OraDb10g_home,因為還需要執行Cluster目錄下的shell指令碼來清除CLUSTER對作業系統進行的修改,所以OraCrs10g_home的解除安裝放到後面的步驟中進行。
 
選中OraDb11g_home點選REMOVE即可進行解除安裝。


5  用CLUSTER目錄下提供的shell來清除CLUSTER系統的所有修改
 
用root使用者執行如下指令碼:
on local node:
$ORA_CRS_HOME/install/rootdelete.sh local nosharedvar nosharedhome
on remote nodes:
$ORA_CRS_HOME/install/rootdelete.sh remote nosharedvar nosharedhome
 
執行時,可以加上 -force 引數。
 
注意:這裡的操作必須一個節點一個節點的執行,不能並行操作,就如同安裝的時候執行root.sh一樣!
 
在rac1節點執行:
 
[root@rac1 ~]# cd /u01/app/oracle/product/crs/install
[root@rac1 install]# ./rootdelete.sh local nosharedvar nosharedhome
CRS-0210: Could not find resource 'ora.rac1.LISTENER_RAC1.lsnr'.
Shutting down Oracle Cluster Ready Services (CRS):
Sep 17 13:27:28.917 | INF | daemon shutting down
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script. for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'
 
在rac2節點執行:
 
[root@rac2 ~]#  cd /u01/app/oracle/product/crs/install
[root@rac2 install]# ./rootdelete.sh remote nosharedvar nosharedhome
CRS-0210: Could not find resource 'ora.rac2.LISTENER_RAC2.lsnr'.
Shutting down Oracle Cluster Ready Services (CRS):
Sep 17 13:29:48.144 | INF | daemon shutting down
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script. for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'
 
6 清除OCR
只需要用root使用者在本地節點執行如下命令:
$ORA_CRS_HOME/install/rootdeinstall.sh
 
在一個節點執行即可:
[root@rac1 install]# ./rootdeinstall.sh
Removing contents from OCR mirror device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 0.774432 seconds, 13.5 MB/s
Removing contents from OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 1.36228 seconds, 7.7 MB/s
 
7 解除安裝clusterware
 
進入$ORA_CRS_HOME/oui/bin/ 目錄,執行runInstaller命令. 進入WELCOME介面後,點選Installed Products,在彈出的對話方塊中選擇OraCrs10g_home,然後點選REMOVE。
 
刪除/var/opt目錄下的Oracle資訊和ORACLE_BASE目錄:
 
# rm -rf /data/oracle
# rm -rf /var/opt/oracle
 
刪除/usr/local/bin目錄下的設定:
 
# rm /usr/local/bin/dbhome
# rm /usr/local/bin/oraenv
# rm /usr/local/bin/coraenv
 
利用作業系統命令檢查一下,系統中是否還殘留一些Oracle的設定:
 
 
# find / -name oracle
 
 
整個Oracle資料庫和RAC環境清除工作至此結束,可以重新進行Clusterware和RAC的安裝了。這裡沒有對幾個raw裝置進行,因為在安裝Clusterware的時候,會自動對他們進行格式化。


本文件完全參考 http://blog.csdn.net/tianlesoftware/article/details/5892225
只是在四.      RAC解除安裝步驟中缺少了解除安裝ASM 加以補充



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15747463/viewspace-750986/,如需轉載,請註明出處,否則將追究法律責任。

相關文章