SQL 2012 Always on AG Primay went to secondary

I have a Database in sql 2012 in an Always on AG that went from primary to secondary. I am not sure what happened or made it failover to secondary. So my apps were pointing to the primary all had problems updating the database but were still running.
what do I have to change on my app so that they point to the AG listener instead of just the primary server?
this way whenever the primary changes, the app will use the other server as primary

Hi JonDoe,
If an availability group possesses only one secondary replica and it is not configured to allow read-access to the secondary replica, clients can connect to the primary replica by using a database mirroring connection string.
 Optionally, the connection string can also supply the name of another server instance, the
failover partner name, to identify the server instance that initially hosts the secondary replica as the failover partner name.
While migrating from database mirroring to AlwaysOn Availability Groups, applications can specify the database mirroring connection string as long as only one secondary replica exists and it disallows user connections. For more information,
see: http://msdn.microsoft.com/en-us/library/hh213417.aspx#CCBehaviorOnFailover
There is an article about configure SQL Server to automatically redirect the read-only workloads after a failover in AlwayOn Availability Groups, you can review it.
http://www.mssqltips.com/sqlservertip/2869/configure-sql-server-2012-alwayson-availability-groups-readonly-routing-using-tsql/
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support

Similar Messages

  • Backup Sharepoint 2013 Farm with SQL 2012 "Always On" using System Center 2012 R2 Data Protection Manager

    Is backing up and Restoring SharePoint 2013 Farm with SQL 2012  "Always On" High Availability now supported using "System Center 2012 R2 Data Protection Manager"?
    I cannot find confirmation anywhere.
    Regards,
    John

    Per this thread
    http://social.technet.microsoft.com/Forums/en-US/0c047737-4733-4ad5-a24d-3e6e6ff42f70/dpm-2012-sp1-and-sharepoint-2013-on-a-sql-2012-alwayson-ag?forum=dpmsharepointbackup, no it does not look like this is supported.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Sql 2012 always on setup

    I got a sql 2012 always on setup between 2 standalone servers in 2 different locations.
    I do not understand why I need cluster manager managing the 2 nodes.
    I have cluster manager but there is no shared disks. there are 2 nodes under cluster manager and one cluster name.
    what would be the different between the cluster name here and the availability group listener name in sql 2012? they are both different names

    Read those articles
    https://www.microsoftvirtualacademy.com/tracks/mission-critical-confidence-using-microsoft-sql-server-2012
    http://www.sqlservercentral.com/articles/FCI/92196/
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Does Lync 2013 work with SQL 2012 always on Feature?

    Howdy,
    I'm not that even "ok" when it come to SQL :)
    so my question Does Lync 2013 Enterprise work with SQL 2012 "Always on" Feature or only Mirroring?
    Regards,
    T

     It will not be supported. Mirroring is your only option.
    If a post is helpful, please take a second to hit the green arrow on the left, or mark as answer, thanks.
    Jean-Philippe Breton | Senior Microsoft Consultant | MCTS, MCITP, MCT, Lync MVP

  • SQL 2012 Always On Availability Groups

    Has anyone configured FIM SYnc, FIM Service and MSF in SQL 2012 Always On Availability groups
    I do not believe we can configure the SQL connection string for FIM Sync or FIM Service to include "multisubnetfailover"
    TIA
    Nigel

    I commented on this here:https://social.technet.microsoft.com/Forums/en-US/64f55628-3b5d-4d16-9044-dcbe7053581d/lack-of-support-for-fim-database-mirroring?forum=ilm2
    Additional comments:
    SQL Server Always On Failover Cluster Instances should be supported just as SQL Clustering is supported.
    SQL Server Always On Availability Groups are not supported, just as Database Mirroring in synchronous mode (which is required for automatic failover) is not supported. I can't find authoritative statements of this on the web. But I know this to be the
    case.
    Ultimately, the reason for lack of support for mirroring (for automatic failover or in synchronous mode) is that the product group has said so (in conferences and webinars). Meaning the product group has not tested it or has and decided that it doesn't
    work or adds risk.
    Possible underlying reasons:
    1) To do automatic failover with mirroring or Availability groups you must edit the connection string. The way FIM builds the connection string out of the components in the registry don't permit this.
    2) Running mirroring in synchronous mode slows down performance in two ways: first is the additional traffic to send it to the mirror partner (or replica), second and most important is that synchronous requires that the primary not truly commit the transaction
    until it has been committed to the secondary which means transactions take longer. For some products this can result in an unacceptable performance degradation.
    Hopefully, MIM will support Availability groups.
    David Lundell, Get your copy of FIM Best Practices Volume 1 http://blog.ilmbestpractices.com/2010/08/book-is-here-fim-best-practices-volume.html

  • Changing from full recovery model to simple in sql 2012 always on

    how do I change from a full recovery model to simple in an always on sql 2012 setup? When I try to change it it gave this error

    The physical size of the log file will not change unless you manually shrink the file.  A backup marks the log space as "reusable" internally.
    Please see:
    http://msdn.microsoft.com/en-us/library/ms365418.aspx

  • Clustering Pre-reqs for sql 2012 always on availability group

    Hello,
    I'm currently in the planning stages of building a sql 2012 alwaysON cluster on Windows server 2012. I'm a bit confused with some of the requirements.
    Does  windows 2012 clustering require a heartbeat network as well a nic that communicates with the domain?
    For a 2 node 2012 always on sql cluster which type of cluster should I use? node majority? node majority plus fileshare?
    thanks!

    I found this information regarding SQL 2014. This could be helpful
    "We strongly recommend that you use the same network links for communications between WSFC cluster members and communications
    between availability replicas. Using separate network links can cause unexpected behaviors if some of links fail (even intermittently).
    For example, for an availability group to support automatic failover, the secondary replica that is the automatic-failover partner must be in the SYNCHRONIZED state. If the network link to this secondary replica fails (even intermittently), the replica enters
    the UNSYNCHRONIZED state and cannot begin to resynchronize until the link is restored. If the WSFC cluster requests an automatic failover while the secondary replica is unsynchronized, automatic failover will not occur."
    source:http://msdn.microsoft.com/en-us/library/ff878487.aspx#NetworkConnect

  • Sql 2012 always on availability group use cases

    i have setup the always on availability group between 2 sql servers. 
    in the primary site, my app is connected to the primary site. 
    The DB is in an always on group replicated to the secondary site. 
    so what is the use of the secondary replica for? 
    If the primary db server goes down, what will happen?
    Can apps use the replica db? but its read only
    what is the purpose of this?

    I agree with David.
    JonDoe,
    What you are asking is known as "active secondary" in AlwaysOn 
    http://msdn.microsoft.com/en-us/library/ff878253.aspx
    Automatic failover can be configured. Refer
    http://msdn.microsoft.com/en-us/library/hh213151.aspx 
    Be aware of http://support.microsoft.com/kb/2833707
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Which Edition of Windows is required for using SQL 2012 Always On Availability Groups

    I want to use the new feature of having 2 secondary mirror replicas. the first secondary replica will be sync the second one will be async.
    Currently I have SQL Enterprise license and Windows 2008 R2 Standard license.
    Will I be required to upgrade to Windows Enterprise license to use Always On? (since this feature depends on Windows clustering?)
    Can you please confirm if SQL Always On feature can be used on Windows 2008 R2 standard or not?
    MSDNStudent Knows not much!

    Always On is available with Standard Edition but it supports only 2 nodes. 
    AlwaysOn is a bigger umbrella which covers two features. AlwaysOn Availability Groups (AG) and AlwaysOn Failover Cluster Instance (FCI).
    FCI for 2 node is supported. You can't use AG feature in SQL Server Standard Edition
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • SQL 2012 Always on with WFC

    Hi Expert,
    I have following infrastructure at par. where i have 3 server in WFC(Windows Failover cluster) Win2012 and out of 3 servers two servers are active/passive cluster with SQL Instance hosted on it and i have created AG group for 3 users database and setup Sync
    Replica on 3rd server within my WFC cluster.
    I have SQL VIP(Virtual Server Name) for cluster and also i have AG Listener resources also on the cluster. Now this cluster is attached to SAN single.
    3rd server where we kept sync replica its storage is not coming from SAN it has local storage attached to it.
    Now we know we have single point failure if SAN goes down My SQL Server 2node active passive cluster instance will also come down.
    Now in this kind of event will my AG Listener can be online on WFC even if SAN is down so that it can redirect connection to the 3rd server where it has sync replica copy.
    Also if in case Listener will not be able to be online in event of SAN failure what would alternative path we consider here
    your valuable suggestion and time are most welcome.
    Thank you very much..
    Regards, Nirav Joshi

    This will depend on your quorum configuration. If you started building your SQL Server failover clustered instance before adding your 3rd node, you may have a node a disk majority quorum. When the SAN fails, you take down the disk witness and the SQL Server
    instance but since you still have 2 additional voting nodes, you still have a quorum so the Availability Group stays online. Unfortunately, because you have a combination of SQL Server Failover clustered instance and stand alone instance for your Availability
    Group, you lose the ability to have automatic failover. So, even if there is a majority of votes in your cluster, you still have to manually failover the Availability Group and the listener name on the standalone instance running on the 3rd node.
    Edwin Sarmiento SQL Server MVP | Microsoft Certified Master
    Blog |
    Twitter | LinkedIn
    SQL Server High Availability and Disaster Recover Deep Dive Course

  • SQL 2012 Always On Availability Create Key for Dynamics CRM syntax

    Hi I am trying to follow this terribly written article to setup CRM to be part of a SQL alwayson availability group.  
    The part that is pissing me off is the create SQL logins.  http://technet.microsoft.com/en-us/library/jj822357.aspx#BKMK_always_updateorg
    So many errors with this post causing so much frustration.  What is the actual correct Syntax for creating the key?
    Obviously you have to use a UNC path to the CRM front end server.  SQL doesnt like UNC and I think an earlier guy said it doesnt like double quotes.  Here is what I have and it does not like it.  Its hard to see but right before end I have two
    single quotes to close it.  It's complaining about the \\ in the UNC path.  
    IF NOT EXISTS (SELECT * FROM sys.asymmetric_keys WHERE name = 'MSCRMSqlClrKey') BEGIN EXECUTE ('CREATE ASYMMETRIC KEY MSCRMSqlClrKey FROM EXECUTABLE FILE ='\\CRM2013\C$\Program Files\Microsoft Dynamics CRM\tools\Microsoft.Crm.SqlClr.Helper.dll'')END

    I finally got it working not by using the syntax in that article though.  First I did the select all from to see if the key existed by itself  
    SELECT * FROM sys.asymmetric_keys WHERE name = 'MSCRMSqlClrKey'
    NO key was there so then I did 
    CREATE ASYMMETRIC KEY MSCRMSqlClrKey FROM EXECUTABLE FILE ='C:\Program Files\Microsoft Dynamics CRM\tools\Microsoft.Crm.SqlClr.Helper.dll'

  • SQL 2012 Synchronous and Asynchronous database limit?

    Hi,
    How many DB's can be configured as Synchronous commit and Asynchronous commit in SQL 2012 Always On Availability group in a DR scenario for SP 2013?
    Thanks 
    Mohammed Asif Kazi

    Maximum number of availability groups and availability databases per computer: The actual number of databases and availability groups you can put on a computer (VM or physical) depends on the hardware and workload, but there
    is no enforced limit. Microsoft has extensively tested with 10 AGs and 100 DBs per physical machine. Signs of overloaded systems can include, but are not limited to, worker thread exhaustion, slow response times for AlwaysOn system views and DMVs, and/or stalled
    dispatcher system dumps. Please make sure to thoroughly test your environment with a production-like workload to ensure it can handle peak workload capacity within your application SLAs. When considering SLAs be sure to consider load under failure conditions
    as well as expected response times.
    http://msdn.microsoft.com/en-us/library/ff878487.aspx#RestrictionsAG
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • How do I remove a node from Always on Availability Group in SQL 2012

    Hello I was wondering if anyone could tell me to remove a node from an AOG group in SQL 2012.  We currently have a two node Always on availability group and I need to replace one of the servers.  My plan is to bring the
    new server on to the group then remove the old server and I am having issues finding documentation on this.  Could someone explain how to do this or if it is even possible.
    Thanks

    After the new server is added to the cluster and the AG, remove the old one by first
    ALTER AVAILABILITY GROUP [YourAG]
    REMOVE REPLICA ON N'OldServer';
    Remove a Secondary Replica from an Availability Group
    Then evict the old server from the cluster with the cluster administrator or
    Remove-ClusterNode OldServer
    Remember to verify the quorum configuration after adding the new server and removing the old server.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Convert SQL 2012 standalone to Always on

    Hi,
    I have a production SQL 2012 server with one database. Is it possible to convert that to two node always on cluster? What will happen to the existing database residing in that server? Please advise.
    Thanks.

    Cool. So when I install the second node and install windows clustering on both nodes, will there be any downtime on the existing database instance or do i need to make any changes to the existing database instance?  Also can you forward any links on
    the configuration on Always On Availability Group?
    Hi DNair,
    You can configure a SQL Server 2012 AlwaysOn Availability Group by performing the steps in below blog.
    Step-By-Step: Creating a SQL Server 2012 AlwaysOn Availability Group
    And please note that there is downtime on the existing SQL Server instance after enabling the AlwaysOn Availability Groups option in SQL Server Configuration Manager, because we need to restart the SQL Server instance to make the change take effect.
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.
    Lydia Zhang
    TechNet Community Support

  • Not able to connect to Replicas in Always on in SQl 2012

    Hi, I am working on High availibility(always)in Sql 2012 and tried to connect to replicas through HAG wizaed but
    not able get coonection when I try to through BRowse for Server dialog box in SSMS.
    What should I do???
    srm_2010

    Did you enable AlwaysON Availability Groups on the other Servers? 
    more info: How to Set Up SQL Server 2012 AlwaysOn Availability Groups
    T-SQL Articles
    T-SQL e-book by TechNet Wiki Community
    T-SQL blog

Maybe you are looking for