Always On – Keep Secondary Database Readable When Primary Node Fails

availability-groups

By default, secondary replica brings databases into offline state when connection to the primary replica fails. We are using SQL 2016 SP1.

The goal is to reduce interruption for users on secondary async replica when primary replica goes offline for maintenance or due to network issues.

Is there a way to change this behavior and keep secondary databases always online ?

Best Answer

Is there a way to change this behavior and keep secondary databases always online?

Yes. Use SQL 2014 or later :)

Beginning in SQL Server 2014 (12.x), readable secondary replicas can remain online even when the primary replica is offline due to user action or a failure. However, read-only routing does not work in this situation because the availability group listener is offline as well. Clients must connect directly to the read-only secondary replicas for read-only workloads.

Active Secondaries: Readable Secondary Replicas (Always On Availability Groups)