专栏首页小麦苗的DB宝专栏【RAC】如何修改SCAN IP的IP地址、名称、端口等信息

【RAC】如何修改SCAN IP的IP地址、名称、端口等信息

今天小麦苗给大家分享的是如何修改SCAN IP的IP地址、名称、端口等信息。

【RAC】如何修改SCAN IP的IP地址、名称、端口等信息


RAC 增加SCAN IP :http://blog.itpub.net/26736162/viewspace-2155652/

在集群正常运行的情况下,运行以下几个命令:

srvctl config scan srvctl stop scan_listener srvctl stop scan srvctl modify scan -n raclhr-11gR2-scan srvctl config scan srvctl start scan srvctl start scan_listener 如果SCAN IP的个数改变了,那么还需要执行如下命令进行更新: srvctl modify scan_listener -u


How to Update the IP Address of the SCAN VIP Resources (ora.scan{n}.vip) (文档 ID 952903.1)

In this Document

Goal

Solution

References


APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.1 and later Information in this document applies to any platform.

GOAL

The purpose of this document is to explain how to change the IP addresses associated with the SCAN VIPs in a 11gR2 Grid (CRS) environment. The IP addresses associated with the SCAN VIP resources are initially set when the SCAN resources are created. Any changes to the DNS entry for the SCAN are not automatically propagated to the clusterware and need to be done manually. This applies only to installations that are not using GNS. The information in this note can also be helpful in cases where SCAN was originally configured with just one address and is now being expanded to accommodate three IP addresses.

SOLUTION

  1. Before the SCAN VIPs can be changed, the entry for the SCAN name on the Domain Name Server (DNS) needs to be updated with the new IP addresses. This usually will be done by a network administrator. To check the current setting, the following command can be used: nslookup <scan_name>
  2. To check the current IP address(es) of the SCAN VIPs, run the following commands as the root user: $GRID_HOME/bin/srvctl config scan
  3. Stop the SCAN listeners and SCAN $GRID_HOME/bin/srvctl stop scan_listener $GRID_HOME/bin/srvctl stop scan
  4. Next refresh the SCAN VIPs with the new IP addresses from the DNS entry: $GRID_HOME/bin/srvctl modify scan -n <scan_name
  5. To check if the SCAN VIPs have been changed, run the following command, it should now show the new IP addresses. $GRID_HOME/bin/srvctl config scan
  6. Restart SCAN & SCAN listener: $GRID_HOME/bin/srvctl start scan $GRID_HOME/bin/srvctl start scan_listener
  7. If the number of SCAN VIPs has changed, the SCAN listener needs to be updated: $GRID_HOME/bin/srvctl modify scan_listener -u

Below is an example using the following configuration:

  • The name of the SCAN is sales-scan.example.com
  • subnet of the public network is 10.100.10.0
  • netmask for the public network is 255.255.255.0
  • name of the public interface is eth1
  • old IP addresses: 10.100.10.81, 10.100.10.82 & 10.100.10.83
  • new IP addresses: 10.100.10.121, 10.100.10.122 & 10.100.10.123

Stopping & starting the SCAN VIPs/listeners can be done by the grid user, however the 'srvctl modify scan' command must be executed by root user, so it's practical to execute all steps as the root user.

A lookup of the SCAN on the DNS server shows that the entry has already been updated with the new IP addresses:

$ nslookup sales-scan.example.com Server: dns1.example.com Address: 10.100.10.70#53 Name: sales-scan.example.com Address: 10.100.10.123 Name: sales-scan.example.com Address: 10.100.10.122 Name: sales-scan.example.com Address: 10.100.10.121

Stop the SCAN listener and the SCAN VIP resources:

# $GRID_HOME/bin/srvctl stop scan_listener # $GRID_HOME/bin/srvctl stop scan # $GRID_HOME/bin/srvctl status scan SCAN VIP scan1 is enabled SCAN VIP scan1 is not running SCAN VIP scan2 is enabled SCAN VIP scan2 is not running SCAN VIP scan3 is enabled SCAN VIP scan3 is not running # $GRID_HOME/bin/srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is not running SCAN Listener LISTENER_SCAN2 is enabled SCAN listener LISTENER_SCAN2 is not running SCAN Listener LISTENER_SCAN3 is enabled SCAN listener LISTENER_SCAN3 is not running

The SCAN VIP resources still show the old IP addresses:

# $GRID_HOME/bin/srvctl config scan SCAN name: sales-scan, Network: 1/10.100.10.0/255.255.255.0/eth1 SCAN VIP name: scan1, IP: /sales-scan.example.com/10.100.10.81 SCAN VIP name: scan2, IP: /sales-scan.example.com/10.100.10.82 SCAN VIP name: scan3, IP: /sales-scan.example.com/10.100.10.83

