Modifying the VIP Address or VIP Hostname in Oracle RAC Node

Modifying the VIP Address or VIP Hostname in Oracle RAC Node

http://www.oracleracexpert.com/2010/06/modifying-vip-address-or-vip-hostname.html



Oracle 10g or 11g uses Virtual IP address (VIP) in clustered environment for clients to connect to the database. During the installation of Oracle Clusterware users are prompted to enter VIP and VIP hostname for each node in the cluster. The VIP is a static IP with a hostname defined and also resolved through DNS.

The VIP information is stored in OCR (Oracle Cluster Registry) and also in different HA framework. Changing the VIP Address or VIP Hostname involves modification of the nodeapps, which includes the VIP,GSD, Listener, and ONS(Oracle Notification Services).The VIP can be changed while the nodeapps are running, but the changes will take effect only when nodeapps are restated.

Note that stopping nodeapps may cause other resources to be stopped for ex: - ASM, instance or database, so the change should be made during scheduled outage.

Follow the steps to change the VIP address or VIP hostname.

Step 1:- Check the original configuration before change
$ srvctl config nodeapps -n -a
Using '-a' will give you the current VIP hostname, VIP address and interface

Example:
# srvctl config nodeapps -n testrac01 -a
VIP exists.: /testrac01-vip/10.11.12.01/255.255.255.0/eth0

The VIP Hostname is 'testrac01-vip’
The VIP IP address is '10.11.12.01'
The VIP subnet mask is '255.255.255.0'
The Interface Name used by the VIP is called 'eth0'

Step 2:- Stop Instance,ASM,Nodeapps resources
$srvctl stop instance -d testdb -i tetdb1
$srvctl stop asm -n testrac01
$srvctl stop nodeapps -n testrac01

Step 3:- Verify the VIP Address is no longer running by using below command
$ifconfig -a

You can also check the resources status using crs_stat command.

Step 4:- Update /etc/hosts file with new VIP Address or VIP hostname on node1 and also update DNS to associate the new IP address with VIP hostname as per /etc/hosts file.

Step 5:- Modify VIP Address or VIP hostname on nodeapps by using srvctl command (Run as root)
#srvctl modify nodeapps -n [-o ] [-A ]
Where
-n < node_name> - Node name.
-o - Oracle Home for the cluster software (CRS-Home).
-A The node level VIP address (/netmask[/if1[|if2|...]]).

Example:- Modify the VIP Address to 10.11.12.11
#srvctl modify nodeapps -n testrac01 -A 10.11.12.11/255.255.255.0/eth0

Use below command to change to change VIP address using VIP hostname.The srvctl command will resolve the IP to hostname or the hostname to IP address. You can use the same command to change the VIP hostname from ”testrac01-vip” to “testrac01-v”

#srvctl modify nodeapps -n testrac01 -A testrac01-v/255.255.255.0/eth0

Step 6:- Verify the change by running below command
$srvctl config nodeapps -n testrac01 –a

Step7:- Start all resources
$srvct start nodeapps -n testrac01
$srvctl start asm -n testrac01
$srvctl start instance -d testdb –i testdb1

Step8:- Repeat the same steps on all remaining nodes in the cluster.

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com

