zoukankan      html  css  js  c++  java
  • How to Modify SCAN Setting or SCAN Listener Port after Installation (Doc ID 972500.1)

    How to Modify SCAN Setting or SCAN Listener Port after Installation (Doc 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
    Oracle Database Exadata Cloud Machine - Version N/A and later
    Oracle Cloud Infrastructure - Database Service - Version N/A and later
    Oracle Database Exadata Express Cloud Service - Version N/A and later
    Oracle Database Cloud Exadata Service - Version N/A 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 .oracle.com
    ..
    Name: .oracle.com
    Address: 10.x.x.201
    Name: .oracle.com
    Address: 10.x.x.202
    Name: .oracle.com
    Address: 10.x.x.203

    1. 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 .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="

    Example:

    $GRID_HOME/bin/crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=.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: .oracle.com, Network: 1/10.x.x.0/255.255.255.0/eth1
    SCAN VIP name: scan1, IP: /10.x.x.201/120.x.x.201
    SCAN VIP name: scan2, IP: /10.x.x.202/120.x.x.202
    SCAN VIP name: scan3, IP: /10.x.x.203/120.x.x.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.x.x.0/255.255.255.128/eth3, type static
    Network exists: 2/10.x.x.0/255.255.255.128/eth4, type static
    You can also modify the scan in the second network like below on 12.2

    srvctl modify scan_listener -netnum 2 -update -invitednodes "node1,node2"

    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 -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
    $ $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
    Update 11gR2 database init.ora parameter: alter system set remote_listener=':' scope=both;

    1. Restart SCAN listener so the new port will be effective:

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

    1. Confirm the change:

    $GRID_HOME/bin/srvctl config scan_listener

    REFERENCES
    NOTE:359277.1 - Changing Default Listener Port Number

    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

    =========================================================

    oracle rac 添加SCAN IP

    因现场应用需要,需要对新配置的oracle RAC环境增配2个scanIP地址,10.138.129.106以及10.138.129.107。

       配置前情况:
    
      [grid@db1 ~]$ srvctl config scan                    ----查看scan的配置信息
      SCAN name: scan-ip, Network: 1/10.138.129.0/255.255.255.0/eth2
      SCAN VIP name: scan1, IP: /scan-ip/10.138.129.105
    
      [grid@db1 ~]$ srvctl status scan                    ----查看scan的状态以及scan ip所处节点
      SCAN VIP scan1 is enabled
      SCAN VIP scan1 is running on node db1
    
      [grid@db1 ~]$ srvctl config scan_listener    ----查看scan listener
      SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
    
      默认情况下配置RAC 只有1个scan IP,1个 scan listener。
    
      进入主题,开始增配scan ip
    
      1、修改rac所有节点的/etc/hosts信息
    

    [grid@db1 ~]$ cat /etc/hosts
    127.0.0.1 localhost

    10.138.129.101 db1
    10.138.129.102 db2

    10.138.129.103 db1-vip
    10.138.129.104 db2-vip

    10.138.129.105 scan-ip
    10.138.129.106 scan-ip ---------新增的scanIP
    10.138.129.107 scan-ip ---------新增的scanIP

    192.168.20.1 db1-priv
    192.168.20.2 db2-priv

       2、停止scan 监听,注意先停监听才能停scan
    

    [grid@db1 ~]$ srvctl stop scan_listener

    [grid@db1 ~]$ srvctl stop scan

    [grid@db1 ~]$srvctl status scan_listener
    SCAN Listener LISTENER_SCAN1 is enabled
    SCAN listener LISTENER_SCAN1 is not running

      3、配置scan,注意需要用root权限执行
    

    [root@db1 bin]# pwd
    /u01/app/11.2.0/grid/bin
    [root@db1 bin]# ./srvctl modify scan -n scan-ip -----修改scan信息,-n 后面接 hosts中的san ip 网络名

    [root@db1 bin]# ./srvctl modify scan_listener -u ------添加scanIP的监听,若不执行该命令,将只有一个listener_scan1监听,执行后将根据scan ip数自动增加listener_scan2,listener_scan3.

     4、启动scan
    

    [grid@db1 ~]$ srvctl start scan
    [grid@db1 ~]$ srvctl start scan_listener

    [grid@db1 ~]$ srvctl status scan
    SCAN VIP scan1 is enabled
    SCAN VIP scan1 is running on node db1
    SCAN VIP scan2 is enabled
    SCAN VIP scan2 is running on node db2
    SCAN VIP scan3 is enabled
    SCAN VIP scan3 is running on node db1

    [grid@db1 ~]$ srvctl config scan
    SCAN name: scan-ip, Network: 1/10.138.129.0/255.255.255.0/eth2
    SCAN VIP name: scan1, IP: /scan-ip/10.138.129.105
    SCAN VIP name: scan2, IP: /scan-ip/10.138.129.106
    SCAN VIP name: scan3, IP: /scan-ip/10.138.129.107

    [grid@db1 ~]$ srvctl status scan_listener
    SCAN Listener LISTENER_SCAN1 is enabled
    SCAN listener LISTENER_SCAN1 is running on node db1
    SCAN Listener LISTENER_SCAN2 is enabled
    SCAN listener LISTENER_SCAN2 is running on node db2
    SCAN Listener LISTENER_SCAN3 is enabled
    SCAN listener LISTENER_SCAN3 is running on node db1

    =======================================================================

    RAC在线修改或增加增加SCAN_IP

    SCAN_IP是Oracle11g R2引入的单一客户端访问名称,通通过集群数据库配置简化客户端网络连接文件的管理。
    前段时间因为修改了其中一个节点的IP,把这个IP作为scan_ip,具体的操作写下来记一下。

    修改及增加scan_ip无需重启数据库及crs

    主要是增加一个scan_ip。
    1、修改hosts
    原hosts(只有一个scan_ip)

    192.168.1.10 rac-cluster-scan

    修改后hosts(增加一个scan_ip)

    192.168.1.10 rac-cluster-scan
    192.168.1.20 rac-cluster-scan

    全部节点都要修改

    2、停止scan_listener及scan应用
    为方便均使用root用户,记得$GRID_HOME/bin加入到root用户的PATH里面
    srvctl stop scan_listener
    srvctl stop scan

    3、删除原有的scan_listener及scan
    srvctl remove scan_listener
    srvctl remove scan

    4、添加新的scan及scan_listener
    srvctl add scan
    srvctl add scan_listener

    5、启动scan及scan_listener
    srvctl start scan
    srvctl start scan_listener

    6、检查scan及scan_listener
    srvctl config scan
    SCAN name: rac-cluster-scan, Network: 1/192.168.1.0/255.255.255.0/eth0
    SCAN VIP name: scan1, IP: /rac-cluster-scan/192.168.1.10
    SCAN VIP name: scan2, IP: /rac-cluster-scan/192.168.1.20

    7、crsctl stat res -t查看LISTENER

    8、如果把scan_ip对应的hostname也进行了改动,则需要进数据库重新声明参数remote_listener
    REMOTE_LISTENER : 类似LOCAL_LISTENER参数,实例通过ROMOTE_LISTENER参数指明的hostname,动态向SCAN监听器注册

    =================================================
    Add scan listener steps (Doc ID 2491246.1)

    Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
    

    SOLUTION

    1. Please understand the below Action Plan will only work if your scan OS level configurations are fine.

    Refer RAC and Oracle Clusterware Best Practices and Starter Kit (Platform Independent) (Doc ID 810394.1)

    1. cluvfy report will confirm if the OS level configurations (IP and scan name resolvable) are fine or, not.

    cluvfy comp scan

    1. If you have DNS. Please follow these steps

    Step 1: Remove scan ip entry from /etc/hosts

    Step 2: Follow below steps to remove/add scan ip and listeners

    As grid user

    srvctl stop scan -f
    srvctl stop scan_listener -f
    crsctl stat res -t

    As root user

    srvctl remove scan -f -y
    srvctl add scan -scanname -scan
    srvctl remove scan_listener -f -y
    srvctl add scan_listener -l LISTENER_NAME

    As grid user

    srvctl start scan
    srvctl start scan_listener
    crsctl stat res -t

    =================================================

  • 相关阅读:
    Nginx 缓存解决方案
    Chrome去水印、自由复制的解决方法
    简单介绍正向代理和反向代理
    Lambda表达式
    项目集成hystrix-dashboard
    hystrix 添加turbine
    GsonUtil 工具类
    idea 去除import * 变成具体引入文件
    eureka 创建服务消费者
    eureka 创建注册服务提供方
  • 原文地址:https://www.cnblogs.com/lipeng20004/p/13875517.html
Copyright © 2011-2022 走看看