Now tell CRS to update the SCAN VIP resources:

# $GRID_HOME/bin/srvctl modify scan -n sales-scan.example.com

To verify that the change was successful, check the SCAN configuration again:

# $GRID_HOME/bin/srvctl config scan SCAN name: sales-scan, Network: 1/10.100.10.0/255.255.255.0/eth1 SCAN VIP name: scan1, IP: /sales-scan.example.com/10.100.10.121 SCAN VIP name: scan2, IP: /sales-scan.example.com/10.100.10.122 SCAN VIP name: scan3, IP: /sales-scan.example.com/10.100.10.123

Start SCAN and the SCAN listener:

# $GRID_HOME/bin/srvctl start scan # $GRID_HOME/bin/srvctl start scan_listener

Please note that if the SCAN VIPs are being changed because of a change of the subnet of the public network additional changes may be required , e.g. the node VIPs and the network resource (ora.net1.network). For more information please refer to Document 276434.1 and the 11.2 documentation.


How to Modify SCAN Setting or SCAN Listener Port after Installation (文档 ID 972500.1)

In this Document

Goal

Solution

A. To update SCAN setting

B. To modify SCAN listener port

References


APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.1 and later Information in this document applies to any platform.

GOAL

This note provides steps to update 11gR2 Grid Infrastructure (CRS) Single Client Access Name (SCAN) setting or SCAN listener port setting if it's not setup properly or if it's changed after setup. Note: 1. This procedure does not apply when GNS is being used 2. Even though clustername and SCAN name is set to the same during 'typical' installation, changing SCAN name will not affect clustername as change of clustername requires deconfigure and reconfigure of the entire cluster.

SOLUTION

A. To update SCAN setting

1. As per documentation "Oracle Grid Infrastructure Installation Guide", Oracle strongly recommend to configure SCAN name in either DNS or GNS as /etc/hosts file can only resolve to one IP address. SCAN IP must be in same subnet as public and VIP. If the new SCAN IP will be in different subnet, refer to note 276434.1 to change nodeapps/network resource first. 1a. If you intend to use /etc/hosts for SCAN name resolution, the same and only entry for SCAN name must exist on all nodes. 1b. If you intend to use DNS for SCAN name resolution, remove entries for SCAN name from /etc/hosts on all nodes, and make sure nslookup returns good result on all nodes, for example:

$ nslookup pay-scan.us.oracle.com .. Name: pay-scan.us.oracle.com Address: 10.4.0.201 Name: pay-scan.us.oracle.com Address: 10.4.0.202 Name: pay-scan.us.oracle.com Address: 10.4.0.203

2. Once #1a or #1b is configured properly, execute the following to modify:

If name resolution for SCAN is being switched from local hosts file to DNS, be sure to remove SCAN name in local hosts file on all nodes prior to execute below commands. 2.1. To modify SCAN name or SCAN VIP addresses: 2.1.1. As grid user stop resources:

$ $GRID_HOME/bin/srvctl stop scan_listener $ $GRID_HOME/bin/srvctl stop scan

2.1.2. As root user modify SCAN:

# $GRID_HOME/bin/srvctl modify scan -n pay-scan.us.oracle.com ### For 11.2.0.1 only, if you intend to change SCAN name, due to bug 9603829, execute the following: # $GRID_HOME/bin/crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=<new SCAN name>" ### Example: # $GRID_HOME/bin/crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=pay-scan.us.oracle.com"

Once SCAN name is changed, update database init.ora/spfile parameter remote_listener to the new one. 2.1.3. As grid user modify and start resources:

$ $GRID_HOME/bin/srvctl modify scan_listener -u $ $GRID_HOME/bin/srvctl start scan_listener

2.1.4. To confirm the change

$ $GRID_HOME/bin/srvctl config scan SCAN name: pay-scan.us.oracle.com, Network: 1/10.4.0.0/255.255.255.0/eth1 SCAN VIP name: scan1, IP: /10.4.0.201/120.0.0.201 SCAN VIP name: scan2, IP: /10.4.0.202/120.0.0.202 SCAN VIP name: scan3, IP: /10.4.0.203/120.0.0.203 $ $GRID_HOME/bin/srvctl config scan_listener SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521 SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521 SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

2.2. To change SCAN to be on second network: By default, SCAN will be configured on first public network (ora.net1.network), however in multiple public network environment, SCAN can run on second or other network. There's no option to modify SCAN to use non-first network, to change to second or other network, scan_listener and scan resources need to be removed and added back. In this example, we'll move SCAN from net1 to net2

