Oracle 10g 增刪節點
說明
目前資料庫為10gRAC 環境(10.2.0.4) ,作業系統為 hp-unix ,採用ASM 磁碟組,
環境如下:
作業系統:
HP
資料庫:
10.2.0.4
資料檔案儲存方式:
ASM
資料量: 131GB
Data 盤大小: 800000MB
. 刪除目標節點:
目標停節點服務
在節點 1 執行對目標節點資源的停止任務,一定要手動執行停止操作,即使顯示 offline
[oracle@rac2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application ONLINE ONLINE rac1
ora....l1.inst application ONLINE ONLINE rac1
ora....l2.inst 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
[root@rac1 bin]# ./srvctl stop inst -d orcl -i orcl2
[root@rac1 bin]# ./srvctl stop nodeapps -n rac2
[root@rac1 bin]# ./srvctl stop listener -n rac2
[root@rac1 bin]# ./srvctl stop asm -n rac2
[root@rac1 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application ONLINE ONLINE rac1
ora....l1.inst application ONLINE ONLINE rac1
ora....l2.inst application OFFLINE OFFLINE
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 OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
[root@rac1 bin]#
(這裡因節點 3 已故障,只需確認服務已關閉即可)
刪除目標節點database
這裡我們使用圖形化介面操作:
在第一節點 dbca
cluster database -> instance management -> delete an instance -> 選擇 RAC03 例項 -> perform another (N)!
刪除目標節點asm
[root@rac1 bin]# ./srvctl stop asm -n rac2
[root@rac1 bin]# ./srvctl remove asm -n rac2
[root@rac1 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application ONLINE ONLINE rac1
ora....l1.inst application ONLINE ONLINE rac1
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....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
[root@rac1 bin]#
刪除目標節點監聽
[oracle@rac1 ~]$ netca
[oracle@rac2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application ONLINE ONLINE rac1
ora....l1.inst application ONLINE ONLINE rac1
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.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
[oracle@rac2 ~]$
刪除目標節點
主節點更新oracle Inventory :
[oracle@rac1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=rac1" (填剩餘節點host )
Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
'UpdateNodeList' was successful.
目標節點更新oracle Inventory
[oracle@rac2 ~]$ export DISPLAY=192.168.56.1:0
[oracle@rac2 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES=rac2" -local
Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
'UpdateNodeList' was successful.
[oracle@rac2 ~]$
目標節點刪除資料庫軟體
[oracle@rac2 ~]$ $ORACLE_HOME/oui/bin/runInstaller -deinstall
出來 OUI 畫面,選擇刪除軟體,選擇 oradb10g_home,REMOVE! 完成退出!
該伺服器如果不準備再安裝 ORACLE 資料庫的話,可以同時刪除 /etc/oratab 檔案。
此處發現 2 節點的 database 目錄也遭到了刪除,尚不清楚原因,建議用 rm -rf 刪除軟體目錄
刪除目標節點ONS 配置及nodeapps
[root@rac1 bin]# ./racgons remove_config rac2:6200
racgons: Existing key value on rac2 = 6200.
racgons: rac2:6200 removed from OCR.
[root@rac1 bin]# ./srvctl remove nodeapps -n rac2
Please confirm that you intend to remove the node-level applications on node rac2 (y/[n]) y
[root@rac1 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application ONLINE ONLINE rac1
ora....l1.inst application ONLINE ONLINE rac1
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
[root@rac1 bin]#
目標節點刪除叢集軟體
首先仍是在任意保留的節點中操作:
[oracle@rac1 ~]$ $CRS_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$CRS_HOME "CLUSTER_NODES=rac1" CRS=TRUE (剩餘節點host )
Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
'UpdateNodeList' was successful.
再在目標節點執行:
[oracle@rac3 dbs]$ $CRS_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$CRS_HOME "CLUSTER_NODES=rac3" CRS=TRUE -local
Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
'UpdateNodeList' was successful.
[oracle@rac2 ~]$
再執行 rundeinstall
彈出視窗,選中 crs 路徑,然後點選 remove 即可。
操作完成後,點選 close 關閉視窗。叢集件軟體就被成功從目標節點刪除了。接下來 如
願意 ( 或者確實需要 ) ,可以考慮清除 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 的相關環境變數設定;
從ocr 刪除節點資訊
在任意一臺保留的節點執行:
[root@rac01 bin]# ./olsnodes -n -i
rac01 1 rac01-vip
rac02 2 rac02-vip
rac03 3
儘管透過前面的操作, ORACLE 軟體以及叢集件均已被刪除,節點資訊也更新了,不過 OCR 中還是保留有 rac03 節點的資訊,因此這塊也需要刪除,執行指令碼如下 :
[root@rac01 install]# pwd
/u01/crs/install
[root@rac1 install]# ./rootdeletenode.sh rac2,2
CRS-0210: Could not find resource 'ora.rac2.LISTENER_RAC2.lsnr'.
CRS-0210: Could not find resource 'ora.rac2.ons'.
CRS-0210: Could not find resource 'ora.rac2.vip'.
CRS-0210: Could not find resource 'ora.rac2.gsd'.
CRS-0210: Could not find resource ora.rac2.vip.
CRS nodeapps are deleted successfully
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
CSS indicates failure 17 acknowledging the deletion.
Attempting to roll back the deletion.
Rollback of node deletion successful.
Node deletion failed but configuration is intact.
'rac2,2' deleted successfully
[root@rac1 bin]# ./olsnodes -n -i -p
rac1 1 rac1-priv rac1-vip
檢查crs_stat -t -v
[root@rac1 bin]# ./crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.orcl.db application 0/1 0/1 ONLINE ONLINE rac1
ora....l1.inst application 0/5 0/0 ONLINE ONLINE rac1
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1
ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip application 0/0 0/0 ONLINE ONLINE rac1
[root@rac1 bin]#
檢查redo 是否刪乾淨,不然可能影響後續新增節點
SQL> select * from v$logfile;
GROUP# STATUS TYPE
---------- -------------- --------------
MEMBER
--------------------------------------------------------------------------------
IS_REC
------
2 ONLINE
+DATA/orcl/redo02.log
NO
1 ONLINE
+DATA/orcl/redo01.log
NO
GROUP# STATUS TYPE
---------- -------------- --------------
MEMBER
--------------------------------------------------------------------------------
IS_REC
------
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@rac1 ~]$ export ORACLE_SID=+ASM1
[oracle@rac1 ~]$ asmcmd
ASMCMD> cd data/orcl
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
control01.ctl
control02.ctl
control03.ctl
redo01.log
redo02.log
redo03.log
redo04.log
spfileorcl.ora
sysaux01.dbf
system01.dbf
temp01.dbf
undotbs01.dbf
users01.dbf
ASMCMD> rm -f redo03.log redo04.log
ASMCMD>
新增新節點
預檢查
檢查新節點與原節點互信及/etc/hosts 檔案是否配置好
為新節點安裝叢集軟體
在第一節點上進入 CRS_HOME/oui/bin ,執行指令碼 addNode.sh
[oracle@rac01 bin]$ export
[oracle@rac01 bin]$ export DISPALY=192.168.56.1:0.0
[oracle@rac01 bin]$ ls
addLangs.sh addNode.sh lsnodes ouica.sh resource runConfig.sh runInstaller runInstaller.sh
[oracle@rac01 bin]$ ./addNode.sh
下一步,輸入新節點的 IP ,進行安裝!
[root@rac1 bin]#
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Attempting to add 1 new nodes to the configuration
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 2: rac3 rac3-priv rac3
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
/oracle/product/crs/bin/srvctl add nodeapps -n rac3 -A rac3-vip/255.255.255.0/eth0 -o /oracle/product/crs
[root@rac1 bin]#
此時crs_stat -t 如下:
[root@rac1 bin]# ./olsnodes -n -i -p
rac1 1 rac1-priv rac1-vip
rac3 2 rac3-priv rac3-vip
[root@rac1 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application ONLINE ONLINE rac1
ora....l1.inst application ONLINE ONLINE rac1
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 UNKNOWN rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora.rac3.gsd application ONLINE UNKNOWN rac3
ora.rac3.ons application ONLINE UNKNOWN rac3
ora.rac3.vip application ONLINE ONLINE rac3
[root@rac1 bin]#
接下來需要將新節點的 ONS(Oracle Notification Services) 配置資訊寫入 OCR(Oracleter Register) ,在節點 1 執行指令碼如下:
[oracle@rac01 bin]$ pwd
/u01/crs/bin
[oracle@rac01 bin]$ ./racgons add_config rac03:6200
提 示 : rac03 的埠號可以查詢該結節中ons.config 檔案中的配置,此處指定的埠號為remoteport 。
[root@rac03 conf]# pwd
/u01/crs/opmn/conf
[root@rac03 conf]# more ons.config
localport=6113
remoteport=6200
loglevel=3
useocr=on
至此,新節點的 CLUSTERWARE 配置完成,要檢查安裝的結果,可以在新節點中調 用cluvfy 命令進行驗證,例如:
[oracle@rac01 ~]$ /u01/crs/bin/cluvfy stage -post crsinst -n rac03 -verbose
為新節點安裝資料庫軟體
在第一節點 ORACLE_HOME/oui/bin 執行 addNode.sh
[oracle@rac1 database]$ cd oui/bin/
[oracle@rac1 bin]$ pwd
/oracle/product/database/oui/bin
[oracle@rac1 bin]$ ./addNode.sh
Starting Oracle Universal Installer...
為新節點配置監聽
在新節點執行 netca ,選出 cluster listener ,下一步選擇新節點,開始配置,完成
[oracle@rac1 bin]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application ONLINE ONLINE rac1
ora....l1.inst application ONLINE ONLINE rac1
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 UNKNOWN rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE UNKNOWN rac3
ora.rac3.ons application ONLINE UNKNOWN rac3
ora.rac3.vip application ONLINE ONLINE rac3
為新節點建立例項
[oracle@rac1 bin]$ dbca
cluster database -> instance management ->add an instance
-> 輸入sys ,密碼 -> 選擇新增例項的節點名(RAC3) 例項名orcl3
-> 開始建立新例項。期間提示是否建立ASM 相關例項,如果是ASM 環境則點是。最後點NO 不進行其他操作,完成安裝
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69993859/viewspace-2755763/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 10g RAC刪除、增加節點Oracle 10g
- oracle 10g rac,刪除故障節點並新增新節點Oracle 10g
- oracle 10g rac 新增節點與刪除節點步驟Oracle 10g
- Oracle RAC 10g叢集節點刪除[zt]Oracle
- 【ztree】zTree節點增刪改
- onnx 增刪改查,修改節點,刪除節點,修改input,output
- 【ztree系列】節點的增刪改
- Oracle Rac 刪除節點Oracle
- Oracle RAC 10g叢集節點增加Oracle
- Oracle 10g RAC增加節點例項Oracle 10g
- 圍繞DOM元素節點的增刪改查
- 【轉】JavaScript對Json節點的增刪改JavaScriptJSON
- 刪除oracle10g rac(rhel4)節點_節點Oracle
- ORACLE RAC環境下刪除節點Oracle
- oracle11g_RAC新增刪除節點Oracle
- ORACLE 10G增加一個節點rac3Oracle 10g
- RHEL5 Oracle 10g RAC新增新節點Oracle 10g
- Oracle10g RAC 刪除及加入節點Oracle
- oracle 10g srvctl 不能帶起節點例項問題Oracle 10g
- Tree樹狀圖的動態增刪查改(中)新增節點
- Oracle10g RAC 刪除及加入節點 - updatedOracle
- JavaScript刪除節點自身JavaScript
- Oracle 10g RAC 安裝及加入新節點文件密碼Oracle 10g密碼
- Oracle10g RAC 刪除節點步驟及原理Oracle
- Oracle10g RAC 刪除已經失效的節點Oracle
- oracle11gr2_rac_刪除節點最佳實踐Oracle
- 【RAC】刪除RAC資料庫節點(六)——刪除Oracle叢集服務資料庫Oracle
- 【RAC】刪除RAC資料庫節點(七)——刪除Oracle叢集軟體資料庫Oracle
- jQuery如何刪除元素節點jQuery
- Oracle叢集軟體管理-新增和刪除叢集節點Oracle
- 【RAC】Oracle10g rac新增刪除節點命令參考Oracle
- 【RAC】Oracle11g RAC刪除節點相關事項Oracle
- 刪除oracle10g rac(rhel4)節點_例項Oracle
- Oracle10203RAC環境刪除節點(三)Oracle
- Oracle10203RAC環境刪除節點(二)Oracle
- Oracle10203RAC環境刪除節點(一)Oracle
- redis cluster節點/新增刪除操作Redis
- mongodb副本集新增刪除節點MongoDB