Oracle 10g RAC刪除、增加節點

parknkjun發表於2014-03-22
一、檢視狀態
[root@rac1 bin]# ./crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....B1.inst application    ONLINE    ONLINE    rac1        
ora....B2.inst application    ONLINE    ONLINE    rac2        
ora.RACDB.db   application    ONLINE    ONLINE    rac2        
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2        
二、停止ASM例項
[root@rac1 bin]# ./srvctl stop asm -n rac1 -i +ASM1
[root@rac1 bin]# ./crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....B1.inst application    OFFLINE   OFFLINE               
ora....B2.inst application    ONLINE    ONLINE    rac2        
ora.RACDB.db   application    ONLINE    ONLINE    rac1        
ora....SM1.asm application    OFFLINE   OFFLINE               
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    OFFLINE               
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    OFFLINE             


三、移除ASM例項
[root@rac1 bin]# ./srvctl remove asm -n rac1 -i +ASM1
PRKS-1023 : Failed to remove CRS resource for ASM instance "+ASM1" on node "rac1", [CRS-0214: Could not unregister resource 'ora.rac1.ASM1.asm'.]


四、取消DB例項與ASM例項
[root@rac1 bin]# ./crs_unregister ora.RACDB.RACDB1.inst
[root@rac1 bin]# ./crs_unregister ora.rac1.ASM1.asm


五、檢視狀態、ASM與DB例項已經沒有了
[root@rac1 bin]# ./crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....B2.inst application    OFFLINE   OFFLINE               
ora.RACDB.db   application    OFFLINE   OFFLINE               
ora....C1.lsnr application    OFFLINE   OFFLINE               
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2       
六、檢視節點資訊
[root@rac1 bin]# ./olsnodes -n
rac1    1
rac2    2


七、在另外一個節點上、root使用者下執行刪除指令碼
su - root


cd $ORACLE_HOME/install
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/crs_1
[root@rac2 install]# ./rootdeletenode.sh rac1
CRS nodeapps are deleted successfully
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Node deletion operation successful.
'rac1' deleted successfully
八、檢視狀態
[root@rac2 bin]# ./crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....B2.inst application    OFFLINE   OFFLINE               
ora.RACDB.db   application    OFFLINE   OFFLINE               
ora....C1.lsnr application    OFFLINE   OFFLINE               
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2   
九、移除節點
[root@rac2 bin]# ./srvctl remove nodeapps -n rac1
Please confirm that you intend to remove the node-level applications on node rac1 (y/[n]) y
PRKO-2108 : Node applications are still running on node: rac1
十、檢視狀態
[root@rac2 bin]# ./crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....B2.inst application    OFFLINE   OFFLINE               
ora.RACDB.db   application    OFFLINE   OFFLINE               
ora....C1.lsnr application    OFFLINE   OFFLINE               
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2   
十一、取消LISTENER、VIP、GSD、ONS服務註冊
[root@rac2 bin]# ./crs_stat -l|grep C1.lsnr
NAME=ora.rac1.LISTENER_RAC1.lsnr
[root@rac2 bin]# ./crs_unregister ora.rac1.LISTENER_RAC1.lsnr


[root@rac2 bin]# ./crs_stop ora.rac1.vip
Attempting to stop `ora.rac1.vip` on member `rac1`
Stop of `ora.rac1.vip` on member `rac1` succeeded.
[root@rac2 bin]# ./crs_unregister ora.rac1.vip


[root@rac2 bin]# ./crs_stop ora.rac1.gsd
Attempting to stop `ora.rac1.gsd` on member `rac1`
Stop of `ora.rac1.gsd` on member `rac1` succeeded.
[root@rac2 bin]# ./crs_unregister ora.rac1.gsd


[root@rac2 bin]# ./crs_stop ora.rac1.ons
Attempting to stop `ora.rac1.ons` on member `rac1`
Stop of `ora.rac1.ons` on member `rac1` succeeded.
[root@rac2 bin]# ./crs_unregister ora.rac1.ons
十二、檢視狀態
[root@rac2 bin]# ./crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....B2.inst application    OFFLINE   OFFLINE               
ora.RACDB.db   application    OFFLINE   OFFLINE               
ora....SM2.asm application    ONLINE    OFFLINE               
ora....C2.lsnr application    ONLINE    OFFLINE               
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac1      


十三、在另外一個節點、ORACLE使用者下
$ORACLE_HOME/oui/bin
[oracle@rac2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 CLUSTER_NODES=rac2
Starting Oracle Universal Installer...


No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
'UpdateNodeList' was successful.


十四、在被刪除節點上
設定export ORACLE_HOME=...
su - root
cd $CRS_HOME
[root@rac1 install]# export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
[root@rac1 install]# ./rootdelete.sh remote nosharedvar
CRS-0210: Could not find resource 'ora.RACDB.RACDB1.inst'.


CRS-0210: Could not find resource 'ora.rac1.LISTENER_RAC1.lsnr'.
CRS-0210: Could not find resource 'ora.rac1.ons'.
CRS-0210: Could not find resource 'ora.rac1.vip'.
CRS-0210: Could not find resource 'ora.rac1.gsd'.
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.
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'
十五、在另外節點:
su - root
cd $CRS_HOME/install:
./rootdeletenode.sh rac1,1
[root@rac2 install]# ./rootdeletenode.sh rac1,1
CRS-0210: Could not find resource 'ora.rac1.LISTENER_RAC1.lsnr'.
CRS-0210: Could not find resource 'ora.rac1.ons'.
CRS-0210: Could not find resource 'ora.rac1.vip'.
CRS-0210: Could not find resource 'ora.rac1.gsd'.
CRS-0210: Could not find resource ora.rac1.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.noderac1 marked for deletion is not there. Ignoring.
Successfully deleted 5 keys from OCR.
Node deletion operation successful.
'rac1,1' deleted successfully
十六、檢視節點資訊
[root@rac2 bin]# ./olsnodes -n
rac2    2
十七、在另外節點:
su - oracle
cd $CRS_HOME/oui/bin 
[oracle@rac2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracle/prodcut/10.2.0/db_1/bin CLUSTER_NODES=rac2
Starting Oracle Universal Installer...


No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
如果清除失敗:
[oracle@rac2 bin]$ ./runInstaller -updateNodeList -noClusterEnable -local ORACLE_HOME=/u01/app/oracle/product/10.2.0/crs_1/bin CLUSTER_NODES=rac2
[oracle@rac2 bin]$ ./olsnodes -n
rac2    2
十八
新增節點:
圖形介面:
$CRS_HOME/oui/bin/addNode.sh






十九、檢視節點
[root@rac2 bin]# ./crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....B2.inst application    ONLINE    ONLINE    rac2        
ora.RACDB.db   application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2


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

相關文章