April 28, 2025

How to Configure SCAN and VIPs in Oracle RAC 19c

 

How to Configure SCAN and VIPs in Oracle RAC 19c


1. What is SCAN and VIP in RAC? (Quick intro)

  • SCAN (Single Client Access Name):
    • A single name that clients use to connect to the database.
    • Behind the scenes, SCAN resolves to three IP addresses (round-robin via DNS or GNS).
    • Advantage: No need to change client connection strings if nodes are added/removed.
  • VIP (Virtual IP):
    • Each RAC node gets a VIP in addition to its public IP.
    • If a node fails, its VIP can quickly failover to another node.
    • Helps in fast TCP/IP failover without long TCP timeout delays.

2. Network Requirements

You'll need three networks:

  • Public Network (for client/database communication)
  • Private Network (for cluster interconnect/heartbeat)
  • Optional: Backup Network (for redundancy)

Important IP planning:

IP Type

Needed

Public IPs

1 per node

VIPs

1 per node

Private IPs

1 per node

SCAN IPs

3 total (shared across the cluster)


3. DNS Setup (for SCAN and VIPs)

Before RAC installation, ensure:

  • SCAN Name points to three IP addresses in DNS.
  • VIP Names are mapped separately in DNS (or /etc/hosts for non-production setups).

Example DNS Entries:

# SCAN entries (round-robin DNS)

testrac-scan.subnet09212030.vcn09212030.oraclevcn.com IN A 10.0.0.98

testrac-scan.subnet09212030.vcn09212030.oraclevcn.com IN A 10.0.0.177

testrac-scan.subnet09212030.vcn09212030.oraclevcn.com IN A 10.0.0.112

# Public IPs

testrac1.subnet09212030.vcn09212030.oraclevcn.com IN  A 10.0.0.127

testrac2.subnet09212030.vcn09212030.oraclevcn.com IN  A  10.0.0.158

# VIPs

testrac1-vip.subnet09212030.vcn09212030.oraclevcn.com  IN  A  10.0.0.36

testrac2-vip.subnet09212030.vcn09212030.oraclevcn.com  IN  A  10.0.0.178

 

 

Note:

  • SCAN should not resolve to a single IP — must have three IPs.
  • VIPs should be in the same subnet as the public IPs.

4. /etc/hosts Example (if not using DNS)

# Public IPs

10.0.0.127 testrac1.subnet09212030.vcn09212030.oraclevcn.com testrac1

10.0.0.158  testrac2.subnet09212030.vcn09212030.oraclevcn.com  testrac2

 

# VIPs

10.0.0.36 testrac1-vip.subnet09212030.vcn09212030.oraclevcn.com testrac1-vip

10.0.0.178  testrac2-vip.subnet09212030.vcn09212030.oraclevcn.com  testrac2-vip

 

# Private Interconnect

192.168.16.18 testrac1-priv.subnet09212030.vcn09212030.oraclevcn.com testrac1-priv

192.168.16.19  testrac2-priv.subnet09212030.vcn09212030.oraclevcn.com  testrac2-priv

 

#Scan IPs

10.0.0.98         testrac-scan.subnet09212030.vcn09212030.oraclevcn.com

10.0.0.177      testrac-scan.subnet09212030.vcn09212030.oraclevcn.com

10.0.0.112      testrac-scan.subnet09212030.vcn09212030.oraclevcn.com

 


5. During Grid Infrastructure Installation

When you install Grid Infrastructure:

  • Installer will prompt for SCAN name.
  • Installer will auto-detect SCAN IPs based on DNS.
  • It will also ask for:
    • Public Interface
    • Private Interface
    • VIP names for each node.

Oracle Clusterware will configure and manage SCAN listeners and VIP listeners automatically after installation.


6. Post-Installation Checks

After installation:

  • Check SCAN listeners:

$srvctl config scan

[oracle@testrac1 ~]$ srvctl config scan

SCAN name: testrac-scan.subnet09212030.vcn09212030.oraclevcn.com, Network: 1

Subnet IPv4: 10.0.0.0/255.255.255.0/enp0s5, static

Subnet IPv6:

SCAN 1 IPv4 VIP: 10.0.0.112

SCAN VIP is enabled.

SCAN 2 IPv4 VIP: 10.0.0.177

SCAN VIP is enabled.

SCAN 3 IPv4 VIP: 10.0.0.98

SCAN VIP is enabled.

 

$srvctl config scan_listener

[oracle@testrac1 ~]$ srvctl config scan_listener

SCAN Listeners for network 1:

Registration invited nodes:

Registration invited subnets:

Endpoints: TCP:1521

SCAN Listener LISTENER_SCAN1 exists

SCAN Listener is enabled.

SCAN Listener LISTENER_SCAN2 exists

SCAN Listener is enabled.

SCAN Listener LISTENER_SCAN3 exists

SCAN Listener is enabled.

 

  • Check VIPs:

[oracle@testrac1 ~]$ srvctl config nodeapps

Network 1 exists

Subnet IPv4: 10.0.0.0/255.255.255.0/enp0s5, static

Subnet IPv6:

Ping Targets:

Network is enabled

Network is individually enabled on nodes:

Network is individually disabled on nodes:

VIP exists: network number 1, hosting node testrac1

VIP Name: testrac1-vip.subnet09212030.vcn09212030.oraclevcn.com

VIP IPv4 Address: 10.0.0.36

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

VIP exists: network number 1, hosting node testrac2

VIP Name: testrac2-vip.subnet09212030.vcn09212030.oraclevcn.com

VIP IPv4 Address: 10.0.0.178

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL true

ONS is enabled

ONS is individually enabled on nodes:

ONS is individually disabled on nodes:

 

You should see VIPs and SCAN listeners running fine.


7. Troubleshooting Tips

  • If SCAN listeners aren’t working, check:
    • DNS settings (or /etc/hosts)
    • Firewall rules blocking SCAN IPs
    • Network interface binding issues
  • If VIP fails to start:
    • Ensure the VIP is in the correct subnet.
    • Check the public network card configuration.

 

No comments:

Post a Comment

Datapatch Fails in Oracle 12c on Windows – Root Cause and Step-by-Step Fix

   Recently, while applying a patch on an Oracle 12c (12.2.0.1) database on Windows, I ran into a frustrating issue: datapatch kept failin...