Most Oracle DBAs and developers copy-paste the same “recommended” TNS connection string for RAC and Data Guard without fully understanding how each parameter affects real-world behavior. That changes today.
This guide breaks down the critical parameters in a typical HA connect descriptor, shows measurable timing impacts, and gives clear guidance on when to tune what — so your applications stay resilient during switchovers, failovers, and maintenance.
The Standard HA Connect String
Here’s the common pattern you’ll see in MAA documentation:
(DESCRIPTION =
(CONNECT_TIMEOUT=90)(RETRY_COUNT=100)(RETRY_DELAY=3)
(TRANSPORT_CONNECT_TIMEOUT=1000ms)
(ADDRESS_LIST = (LOAD_BALANCE=on) (ADDRESS = ...))
(ADDRESS_LIST = (LOAD_BALANCE=on) (ADDRESS = ...))
(CONNECT_DATA = (SERVICE_NAME = my_service))
)
Let’s explore what each setting actually does and how changing it impacts connection behavior.
1. FAILOVER = ON (Default)
Controls whether the client tries alternate addresses when one fails. Keep this ON unless you have a very specific reason to disable it. Turning it OFF makes connections order-dependent and can prevent reaching an available site during role transitions.
2. LOAD_BALANCE = ON
Randomizes the starting address in an ADDRESS_LIST. This prevents one SCAN IP from being hammered and helps spread load. Strongly recommended when you have multiple addresses, especially during partial outages or maintenance.
3. RETRY_COUNT & RETRY_DELAY
RETRY_COUNT defines how many additional rounds the client makes through the address list. RETRY_DELAY adds a pause between rounds so the service has time to become available after a switchover or failover.
Tip: Use RETRY_DELAY=3 (seconds) as a good starting point. Tight loops (RETRY_DELAY=0) create unnecessary load and should be avoided in production.
4. TRANSPORT_CONNECT_TIMEOUT
This is crucial when an IP or port is unreachable. It caps how long the client waits for a TCP connect before moving to the next address. Set it low enough to fail fast during outages, but high enough to handle normal network jitter (1000ms is a common balanced value).
5. CONNECT_TIMEOUT
Limits the total time for a single connection attempt, including server process creation. Set this higher than TRANSPORT_CONNECT_TIMEOUT (commonly 60–90 seconds) to allow normal connects under load while protecting against hanging attempts.
Practical Recommendations
- For frequent role changes (Fast-Start Failover): Use LOAD_BALANCE=on and moderate RETRY_COUNT
- For stable primary with rare switchovers: Prefer LOAD_BALANCE=off with clear site ordering
- Always set TRANSPORT_CONNECT_TIMEOUT explicitly — don’t rely on defaults
- Align your application connection pool timeouts with the worst-case client wait time
- Use the latest Oracle client (26ai recommended) for millisecond precision support
Final Advice
Don’t treat the HA connection string as magic copy-paste code. Understand what each parameter controls and tune it to your environment’s failover patterns and network characteristics. Small changes here can dramatically improve application resilience during planned maintenance and unplanned outages.
Test your connection strings under simulated failure scenarios (service down, network blocked) and measure real connect times. The better you understand your client behavior, the more predictable and reliable your high-availability applications will be.