共计 8544 个字符,预计需要花费 22 分钟才能阅读完成。
一、准备工作
1. 数据库信息
操作系统版本 : OEL5.4 x64
数据库版本 : Oracle 10.2.0.5 x64 RAC
2. IP 地址对应信息
说明: 服务器主机名不能更改,如确实要改名,需要重装 CRS 解决,还不如重新安装呢。
本文环境是 10g rac+ocfs+asm, 心跳地址不变,IP 地址因环境限制暂时采用同一个网段,不同的 IP 地址,但是过程与不同网段改名一致。
原 IP 地址:
192.168.0.6 node1 修改为: 192.168.0.206
192.168.0.7 node2 修改为: 192.168.0.207
192.168.0.8 node1-vip 修改为: 192.168.0.208
192.168.0.9 node2-vip 修改为: 192.168.0.209
10.10.10.10 node1-priv 不变
10.10.10.20 node2-priv 不变
调整后 IP 地址:
192.168.0.206 node1
192.168.0.207 node2
192.168.0.208 node1-vip
192.168.0.209 node2-vip
10.10.10.10 node1-priv
10.10.10.20 node2-priv
二、停止 oracle rac 服务。
1. 关闭 ORACLE RAC 进程, 可在任一节点上执行,这里采用节点 1.
[root@node1 ~]# cd /u01/app/oracle/product/10.2.0/crs/bin
[root@node1 ~]# pwd
/u01/app/oracle/product/10.2.0/crs/bin
# 依次关闭数据库, asm, node application, crs
[root@node1 bin]# ./srvctl stop database -d orcl
[root@node1 bin]# ./srvctl stop asm -n node1
[root@node1 bin]# ./srvctl stop asm -n node2
[root@node1 bin]# ./srvctl stop nodeapps -n node1
[root@node1 bin]# ./srvctl stop nodeapps -n node2
# 查看关闭情况
[root@node1 bin]# ./crs_stat -t
Name Type Target State Host
————————————————————
ora….SM1.asm application OFFLINE OFFLINE
ora….E1.lsnr application OFFLINE OFFLINE
ora.node1.gsd application OFFLINE OFFLINE
ora.node1.ons application OFFLINE OFFLINE
ora.node1.vip application OFFLINE OFFLINE
ora….SM2.asm application OFFLINE OFFLINE
ora….E2.lsnr application OFFLINE OFFLINE
ora.node2.gsd application OFFLINE OFFLINE
ora.node2.ons application OFFLINE OFFLINE
ora.node2.vip application OFFLINE OFFLINE
ora.orcl.db application OFFLINE OFFLINE
ora….l1.inst application OFFLINE OFFLINE
ora….l2.inst application OFFLINE OFFLINE
2. 关闭 crs 后台进程
# 注:必须在所有(node1,node2)节点上 root 用户执行。
[root@node1 bin]# /etc/init.d/init.crs stop
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.
[root@node2 bin]# /etc/init.d/init.crs stop
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.
三、修改服务器 IP 地址
1. node1,node2 修改 /etc/hosts 文件。保持 2 个节点的一致
[root@node1 bin]# vi /etc/hosts
192.168.0.206 node1
192.168.0.207 node2
192.168.0.208 node1-vip
192.168.0.209 node2-vip
10.10.10.10 node1-priv
10.10.10.20 node2-priv
2. 在两个节点上分别修改 eth0 地址、网关,心跳地址不变,不改动。
node1 节点:
[root@node1 bin]# more /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29:EA:C7:1F
IPADDR=192.168.0.206
NETMASK=255.255.255.0
ONBOOT=yes
node2 节点:
[root@node2 bin]# more /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.0.207
NETMASK=255.255.255.0
HWADDR=00:0c:29:6c:08:aa
3. 重启网络服务
# service network restart
# service network restart
四、启动 crs.
1. 在两个节点(node1,node2)启动 crs, 并关闭随 crs 启动的服务
[root@node1 bin]# /etc/init.d/init.crs start
Startup will be queued to init within 30 seconds.
[root@node2 bin]# /etc/init.d/init.crs start
Startup will be queued to init within 30 seconds.
# 由于 IP 地址还未修改完成,一些服务器无法启动成功,需要关闭掉。
[root@node1 bin]# ./crs_stat -t
Name Type Target State Host
————————————————————
ora….SM1.asm application ONLINE ONLINE node1
ora….E1.lsnr application ONLINE OFFLINE
ora.node1.gsd application ONLINE OFFLINE
ora.node1.ons application ONLINE ONLINE node1
ora.node1.vip application ONLINE ONLINE node1
ora….SM2.asm application ONLINE ONLINE node2
ora….E2.lsnr application ONLINE OFFLINE
ora.node2.gsd application ONLINE OFFLINE
ora.node2.ons application ONLINE ONLINE node2
ora.node2.vip application ONLINE ONLINE node2
ora.orcl.db application ONLINE OFFLINE
ora….l1.inst application ONLINE OFFLINE
ora….l2.inst application ONLINE OFFLINE
# 关闭所有服务
[root@node1 bin]# ./srvctl stop database -d orcl
[root@node1 bin]# ./srvctl stop asm -n node1
[root@node1 bin]# ./srvctl stop asm -n node2
[root@node1 bin]# ./srvctl stop nodeapps -n node1
[root@node1 bin]# ./srvctl stop nodeapps -n node2
# 确认关闭
[root@node1 bin]# ./crs_stat -t
Name Type Target State Host
————————————————————
ora….SM1.asm application OFFLINE OFFLINE
ora….E1.lsnr application OFFLINE OFFLINE
ora.node1.gsd application OFFLINE OFFLINE
ora.node1.ons application OFFLINE OFFLINE
ora.node1.vip application OFFLINE OFFLINE
ora….SM2.asm application OFFLINE OFFLINE
ora….E2.lsnr application OFFLINE OFFLINE
ora.node2.gsd application OFFLINE OFFLINE
ora.node2.ons application OFFLINE OFFLINE
ora.node2.vip application OFFLINE OFFLINE
ora.orcl.db application OFFLINE OFFLINE
ora….l1.inst application OFFLINE OFFLINE
ora….l2.inst application OFFLINE OFFLINE
[root@node1 bin]#
2. 使用 oifcfg 修改网卡设置, oifconfig 可以用来设置和查看网卡使用的方式.
注:node1,node2 上操作,如果修改的网段相同,可以不做,但是如果其它网段,可以按如下方式
# 查看当前配置
[root@node1 bin]# ./oifcfg getif -global
eth0 192.168.0.0 global public
eth1 10.10.10.0 global cluster_interconnect
# 删除当前配置
[root@node1 bin]# ./oifcfg delif -global eth0
[root@node1 bin]# ./oifcfg delif -global eth1
[root@node1 bin]# ./oifcfg getif
# 重新添加,内联及心跳网段(对应 IP 地址子网掩码配置网段)
[root@node1 bin]# ./oifcfg setif -global eth0/192.168.0.0:public
[root@node1 bin]# ./oifcfg setif -global eth1/10.10.10.0:cluster_interconnect
[root@node1 bin]# ./oifcfg getif
eth0 192.168.0.0 global public
eth1 10.10.10.0 global cluster_interconnect
[root@node1 bin]# ./oifcfg iflist
eth0 192.168.0.0
eth1 10.10.10.0
3. node1,node2 修改 VIP 地址
[root@node1 bin]# ./srvctl modify nodeapps -n node1 -A 192.168.0.208/255.255.255.0/eth0
[root@node1 bin]# ./srvctl modify nodeapps -n node2 -A 192.168.0.209/255.255.255.0/eth0
4. node1,node2 设置 listener.ora 和 tnsnames.ora
# 查看原 IP 地址,修改为现在的 IP 地址。
[root@node1 bin]# vi /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
SID_LIST_LISTENER_NODE1 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER_NODE1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.206)(PORT = 1521)(IP = FIRST))
)
)
5. node1 上操作,启动 node 应用, asm, 数据库
[root@node1 bin]# ./srvctl start nodeapps -n node1
[root@node1 bin]# ./srvctl start nodeapps -n node2
[root@node1 bin]# ./srvctl start asm -n node1
[root@node1 bin]# ./srvctl start asm -n node2
[root@node1 bin]# ./srvctl start instance -d orcl -i orcl1
[root@node1 bin]# ./srvctl start instance -d orcl -i orcl2
[root@node1 bin]# ./crs_stat -t
Name Type Target State Host
————————————————————
ora….SM1.asm application ONLINE ONLINE node1
ora….E1.lsnr application ONLINE ONLINE node1
ora.node1.gsd application ONLINE ONLINE node1
ora.node1.ons application ONLINE ONLINE node1
ora.node1.vip application ONLINE ONLINE node1
ora….SM2.asm application ONLINE ONLINE node2
ora….E2.lsnr application ONLINE ONLINE node2
ora.node2.gsd application ONLINE ONLINE node2
ora.node2.ons application ONLINE ONLINE node2
ora.node2.vip application ONLINE ONLINE node2
ora.orcl.db application ONLINE ONLINE node2
ora….l1.inst application ONLINE ONLINE node1
ora….l2.inst application ONLINE ONLINE node2
若启动出现问题,再进行判断。
6. 确认 IP, 修改完成。
[root@node1 bin]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:EA:C7:1F
inet addr:192.168.0.206 Bcast:192.168.0.255 Mask:255.255.255.0
eth0:1 Link encap:Ethernet HWaddr 00:0C:29:EA:C7:1F
inet addr:192.168.0.208 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 00:0C:29:EA:C7:29
inet addr:10.10.10.10 Bcast:10.10.10.255 Mask:255.255.255.0
[root@node2 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:6C:08:AA
inet addr:192.168.0.207 Bcast:192.168.0.255 Mask:255.255.255.0
eth0:1 Link encap:Ethernet HWaddr 00:0C:29:6C:08:AA
inet addr:192.168.0.209 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 00:0C:29:6C:08:B4
inet addr:10.10.10.20 Bcast:10.10.10.255 Mask:255.255.255.0
7. 重启节点测试,rac 启动均正常,无问题。
更多 Oracle 相关信息见 Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-04/130735.htm