oracle RAC 11gR2 修改ip地址

时间:2022-04-08 08:44:56

有一个很急的项目上线,rac实施由我在公司安装,ip是虚构的,要求在2-3小时内搞定,所以ip是我随便写的。

目前服务器已经运到局点,马上实行修改正式ip。 由于最近在负责项目,逐渐陌生了dba知识,哈哈。好久没有写blog老。

 

[oracle@racdb1 ~]$ hostname
racdb1
[oracle@racdb1 ~]$ more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1racdb1 localhost.localdomain localhost
::1localhost6.localdomain6 localhost6

# Public
192.168.102.124 racdb1
192.168.102.125 racdb2
# Private
192.168.10.124 racdb1-priv
192.168.10.125 racdb2-priv
# Virtual
192.168.102.126 racdb1-vip
192.168.102.127 racdb2-vip

#scan
192.168.102.128 racdb-scan


 --查看磁盘状态

[root@racdb1 raw]# ls -l
total 0
crw-rw---- 1 grid oinstall 162, 1 Aug 8 14:20 raw1
crw-rw---- 1 grid oinstall 162, 2 Aug 7 18:37 raw2
crw-rw---- 1 grid oinstall 162, 3 Aug 8 14:20 raw3
crw-rw---- 1 grid oinstall 162, 4 Aug 8 14:20 raw4
crw-rw---- 1 grid oinstall 162, 5 Aug 7 18:37 raw5
crw-rw---- 1 grid oinstall 162, 6 Aug 7 18:37 raw6
crw-rw---- 1 grid oinstall 162, 7 Aug 7 18:31 raw7


--备份ocr,以备不时之需

[grid@racdb1 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 5749649ab4d74f69bf4ded13660ff8a8 (/dev/raw/raw1) [DGCRS]
Located 1 voting disk(s).
[grid@racdb1 ~]$ dd if=/dev/raw/raw1 of=/home/oracle/voting_disk.bak
dd: opening `/home/oracle/voting_disk.bak': Permission denied
[grid@racdb1 ~]$ exit
logout
[root@racdb1 ~]# dd if=/dev/raw/raw1 of=/home/oracle/voting_disk.bak


--停止所以服务

[root@racdb1 ~]# . /home/grid/.bash_profile 
[root@racdb1 ~]# crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

[root@racdb1 ~]# crsctl stop crs -f
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'racdb1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'racdb1'
CRS-2673: Attempting to stop 'ora.evmd' on 'racdb1'
CRS-2673: Attempting to stop 'ora.asm' on 'racdb1'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'racdb1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'racdb1'
CRS-2677: Stop of 'ora.evmd' on 'racdb1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'racdb1' succeeded
CRS-2677: Stop of 'ora.asm' on 'racdb1' succeeded
CRS-2677: Stop of 'ora.drivers.acfs' on 'racdb1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'racdb1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'racdb1'
CRS-2677: Stop of 'ora.cssd' on 'racdb1' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'racdb1'
CRS-2677: Stop of 'ora.crf' on 'racdb1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'racdb1'
CRS-2677: Stop of 'ora.gipcd' on 'racdb1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'racdb1'
CRS-2677: Stop of 'ora.gpnpd' on 'racdb1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'racdb1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@racdb1 ~]#
[root@racdb2 raw]# . /home/grid/.bash_profile [root@racdb2 raw]# crsctl stop crs -fCRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'racdb2'CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'racdb2'CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'racdb2'CRS-2673: Attempting to stop 'ora.mdnsd' on 'racdb2'CRS-2673: Attempting to stop 'ora.crf' on 'racdb2'CRS-2677: Stop of 'ora.cssdmonitor' on 'racdb2' succeededCRS-2677: Stop of 'ora.drivers.acfs' on 'racdb2' succeededCRS-2677: Stop of 'ora.mdnsd' on 'racdb2' succeededCRS-2677: Stop of 'ora.crf' on 'racdb2' succeededCRS-2673: Attempting to stop 'ora.gipcd' on 'racdb2'CRS-2677: Stop of 'ora.gipcd' on 'racdb2' succeededCRS-2673: Attempting to stop 'ora.gpnpd' on 'racdb2'CRS-2677: Stop of 'ora.gpnpd' on 'racdb2' succeededCRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'racdb2' has completedCRS-4133: Oracle High Availability Services has been stopped.[root@racdb2 raw]# [root@racdb1 ~]# ps -ef |grep gridroot     12633  9576  0 16:56 pts/1    00:00:00 grep grid[root@racdb1 ~]# ps -ef |grep crsroot     12652  9576  0 16:56 pts/1    00:00:00 grep crs

 

 --备份ip

cp hosts hosts.bak

 

--