Skip to content
Home » Oracle Database » Grid Infrastructure » How to Check SCAN IP Address

How to Check SCAN IP Address

SCAN IP Address

In a complex environment, you may have some ways to fast check the actual SCAN IP used in the RAC server.

nslookup

At network-level, we can do a name server lookup (nslookup) by providing the specific SCAN name (hostname).

[grid@primary01 ~]$ nslookup primary-cluster-scan 10.0.0.199
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

The third field in the command is the DNS server used in your environment.

/etc/hosts

If the above nslookup returned no result, SCAN VIP could be setup without DNS. Without DNS, the cluster can only depend on /etc/hosts to do name resolution.

[grid@primary01 ~]$ grep "primary-cluster-scan" /etc/hosts
10.0.0.81    primary-cluster-scan
10.0.0.82    primary-cluster-scan
10.0.0.83    primary-cluster-scan

Only the first IP address will be returned if your connection uses SCAN hostname instead of SCAN IP.

Although providing more redundant SCAN IP is better and recommended, setting up only one SCAN IP can also work well for a RAC database.

srvctl config scan

If you don't know the SCAN hostname, you can still learn the SCAN IP by issuing command srvctl config scan.

[grid@primary01 ~]$ srvctl config scan
SCAN name: primary-cluster-scan, Network: 1
Subnet IPv4: 10.0.0.0/255.255.255.0/en0, static
Subnet IPv6:
SCAN 1 IPv4 VIP: 10.0.0.81
SCAN VIP is enabled.
SCAN 2 IPv4 VIP: 10.0.0.82
SCAN VIP is enabled.
SCAN 3 IPv4 VIP: 10.0.0.83
SCAN VIP is enabled.

srvctl status scan

To check the distribution of those SCAN IP, we use srvctl status scan.

[grid@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

If there's any necessary, you may relocate SCAN IP to another node.

Leave a Reply

Your email address will not be published. Required fields are marked *