虛擬機器環境下RAC刪除節點(Final)

tolywang發表於2010-01-06


備註: 以下是虛擬機器環境下的配置,某些配置可能不同與實際的RAC環境。


1. 環境 Linux AS5.3 64bit, Oracle10.2.0.4, 3個節點1,2,3,現在需要刪除節點2 。

2. 注意,下列操作均是在確實要保留的例項上進行,不要選擇在要被刪除的節點上進
行操作;作業請做好備份工作。
 

3. 刪除資料庫例項: 在節點1上dbca 刪除節點2的例項 (所有節點都是open狀態)。
選擇RAC database,選擇Instance Management,Delete Instance,
選擇要操作的資料庫,並輸入一個具有sysdba許可權的使用者及密碼
選擇一個要刪除的例項,這裡是orcl2
確定刪除點選OK,接下來可能會跳出一些視窗,如果非報錯,同樣直接點選OK即可
開始進行刪除操作

刪除ASM例項,這裡沒有使用ASM,所以不用這一步。
詳情參考 http://junsansi.itpub.net/post/29894/494352


4.  在節點1上 $ crs_stat -t  檢視一下,節點2上例項已經不存在。


5. 刪除節點資訊: 刪除節點2的監聽服務,在節點1上執行netca .
在節點1上 $ crs_stat -t  檢視一下,節點2上的監聽已經不存在。


6. 停止目標節點(要刪除的節點2)的apps, 可以在任意節點(這裡在節點1上)執行:
$ srvctl  stop nodeapps  -n rac02

$crs_stat -t 可以看到相關服務已經關閉。


7. 刪除目標節點2資料庫軟體, 更新Oracle Inventory ,在節點1上:

rac01$/u01/product/oracle/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_
NODES=rac01,rac03" 
Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/product/oraInventory
'UpdateNodeList' was successful.


接下來要在準備被刪除的節點2上執行,同樣是更新Oracle Inventory。

rac02$/u01/product/oracle/oui/bin/runInstaller -updateNodeList ORACLE_
HOME=$ORACLE_HOME  "CLUSTER_NODES=rac02" -local 
Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/product/oraInventory
'UpdateNodeList' was successful.

 

8. 然後就可以在節點2刪除該節點上的資料庫軟體了(注意選擇ORACLE軟體,不是crs),
如果節點2本身是損壞的,是關閉的,就不需要執行刪除。這裡RAC02是正常的,所以需要執行。

rac02$ $ORACLE_HOME/oui/bin/runInstaller   -deinstall

我在這裡碰到一個java錯誤,估計是libXp包沒有安裝。
[root@rac02 packages]# rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm
warning: libXp-1.0.0-8.1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:libXp                  ########################################### [100%]

 

 

9. 刪除ONS配置: 在保留節點1上執行

rac01$/u01/product/crs/bin/racgons remove_config rac02:6200
racgons: Existing key value on rac02 = 6200.
racgons: rac02:6200 removed from OCR.

 

 


10. 刪除節點2  CRS 服務,進入/u01/product/crs/install 目錄,執行rootdelete.sh,在將要被刪除的
節點上執行。 

[root@rac02 packages]# cd /u01/product/crs/install
[root@rac02 install]# pwd
/u01/product/crs/install
[root@rac02 install]# ./rootdelete.sh
CRS-0210: Could not find resource 'ora.rac02.LISTENER_RAC02.lsnr'.
CRS-0216: Could not stop resource 'ora.rac02.ons'.
CRS-0216: Could not stop resource 'ora.rac02.vip'.
CRS-0216: Could not stop resource 'ora.rac02.gsd'.
Shutting down Oracle Cluster Ready Services (CRS):
/etc/init.d/init.cssd: line 319: /tmp/oratz.1556: No such file or directory
/etc/init.d/init.crsd: line 83: /tmp/oratz.1619: No such file or directory
Jan 05 02:47:06.646 | 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'
[root@rac02 install]#

 

 

11. 在保留節點1上開啟crs,
rac01$crs_start -all


[root@rac01 install]# /u01/product/crs/bin/srvctl remove nodeapps -n rac02
Please confirm that you intend to remove the node-level applications on node rac02 (y/[n]) y
CRS-0210: Could not find resource ora.rac02.vip.

 


12. 執行完上述命令後,返回oracle使用者,執行crs_stat檢視當前應用的狀態,可以看到節點2的資訊已經都不存在了。

 

13. 刪除目標節點clusterware軟體, 這裡就是選擇crs了,在存在的節點1上執行:

[oracle@rac01 bin]$ /u01/product/crs/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORA_CRS_HOME  "CLUSTER_NODES=rac01,rac03" CRS=TRUE

Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/product/oraInventory
'UpdateNodeList' was successful.

 

 

14. 然後切換至目標節點2,執行更新Oracle Inventory的操作, 如果節點2已經損壞關機,就不用執行。 

rac02$/u01/product/crs/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORA_CRS_HOME
  "CLUSTER_NODES=rac02"  CRS=TRUE  -local
Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/product/oraInventory
'UpdateNodeList' was successful.

 

 

15. 接下來在目標節點2執行runInstaller -deinstall命令,執行clusterware軟體的刪除操作(注意是在介面操作):

[oracle@rac02]$cd  $ORA_CRS_HOME/oui/bin/   
[oracle@rac02]$./runInstaller  -deinstall ,如果節點2已經損壞關閉就不用執行。

 


16. 從OCR中刪除節點資訊(在存在的節點1上執行): 

在節點1上檢視一下節點資訊

rac01$olsnodes
rac01
rac02
rac03

rac01$./olsnodes -n -i
rac01   1       vip01
rac02   2      
rac03   3       vip03

儘管透過前面的操作,ORACLE軟體以及叢集件均已被刪除,節點資訊也更新過了,不過OCR中還是保留
有 rac02 節點的資訊,因此這塊也需要刪除,執行指令碼如下(切換到root使用者):

[root@rac01 install]# cd /u01/product/crs/install
[root@rac01 install]# ./rootdeletenode.sh  rac02,2  

CRS-0210: Could not find resource 'ora.rac02.LISTENER_RAC02.lsnr'.
CRS-0210: Could not find resource 'ora.rac02.ons'.
CRS-0210: Could not find resource 'ora.rac02.vip'.
CRS-0210: Could not find resource 'ora.rac02.gsd'.
CRS-0210: Could not find resource ora.rac02.vip.
CRS nodeapps are deleted successfully
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully deleted 14 values from OCR.
Key SYSTEM.css.interfaces.noderac02 marked for deletion is not there. Ignoring.
Successfully deleted 5 keys from OCR.
Node deletion operation successful.
'rac02,2' deleted successfully

 


[root@rac01 ~]# su - oracle
rac01$
rac01$cd /u01/product/crs/bin/
rac01$./olsnodes -n -i
rac01   1       vip01
rac03   3       vip03
rac01$

到此,刪除節點操作結束。

 

17.  如果願意(或者確實需要),可以考慮清除ORACLE留下的一些操作痕跡,包括但不限於下列:

刪除$ORACLE_BASE/oraInventory目錄
刪除/etc/inittab檔案
刪除/var/tmp/.oracle目錄
刪除ORA相關的啟動關閉指令碼,比如/etc/init.d/init*,以及/etc/rc?.d/*init.crs等檔案
刪除/etc/oracle目錄
清除crontab中關於ORACLE的相關任務;
清除oracle使用者下profile中關於ORA的相關環境變數設定;
清除共享儲存分配給RAC02的相關許可權 

 

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

相關文章