What is SCAN listener?
In an Oracle Real Application Clusters (RAC) environment, connecting to the database used to be a headache. You had to list every single server's IP address in your tnsnames.ora file. If you added a new server to the cluster, you had to update every single client machine in the company.
SCAN (Single Client Access Name) was introduced in Oracle 11g Release 2 to solve this forever. It provides a single, stable name for clients to connect to, no matter how many nodes are in the cluster.
SCAN is a feature that provides a single network name (e.g., sales-cluster-scan.example.com) for accessing an Oracle Database running in a cluster.
Instead of connecting to a specific server, the client connects to the SCAN Listener. Think of it as a Load Balancer that sits at the front door of your cluster, directing traffic to the best available room.
To understand SCAN, you have to look at how it interacts with the rest of the cluster:
The SCAN Name: A single DNS entry that resolves to three IP addresses (usually) using a round-robin algorithm.
The SCAN Listeners: Three processes running on different nodes in the cluster. They listen for incoming requests on the SCAN IPs.
The Local Listeners: Every node still has its own "Local Listener" (usually named LISTENER).
Step 1: The client asks for sales-cluster-scan. DNS gives back one of the three SCAN IPs.
Step 2: The client hits a SCAN Listener.
Step 3: The SCAN Listener looks at the cluster and says, "Node 3 is the least busy right now." It tells the client to go to Node 3's Local Listener.
Step 4: The client connects to the Local Listener on Node 3 and starts its session.
You can add nodes to the cluster or take them away for maintenance, and you never have to change the client connection string. The SCAN name stays the same, even if the underlying servers change.
The SCAN listener knows the load of every instance in the cluster. It won't send a new user to a node that is currently at 99% CPU usage. It directs traffic to the "quietest" node.
If one of the three SCAN listeners fails, the other two take over its IP address. If a whole node fails, the SCAN IPs move to a surviving node. The "Front Door" is always open.
Because of SCAN, your tnsnames.ora becomes incredibly simple:
SALES_DB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sales-scan.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = sales_prod)
)
)
Notice there is only one HOST. You don't need to list node1-vip, node2-vip, etc.
| Feature | SCAN Listener | Local Listener |
| Quantity | Usually 3 per cluster. | 1 per node. |
| Role | Traffic Director / Load Balancer. | Hands off the connection to the instance. |
| IP Address | Virtual (can move between nodes). | Virtual (VIP) but stays on its home node. |
| Client Interaction | The "First Contact." | The "Final Handshake." |
If you can't connect via SCAN, the first thing to check is DNS. SCAN requires "Round Robin" DNS. You can test this by running nslookup on your SCAN name:
nslookup sales-scan.example.com
If it doesn't return three distinct IP addresses, your network team hasn't set up the DNS entries correctly, and your load balancing will be lopsided.
SCAN is the "glue" that makes a multi-node RAC cluster feel like a single, easy-to-use database for the application developers. It removes the complexity of the grid and replaces it with a single, reliable URL.