Solaris10下完全解除安裝Oracle1106RAC環境

yangtingkun發表於2008-07-19

寫了幾篇關於Oracle RAC環境的安裝,還從來沒有寫過解除安裝Oracle RAC環境的文章,前兩天在測試的時候發現,如果Rac環境無法解除安裝乾淨,很可能再次安裝RAC環境時會碰到錯誤,因此這裡簡單描述一下Oracle RAC環境的解除安裝。

 

 

首先解除安裝Oracle資料庫,為了更好的解除安裝資料庫,最好是保證資料庫處於開啟狀態,這樣DBCA就可以根據讀取Oracle資料檔案的資訊並進行刪除。

啟動DBCA圖形介面,選擇Oracle Real Application Cluster database選擇。

選擇Delete a Databasese

然後選擇FINISH,刪除整個資料庫檔案。

利用NETCA工具刪除監聽設定。

下面執行建立資料庫的圖形介面runInstaller,開始資料庫軟體的解除安裝:

進入WELCOME介面後,直接點選Installed Products,這時會彈出一個對話方塊,在Oracle Homes中有兩個物件:OraCrs11g_homeOraDb11g_home

在刪除的時候一定要先選擇解除安裝OraDb11g_home,因為還需要執行Cluster目錄下的shell指令碼來清除CLUSTER對作業系統進行的修改,所以OraCrs11g_home的解除安裝放到後面的步驟中進行。

選中OraDb11g_home點選REMOVE即可進行解除安裝。

下面利用CLUSTER目錄下提供的shell來清除CLUSTER系統的所有修改:

在節點2執行:

root@newtrade2 # cd /data/oracle/product/11.1/crs/
root@newtrade2 # . ./install/rootdelete.sh remote nosharedhome -force
Getting local node name
NODE = newtrade2
CRS resources for listeners are still configured.
Getting local node name
NODE = newtrade2
Stopping VIPs that are still up
Getting cluster node names
Cluster Nodes = newtrade1
newtrade2
Stopping vip
Stopping vip
Stopping resources.
This could take several minutes.
Successfully stopped Oracle Clusterware resources
Stopping Cluster Synchronization Services.
Shutting down the Cluster Synchronization Services daemon.
Shutdown request successfully issued.
Waiting for Cluster Synchronization Services daemon to stop
Cluster Synchronization Services daemon has stopped
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 '/var/opt/oracle/scls_scr'
Cleaning up Network socket directories

在節點1執行:

root@newtrade1 # cd /data/oracle/product/11.1/crs/
root@newtrade1 # . ./install/rootdelete.sh remote nosharedhome -force
Getting local node name
NODE = newtrade1
CRS resources for listeners are still configured.
Getting local node name
NODE = newtrade1
Stopping VIPs that are still up
Getting cluster node names
Cluster Nodes = newtrade1
newtrade2
Stopping vip
Stopping vip
Stopping resources.
This could take several minutes.
Successfully stopped Oracle Clusterware resources
Stopping Cluster Synchronization Services.
Shutting down the Cluster Synchronization Services daemon.
Shutdown request successfully issued.
Waiting for Cluster Synchronization Services daemon to stop
Cluster Synchronization Services daemon has stopped
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 '/var/opt/oracle/scls_scr'
Cleaning up Network socket directories

在節點1執行:

root@newtrade1 # ./install/rootdeinstall.sh
Verifying existence of ocr.loc file

Removing contents from OCR device
2560+0 records in
2560+0 records out

下面可以利用CLUSTER的安裝程式runInstaller來解除安裝CLUSTER軟體:

進入WELCOME介面後,點選Installed Products,在彈出的對話方塊中選擇OraCrs11g_home,然後點選REMOVE

最後刪除/var/opt目錄下的Oracle資訊和ORACLE_BASE目錄,在兩個節點分別執行下面的SQL

root@newtrade1 # rm -rf /data/oracle
root@newtrade1 # rm -rf /var/opt/oracle

刪除/usr/local/bin目錄下的設定:

root@newtrade2 # rm /usr/local/bin/dbhome
root@newtrade2 # rm /usr/local/bin/oraenv
root@newtrade2 # rm /usr/local/bin/coraenv

最後利用作業系統命令檢查一下,系統中是否還殘留一些Oracle的設定:

root@newtrade1 # find / -name oracle
/opt/VRTSvcs/wizards/bin/oracle
/opt/openv/netbackup/ext/db_ext/oracle
/usr/appserver/samples/blueprints/petstore1.4/src/sql/oracle
/usr/appserver/samples/jdbc/apps/simple/setup/sql/oracle
/usr/appserver/samples/security/realms/apps/rdbms/setup/sql/oracle
/export/CFS/MP1/cluster_server_agents/oracle_agent/patches/123670-01/VRTScsocw/reloc/opt/VRTSvcs/wizards/bin/oracle
/export/CFS/veritas/cluster_server_agents/oracle_agent/pkgs/VRTScsocw/reloc/opt/VRTSvcs/wizards/bin/oracle
/export/home/oracle
/data/oracle

這裡的oracle相關目錄和檔案都是其他軟體中所包含的檔案,比如netbackup等。

如果是利用VCM,則可以利用下面的方法清除共享磁碟:

root@newtrade1 # vxassist -g datavg remove volume ocr
root@newtrade1 # vxassist -g datavg remove volume vot

整個Oracle資料庫和RAC環境清除工作至此結束,當然如果願意可以透過userdelgroupdel刪除oracle使用者和oinstalldba組。

 

 

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

相關文章