<think>好的,用户询问如何在Oracle 19c RAC中修改单个SCAN IP地址。我需要先回忆一下SCAN的相关知识。SCAN(Single Client Access Name)是RAC中的一个重要组件,它提供统一的名称供客户端连接,背后通常有多个IP地址对应不同的监听器。修改SCAN IP可能会影响客户端的连接,所以步骤需要谨慎。 首先,我应该检查当前的SCAN配置。使用srvctl工具查看现有配置,比如执行`srvctl config scan`或`scan_listener`,这能确认当前的SCAN名称和IP地址。用户可能只改其中一个IP,但需要确认具体是哪一个。 接下来,修改SCAN IP可能需要DNS或GNS的支持。如果使用DNS,用户需要在DNS服务器上更新对应的记录,将旧的SCAN IP替换为新的。如果是GNS,则需要通过GNS管理界面修改。这一步是关键,因为SCAN依赖名称解析。 然后,停止当前的SCAN监听器。使用`srvctl stop scan_listener`命令停止所有相关的监听服务。确保服务停止后再进行修改,避免配置不一致的问题。 修改配置需要使用srvctl的修改命令,例如`srvctl modify scan -scanname scan_name -i scan_number -n new_scan_ip`,这里的scan_number是指要修改的第几个SCAN IP。需要确认命令参数是否正确,特别是索引号对应的旧IP是否正确。 修改完成后,需要重新启动SCAN监听器,使用`srvctl start scan_listener`。然后再次检查状态,确认新的IP已经生效。可能需要使用`crsctl check cluster`或`srvctl status scan`来验证。 另外,还需要更新客户端的tnsnames.ora文件,确保它们指向新的SCAN IP,否则客户端可能无法连接。这也是用户容易忽略的一步,需要提醒。 注意事项方面,修改SCAN IP应该在维护窗口进行,避免影响生产环境。同时,备份相关配置文件,如OCR和OLR,以防万一出现问题可以恢复。还需要检查集群的健康状态,确保修改后的配置没有导致其他问题。 可能用户的问题中还涉及到是否需要修改所有节点的配置,或者是否会影响正在运行的实例。需要说明RAC的组件如何协调这些变更,以及监听器是如何重新注册服务的。 最后,生成相关的问题,比如如何验证SCAN配置是否正确,或者如何处理修改后的故障排除。这些能帮助用户更全面地理解SCAN的管理。</think>### 分步说明:修改 Oracle 19c RAC 中 SCAN IP 地址的步骤 1. **验证当前 SCAN 配置** 执行以下命令查看现有 SCAN 配置: ```bash srvctl config scan srvctl config scan_listener ``` 输出示例:`SCAN name: scan.example.com, Network: 1, Subnet: 192.168.1.0/255.255.255.0`[^2] 2. **停止 SCAN 监听器** 停止所有 SCAN 监听器服务: ```bash srvctl stop scan_listener ``` 3. **修改 DNS 或 GNS 记录** - **若使用 DNS**:更新 DNS 服务器中 SCAN 名称对应的 IP 地址(例如将 `192.168.1.10` 改为 `192.168.1.20`)。 - **若使用 GNS**:通过 Grid Naming Service (GNS) 管理界面修改。 4. **更新 Oracle 集群配置** 使用 `srvctl` 修改 SCAN IP(假设需修改第 1 个 SCAN IP): ```bash srvctl modify scan -scanname scan.example.com -i 1 -n 192.168.1.20 ``` 5. **重启 SCAN 监听器** ```bash srvctl start scan_listener ``` 6. **验证新配置** ```bash srvctl status scan crsctl check cluster -all ``` 7. **更新客户端连接配置** 修改客户端 `tnsnames.ora` 文件中的 SCAN IP 地址,例如: ``` RAC = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan.example.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = orcl)) ) ``` ### 注意事项 - **维护窗口**:操作需在停机时段进行,避免影响业务连接。 - **备份 OCR**:提前备份 Oracle Cluster Registry(OCR)和 Local Registry(OLR): ```bash ocrconfig -export /backup/ocr_exp.dmp ``` - **监听器注册延迟**:重启后约 1-2 分钟服务会自动注册[^2]。 ### 引用说明 [^1]: Oracle 19c 软件包下载地址需通过官方渠道获取。 : 操作细节参考《Real Application Clusters Administration and Deployment Guide》中 "Modifying SCAN Settings" 章节。 [^3]: 若需通过图形界面操作,可在 Oracle Enterprise Manager 的 "Cluster Database" 页面选择 "SCAN Listeners" 选项卡修改。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值