[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

SQL Server 2012 Availability Group Failover

I have an SQL Server 2012 Availability Group set up across two data centers.  The Availability Group has five databases in it.  I have a process that begins to load data into one of the databases on the primary replica.  When I failover the availability group and make the secondary replica primary, the process reports that the database is read only.  In addition, if I begin a new process attempting to load data to the new primary replica (I haven't failed the AG back yet) I get the same error, database is read only.  I can't figure out how to make my secondary databases writable in case of an automatic failover.  I believe I have all the pre-requisits taken care of.  I've tried to alter the read intent of the secondary databases using the the availability group wizard but I still get the same result.  Any help is appreciated.
0
navajo26354
Asked:
navajo26354
1 Solution
 
Ryan McCauleyCommented:
Are you connecting to the databases using the clustered AG name, or via their native instance names? If you connect to the AG name, it should route your update queries to the writable instance (the primary one) automatically.

The only other caveat might be if your connection string specifies read intent rather than write - can you confirm that your connection string doesn't specify intent? For more detail, you can check here:

http://blogs.msdn.com/b/alwaysonpro/archive/2013/08/02/connect-to-sql-server-using-application-intent-read-only.aspx
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now