oracle10g RAC更改主機public地址及vip地址

season0891發表於2010-11-29
第一步:改public ip metalink文件id:283684.1
[oracle@db2 ~]$oifcfg getif ***檢視public ip內容
[oracle@db2 ~]$oifcfg delif -global eth0 ***刪除
[oracle@db2 ~]$oifcfg setif -global eth0/192.168.3.0:public ***重新設定

第二步:改vip metalink文件id:276434.1
[oracle@db2 ~]$srvctl config nodeapps -n db1 -a ***檢視vip內容
[oracle@db2 ~]$srvctl stop instance -d racdb -i racdb1
[oracle@db2 ~]$srvctl stop instance -d racdb -i racdb2
[oracle@db2 ~]$srvctl stop database -d racdb
[oracle@db2 ~]$srvctl stop nodeapps -n db1
[oracle@db2 ~]$srvctl stop nodeapps -n db2
修改hosts檔案,將各個名稱與新改地址對應好
修改eth檔案 將eth0的地址即public地址改成新地址
之後以root執行以下命令
[root@db2 ~]#srvctl modify nodeapps -n db1 -A 192.168.3.202/255.255.255.0/eth0
[root@db2 ~]#srvctl modify nodeapps -n db2 -A 192.168.3.204/255.255.255.0/eth0
[root@db1 ~]# srvctl config nodeapps -n db1 -a
VIP exists.: /db1-vip/192.168.3.202/255.255.255.0/eth0
[root@db1 ~]# srvctl config nodeapps -n db2 -a
VIP exists.: /db2-vip/192.168.3.204/255.255.255.0/eth0
在各節點修改listener檔案,將涉及到監聽地址的地方改為新的ip地址
然後啟動:
[oracle@db2 ~]$srvctl start nodeapps -n db1
[oracle@db2 ~]$srvctl start nodeapps -n db2
[oracle@db2 ~]$srvctl start database -d racdb
[oracle@db2 ~]$srvctl start instance -d racdb -i racdb1
[oracle@db2 ~]$srvctl start instance -d racdb -i racdb2
或者直接重啟各個節點。

一個知識點:nodeapps服務控制VIP、GSD、LISTENER、和ONS等。



第一次做完後,在啟動nodeapps 時候報錯:
[oracle@db1 ~]$ srvctl start nodeapps -n db1
db1:ora.db1.LISTENER_DB1.lsnr:
db1:ora.db1.LISTENER_DB1.lsnr:LSNRCTL for Linux: Version 10.2.0.4.0 - Production on
13-APR-2009 18:11:13
db1:ora.db1.LISTENER_DB1.lsnr:
db1:ora.db1.LISTENER_DB1.lsnr:Copyright (c) 1991, 2007, Oracle. All rights reserved.
db1:ora.db1.LISTENER_DB1.lsnr:
db1:ora.db1.LISTENER_DB1.lsnr:Starting /opt/oracle/app/prod102/bin/tnslsnr: please
wait...
db1:ora.db1.LISTENER_DB1.lsnr:
db1:ora.db1.LISTENER_DB1.lsnr:TNSLSNR for Linux: Version 10.2.0.4.0 - Production
db1:ora.db1.LISTENER_DB1.lsnr:System parameter file is
/opt/oracle/app/prod102/network/admin/listener.ora
db1:ora.db1.LISTENER_DB1.lsnr:Log messages written to
/opt/oracle/app/prod102/network/log/listener_db1.log
db1:ora.db1.LISTENER_DB1.lsnr:Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)
(HOST=192.168.3.202)(PORT=1521)))
db1:ora.db1.LISTENER_DB1.lsnr:Error listening on: (DESCRIPTION=(ADDRESS=
(PROTOCOL=TCP)(HOST=192.168.1.201)(PORT=1521)(IP=FIRST)))
db1:ora.db1.LISTENER_DB1.lsnr:TNS-12545: Connect failed because target host or object
does not exist
db1:ora.db1.LISTENER_DB1.lsnr: TNS-12560: TNS:protocol adapter error
db1:ora.db1.LISTENER_DB1.lsnr: TNS-00515: Connect failed because target host or
object does not exist
db1:ora.db1.LISTENER_DB1.lsnr: Linux Error: 99: Cannot assign requested address
db1:ora.db1.LISTENER_DB1.lsnr:
db1:ora.db1.LISTENER_DB1.lsnr:Listener failed to start. See the error message(s)
above...
db1:ora.db1.LISTENER_DB1.lsnr:
db1:ora.db1.LISTENER_DB1.lsnr:
db1:ora.db1.LISTENER_DB1.lsnr:LSNRCTL for Linux: Version 10.2.0.4.0 - Production on
13-APR-2009 18:11:16
db1:ora.db1.LISTENER_DB1.lsnr:
db1:ora.db1.LISTENER_DB1.lsnr:Copyright (c) 1991, 2007, Oracle. All rights reserved.
db1:ora.db1.LISTENER_DB1.lsnr:
db1:ora.db1.LISTENER_DB1.lsnr:Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=db1-vip)(PORT=1521)(IP=FIRST)))
db1:ora.db1.LISTENER_DB1.lsnr:TNS-12541: TNS:no listener
db1:ora.db1.LISTENER_DB1.lsnr: TNS-12560: TNS:protocol adapter error
db1:ora.db1.LISTENER_DB1.lsnr: TNS-00511: No listener
db1:ora.db1.LISTENER_DB1.lsnr: Linux Error: 111: Connection refused
db1:ora.db1.LISTENER_DB1.lsnr:Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=192.168.1.201)(PORT=1521)(IP=FIRST)))
db1:ora.db1.LISTENER_DB1.lsnr:TNS-12560: TNS:protocol adapter error
db1:ora.db1.LISTENER_DB1.lsnr: TNS-00530: Protocol adapter error
db1:ora.db1.LISTENER_DB1.lsnr: Linux Error: 113: No route to host
db1:ora.db1.LISTENER_DB1.lsnr:Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)
(KEY=EXTPROC)))
db1:ora.db1.LISTENER_DB1.lsnr:TNS-12541: TNS:no listener
db1:ora.db1.LISTENER_DB1.lsnr: TNS-12560: TNS:protocol adapter error
db1:ora.db1.LISTENER_DB1.lsnr: TNS-00511: No listener
db1:ora.db1.LISTENER_DB1.lsnr: Linux Error: 2: No such file or directory
CRS-0215: Could not start resource 'ora.db1.LISTENER_DB1.lsnr'.

這個錯誤就是沒有修改各節點listener檔案所導致,其監聽地址還為原來的地址。
come from:

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

相關文章