$ $GRID_HOME/bin/srvctl config network Network exists: 1/10.1.0.0/255.255.255.128/eth3, type static Network exists: 2/10.1.1.0/255.255.255.128/eth4, type static

2.2.1. As grid user stop resources and remove scan_listener:

$ $GRID_HOME/bin/srvctl stop scan_listener$ $GRID_HOME/bin/srvctl stop scan $ $GRID_HOME/bin/srvctl remove scan_listener -f

2.2.2. As root user remove and add SCAN:

# $GRID_HOME/bin/srvctl remove scan -f #$GRID_HOME/bin/srvctl add scan -n <scan-name> -k 2

Once SCAN name is changed, update database init.ora/spfile parameter remote_listener to the new one. 2.2.3. As grid user add scan_listener and start resources:

$ $GRID_HOME/bin/srvctl add scan_listener-p <port> $ $GRID_HOME/bin/srvctl start scan_listener

B. To modify SCAN listener port

As grid user: 1. Modify SCAN listener port:

$GRID_HOME/bin/srvctl modify scan_listener -p <new-SCAN-port>

Update 11gR2 database init.ora parameter: alter system set remote_listener='<SCAN-name>:<new-port-number>' scope=both; 2. Restart SCAN listener so the new port will be effective:

$GRID_HOME/bin/srvctl stop scan_listener $GRID_HOME/bin/srvctl start scan_listener

3. Confirm the change:

$GRID_HOME/bin/srvctl config scan_listener

REFERENCES

NOTE:975457.1 - How to Troubleshoot Connectivity Issue with 11gR2 SCAN Name NOTE:276434.1 - How to Modify Public Network Information including VIP in Oracle Clusterware NOTE:887471.1 - PRVF-4664 PRVF-4657: Found inconsistent name resolution entries for SCAN name NOTE:887522.1 - Grid Infrastructure Single Client Access Name (SCAN) Explained NOTE:359277.1 - Changing Default Listener Port Number

注意:本文内容太多,公众号有字数限制,全文可点击文末的阅读原文,谢谢大家的理解。

本文分享自微信公众号 - DB宝(xiaomaimiaolhr),作者:小麦苗best

原文出处及转载信息见文内详细说明,如有侵权,请联系 yunjia_community@tencent.com 删除。

原始发表时间:2018-07-11

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • 【DB笔试面试493】Oracle插入或更新CLOB字段报“ORA-01704:字符串文字太长”如何解决?

    在Oracle中,Oracle插入或更新CLOB字段报“ORA-01704:字符串文字太长”如何解决?

    小麦苗DBA宝典
  • 【DB笔试面试727】在Oracle中,如何禁用HAIP?

    说明,ora.cluster_interconnect.haip的ENABLED属性的原始值为1:

    小麦苗DBA宝典
  • 【DB笔试面试502】容灾系统的衡量指标和级别有哪些?

    容灾系统是指在相隔较远的异地,建立两套或多套功能相同的IT系统,互相之间可以进行健康状态监视和功能切换,当一处系统因意外(如火灾、地震等)停止工作时,整个应用系...

    小麦苗DBA宝典
  • 【Java】18 增强流

    缓冲流的基本原理,是在创建流对象时,会创建一个内置的默认大小的缓冲区数组,通过缓冲区读写,减少系统 IO 次数,从而提高读写的效率。

    Demo_Null
  • 自己动手模拟开发一个简单的Web服务器

    开篇:每当我们将开发好的ASP.NET网站部署到IIS服务器中,在浏览器正常浏览页面时,可曾想过Web服务器是怎么工作的,其原理是什么?“纸上得来终觉浅,绝知此...

    Edison Zhou
  • 【温故知新】应用多元统计分析 第三章 正态总体参数的假设检验-重要统计量的分布(多PPT预警)

    统计学家
  • .net core建站踩坑记录

    services.AddOptions(); services.Configure<AppSettings>(Configuration...

    易墨
  • Kafka学习笔记之Kafka High Availability(上)

      Kafka在0.8以前的版本中,并不提供High Availablity机制,一旦一个或多个Broker宕机,则宕机期间其上所有Partition都无法继续...

    Jetpropelledsnake21
  • Cmder git 中文显示乱码解决方案

    Cmder 是 Windows 下替换原有 cmd 的绝佳工具,但是与默认的 cmd 一样,都与 git 命令行存在一些兼容性问题,比如中文乱码问题。在 Cmd...

    我与梦想有个约会
  • Kafka剖析系列之高可用(上)

    Kafka在0.8以前的版本中,并不提供High Availablity机制,一旦一个或多个Broker宕机,则宕机期间其上所有Partition都无法继续提供...

    用户1263954

扫码关注云+社区

领取腾讯云代金券