Preparation
1. Looking up SCAN name on DNS before adding a SCAN VIP
[root@primary01 ~]# nslookup primary-cluster-scan
Server: 10.0.0.199
Address: 10.0.0.199#53
Name: primary-cluster-scan.example.com
Address: 10.0.0.82
Name: primary-cluster-scan.example.com
Address: 10.0.0.81
Name: primary-cluster-scan.example.com
Address: 10.0.0.83
There're 3 SCAN VIPs for this name.
2. Adding a SCAN VIP to DNS
[root@dns ~]# cd /var/named/
[root@dns named]# vi example.com.zone
[root@dns named]# vi 0.10.zone
[root@dns named]# systemctl restart named
3. Making sure the new IP was added on DNS
[root@primary01 ~]# nslookup primary-cluster-scan
Server: 10.0.0.199
Address: 10.0.0.199#53
Name: primary-cluster-scan.example.com
Address: 10.0.0.84
Name: primary-cluster-scan.example.com
Address: 10.0.0.82
Name: primary-cluster-scan.example.com
Address: 10.0.0.83
Name: primary-cluster-scan.example.com
Address: 10.0.0.81
4. Checking configuration before updating SCAN configuration on Grid
You must be root to do all of the following settings.
[root@primary01 ~]# . /home/grid/.bash_profile
[root@primary01 ~]# srvctl config scan
SCAN name: primary-cluster-scan, Network: 1
Subnet IPv4: 10.0.0.0/255.255.255.0/eth0, static
Subnet IPv6:
SCAN 0 IPv4 VIP: 10.0.0.83
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
SCAN 1 IPv4 VIP: 10.0.0.82
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
SCAN 2 IPv4 VIP: 10.0.0.81
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
5. Checking status before updating SCAN configuration on Grid
[root@primary01 ~]# srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node primary02
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node primary01
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node primary01
[root@primary01 ~]# srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node primary02
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node primary01
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node primary01
Add a SCAN VIP to Cluster
1. Updating scan and scan_listener, it may take a while to complete
[root@primary01 ~]# srvctl modify scan -n primary-cluster-scan
[root@primary01 ~]# srvctl modify scan_listener -u
2. Checking configuration after updating SCAN configuration on Grid
[root@primary01 ~]# srvctl config scan
SCAN name: primary-cluster-scan, Network: 1
Subnet IPv4: 10.0.0.0/255.255.255.0/eth0, static
Subnet IPv6:
SCAN 0 IPv4 VIP: 10.0.0.82
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
SCAN 1 IPv4 VIP: 10.0.0.83
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
SCAN 2 IPv4 VIP: 10.0.0.84
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
SCAN 3 IPv4 VIP: 10.0.0.81
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
3. Checking status after updating SCAN configuration on Grid
[root@primary01 ~]# srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node primary02
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node primary01
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node primary01
SCAN VIP scan4 is enabled
SCAN VIP scan4 is not running
[root@primary01 ~]# srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node primary02
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node primary01
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node primary01
SCAN Listener LISTENER_SCAN4 is enabled
SCAN listener LISTENER_SCAN4 is not running
Please notice that, both SCAN4 and LISTENER_SCAN4 are enabled, but not running.
4. Starting SCAN4
[root@primary01 ~]# srvctl start scan -i 4
[root@primary01 ~]# srvctl status scan -i 4
SCAN VIP scan4 is enabled
SCAN VIP scan4 is running on node primary02
As we can see, the new SCAN VIP is distributed to node 2, so we can expect the scan listener is also on node 2.
5. Starting LISTENER_SCAN4
[root@primary01 ~]# srvctl start scan_listener -i 4
[root@primary01 ~]# srvctl status scan_listener -i 4
SCAN Listener LISTENER_SCAN4 is enabled
SCAN listener LISTENER_SCAN4 is running on node primary02
Let's see the processes on both nodes:
[root@primary01 ~]# ps -ef | grep lsnr
grid 5966 1 0 19:36 ? 00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr MGMTLSNR -no_crs_notify -inherit
grid 6053 1 0 19:36 ? 00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
grid 6095 1 0 19:36 ? 00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr LISTENER_SCAN2 -no_crs_notify -inherit
grid 6107 1 0 19:36 ? 00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
root 16894 5396 0 19:45 pts/0 00:00:00 grep lsnr
[root@primary02 ~]# ps -ef | grep lsnr
grid 6234 1 0 19:37 ? 00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
grid 6499 1 0 19:37 ? 00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid 17396 1 0 19:52 ? 00:00:00 /u01/app/12.1.0/grid/bin/tnslsnr LISTENER_SCAN4 -no_crs_notify -inherit
root 18600 15454 0 19:57 pts/0 00:00:00 grep lsnr
One last question that you might be interested.Do we need to modify $ORACLE_HOME/network/admin/listener.ora and add an entry for SCAN4 by ourselves?
No, you don't have to, because the grid agent will add the SCAN4 into this file automatically after the above configuration is complete.
By the way, we can have srvctl add scan and srvctl add vip commands, but there's no srvctl add scan vip command in Oracle.