Wednesday, January 7, 2026

Interview Question 8 : How User Connectivity Works in Oracle RAC ?

Oracle RAC (Real Application Clusters) allows multiple instances to access one single database. User connectivity in RAC is designed for high availability, scalability, and load balancing.


1. RAC Connectivity at a High Level

In a RAC environment:

  • One database
  • Multiple instances
  • Multiple nodes (servers)
  • Users connect to a service, not a specific instance
Client
  ↓
SCAN Listener
  ↓
Local Listener (Node-level)
  ↓
Instance (Node 1 / Node 2 / Node N)
  ↓
Single RAC Database

2. Key Components Involved in RAC Connectivity

1️⃣ SCAN (Single Client Access Name)

  • A cluster-level virtual hostname
  • Resolves to multiple IP addresses
  • Acts as the initial entry point for all clients

Example:

scan.prod.example.com

✅ Clients always connect using SCAN, not node hostnames.


2️⃣ SCAN Listener

  • Runs on multiple cluster nodes
  • Listens on default port 1521
  • Redirects connections to the appropriate node

Purpose:

  • Load balancing
  • HA during node failures

3️⃣ Local Listener

  • Runs on each RAC node
  • Bound to the node’s VIP
  • Accepts redirected connections from SCAN listener

Each instance registers its services with:

  • SCAN listener
  • Local listener (via PMON)

4️⃣ Services (Very Important)

In RAC:

  • Services, not instances, define workload behavior
  • A service can run on:
    • One instance
    • Multiple instances

Examples:

  • oltp_service
  • reporting_service

Services support:

  • Load balancing
  • Failover
  • Workload isolation

3. Step‑by‑Step RAC Connection Flow

Step 1: Client Initiates Connection

sqlplus user/password@scan.prod.example.com:1521/prod_service

Client only knows:

  • SCAN name
  • Port
  • Service name

Step 2: DNS Resolves SCAN Name

SCAN resolves to multiple IPs:

scan → IP1, IP2, IP3

Client randomly picks one.

✅ This provides client‑side load balancing.


Step 3: SCAN Listener Receives Request

SCAN listener:

  • Knows which instances are available
  • Knows which services run where
  • Chooses the best node based on load

Step 4: Connection Redirect to Local Listener

SCAN listener redirects the client to:

  • Specific node
  • Node’s local listener
  • Node VIP

Listener hand‑off completes here.


Step 5: Server Process Is Created

On the chosen node:

  • Dedicated or shared server process is created
  • Session is established in the local instance

✅ From now on:

  • Client talks directly to that instance
  • SCAN listener is no longer involved

4. What Happens During Node or Instance Failure?

Instance Failure

✅ Existing sessions on failed instance:

  • Disconnected
  • Rolled back

✅ New connections:

  • Automatically routed to surviving instances

Service‑Aware Failover (TAF / FAN / ONS)

Oracle supports:

  • TAF (Transparent Application Failover)
  • FAN (Fast Application Notification)

These allow:

  • Faster reconnect
  • Smarter connection pool behavior

5. Dedicated vs Shared Server in RAC

Same concepts apply, but multiplied:

TypeRAC Impact
Dedicated ServerHigher memory, simpler
Shared ServerBetter scalability for thousands of users

6. Why SCAN Is Critical (DBA Perspective)

Without SCAN:

  • Client configs change during node add/remove
  • Poor HA

With SCAN:

  • Client config never changes
  • Nodes can be added or removed dynamically

SCAN = zero‑touch client configuration


7. Comparison: Single Instance vs RAC Connectivity

AspectSingle InstanceRAC
Entry pointListenerSCAN Listener
InstancesOneMultiple
ServicesOptionalMandatory
Load balancingLimitedBuilt‑in
HALowHigh

8. Common RAC Connectivity Errors (DBA View)

ErrorMeaning
ORA‑12514Service not registered
ORA‑12541Listener not reachable
ORA‑12170Timeout
Sessions stuckFAN not configured

9. Interview‑Ready RAC Answer (2–3 Lines)

In Oracle RAC, clients connect using a SCAN address and service name. The SCAN listener routes the connection to the least‑loaded instance via the node’s local listener, where a server process creates a user session against the shared RAC database.


10. One‑Line DBA Golden Rule

🔥 Clients connect to services via SCAN—not to instances or nodes in RAC.

No comments:

Post a Comment

Interview Question 12 : Explain about oracle optimizer ?

  What Is the Oracle Optimizer? Simple Definition (Interview‑Friendly) The Oracle Optimizer is a component of the Oracle Database that deter...