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:
- This procedure does not apply when GNS is being used
- 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
- 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
..
Name:
Address: 10.x.x.201
Name:
Address: 10.x.x.202
Name:
Address: 10.x.x.203
- 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:
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:
- Modify SCAN listener port:
$GRID_HOME/bin/srvctl modify scan_listener -p
Update 11gR2 database init.ora parameter: alter system set remote_listener='
- Restart SCAN listener so the new port will be effective:
$GRID_HOME/bin/srvctl stop scan_listener
$GRID_HOME/bin/srvctl start scan_listener
- 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
- 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)
- cluvfy report will confirm if the OS level configurations (IP and scan name resolvable) are fine or, not.
cluvfy comp scan
- 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
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
=================================================