<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AOAG - Techyaz.com</title>
	<atom:link href="https://techyaz.com/tag/aoag/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Tips, Tutorials and How-to Topics</description>
	<lastBuildDate>Thu, 22 Jul 2021 12:43:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://techyaz.com/wp-content/uploads/2017/11/cropped-Site-icon-150x150.png</url>
	<title>AOAG - Techyaz.com</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is Enhanced Database Failover and How to Enable it for Availability Group?</title>
		<link>https://techyaz.com/sql-server/alwayson/enhanced-database-failover-in-availability-group/</link>
					<comments>https://techyaz.com/sql-server/alwayson/enhanced-database-failover-in-availability-group/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Fri, 22 Jun 2018 13:12:20 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[availability group]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2404</guid>

					<description><![CDATA[<p>As we know Always on Availability Group is the set of user databases that are combined to failover if primary replica becomes inaccessible. Till SQL Server 2014, Alwayson Availability Group was not able to start failover operation if any individual&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/enhanced-database-failover-in-availability-group/">What is Enhanced Database Failover and How to Enable it for Availability Group?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>As we know Always on Availability Group is the set of user databases that are combined to failover if primary replica becomes inaccessible. Till SQL Server 2014, Alwayson Availability Group was not able to start failover operation if any individual database within AOAG become inaccessible. Microsoft introduced an option named <em>Enhanced Database Failover</em> in SQL Server 2016 to trigger the failover in case any database participating in Availability Group loses the ability to write transactions. We also call it <em>Database Level Health Detection</em> in Availability Group.</p>
<p><em>Enhanced Database Failover</em> option is not mandatory while configuring Always on Availability Group in SQL Server 2016. It’s optional and If you have enabled <em>Enhanced Database Failover</em> option for any Availability Group along with automatic failover configuration then this option will trigger failover to a synchronized secondary replica in case any database participating in that availability group is no longer able to write transactions.</p>
<p>You cannot set this option for specific databases within availability group. <em>Enhanced database failover</em> or <em>database level health detection</em> will be enabled at availability group level. Once you configure it, all databases participating in that availability group can use this feature to trigger failover if anything goes wrong with them.</p>
<h3><span style="color: #333399;">Configure Enhanced Database Failover to Availability Group</span></h3>
<p>We can set this option as per our choice or requirement either by using GUI Wizard or by using Transact-SQL. As of now, you cannot configure <em>Enhanced Database Failover</em> option using PowerShell cmdlets. Remember, by default, enhanced database failover option is disabled. If you want to use this feature, you need to enable it. Here, I will explain how to enable <em>Enhanced Database Failover</em> to an Availability Group while its creation and to the existing one.</p>
<p>If you want to check whether an availability group has <em>enhanced database failover</em> enabled or not then we can use dynamic management view <strong>sys.availability_groups</strong>. You will see a column named <strong>db_failover</strong> in this DMV. If the value of any availability group is showing zero then it means this feature is disabled and if value shows 1 then it means it’s enabled. You can execute below command to get the settings for all availability group.</p>
<pre><strong><span style="color: #0000ff;">select name, db_failover from sys.availability_groups</span></strong><strong> </strong></pre>
<h5><span style="color: #993300;">Enable Enhanced Database Failover using GUI in SSMS</span></h5>
<p>We can enable this option while configuring availability group or later to the existing availability groups that was already created without enabling this option. As we know there are two ways to create an availability group using GUI in SSMS. One is by using <em>New Availability Group</em> dialog box and another way is by using <em>Availability Group</em> wizard window. Enabling this option is quite same in both ways. To enable enhanced database failover, select its checkbox next to <em>Database Level Health Detection</em> as shown in below image.</p>
<p>You can get this window by following given steps. In SQL Server Management Studio, connect to your SQL Server database engine. Right click on the AlwaysOn High Availability node, and run the <strong>New Availability Group Wizard</strong>. Check the <strong>Database Level Health Detection</strong> checkbox on the Specify Name page. Then complete the rest of the pages in the wizard.</p>
<p><img fetchpriority="high" decoding="async" class=" wp-image-2405 aligncenter" src="https://techyaz.com/wp-content/uploads/2018/06/1-Enhanced-DB-Failover.jpg" alt="Enable Enhanced Database Failover" width="534" height="500" srcset="https://techyaz.com/wp-content/uploads/2018/06/1-Enhanced-DB-Failover.jpg 515w, https://techyaz.com/wp-content/uploads/2018/06/1-Enhanced-DB-Failover-300x281.jpg 300w" sizes="(max-width: 534px) 100vw, 534px" /></p>
<p>Another way to enable this option for existing availability groups are given below. Launch <strong>Properties</strong> window of existing Availability Group in SQL Server Management Studio. Here, you can see this option as shown in below image. Check the option <strong>Database Level Health Detection</strong>, then click OK to apply the changes.</p>
<p><img decoding="async" class="size-full wp-image-2406 aligncenter" src="https://techyaz.com/wp-content/uploads/2018/06/2-enhanced-DB-Failover.jpg" alt="Enable Enhanced Database Failover" width="521" height="469" srcset="https://techyaz.com/wp-content/uploads/2018/06/2-enhanced-DB-Failover.jpg 521w, https://techyaz.com/wp-content/uploads/2018/06/2-enhanced-DB-Failover-300x270.jpg 300w" sizes="(max-width: 521px) 100vw, 521px" /></p>
<h5><span style="color: #993300;">Enable Enhanced Database Failover using T-SQL</span></h5>
<p>We can enable enhanced database failover using T-SQL during availability group creation or after creation by running ALTER AVAILABILITY GROUP statement. To configure it during the creation of an availability group, we must set <em>DB_FAILOVER </em>to ON as showing in below command. I have highlighted this in green colour.</p>
<pre><strong><span style="color: #0000ff;">CREATE AVAILABILITY GROUP [AG_Techyaz]</span></strong>
<strong><span style="color: #0000ff;">WITH <span style="color: #008000;">(DB_FAILOVER = ON)</span></span></strong>
<strong><span style="color: #0000ff;">FOR DATABASE [Techyaz]</span></strong>
<strong><span style="color: #0000ff;">REPLICA ON</span></strong>
<strong><span style="color: #0000ff;">       'SQLInstance1' WITH (ENDPOINT_URL = 'ENDPOINT ADDRESS:PORT-Number', FAILOVER_MODE = AUTOMATIC, AVAILABILITY_MODE = SYNCHRONOUS_COMMIT),</span></strong>
<strong><span style="color: #0000ff;">   'SQLInstance2' WITH (ENDPOINT_URL = 'ENDPOINT ADDRESS:PORT-Number', FAILOVER_MODE = AUTOMATIC, AVAILABILITY_MODE = SYNCHRONOUS_COMMIT)</span></strong></pre>
<p>If you have already created availability group without enabling this option then we have also an option to add this behavior to existing availability groups by using ALTER AVAILABILITY GROUP command as given below.</p>
<pre><strong><span style="color: #0000ff;">ALTER AVAILABILITY GROUP [AG_Techyaz] SET (DB_FAILOVER = ON)</span></strong></pre>
<h5><span style="color: #993300;">Disable Enhanced Database Failover using T-SQL</span></h5>
<p>We can disable this option simply by running below command. We must set DB_FAILOVER value to OFF to disable this feature.</p>
<pre><strong><span style="color: #0000ff;">ALTER AVAILABILITY GROUP [Techyaz] SET (DB_FAILOVER = OFF)</span></strong></pre>
<p>You will see error message 41653 logged in SQL Server error log if an availability group has failed over due to the database level health detection checks.</p>
<h3><span style="color: #333399;">Cautions</span></h3>
<p>It is very important to understand how enhanced database failover or database level health detection works. This option does not monitor disk uptime or database file availability to trigger failover.</p>
<p>Suppose your database is idle with no active transactions, and with no physical writes occurring and some of the database files become inaccessible in between then this option will not trigger automatic failover. Later, when a database checkpoint occurs, or a physical read or write occurs for fulfilling a query, then SQL Server may then notice the file issue, and react by changing the database status, and subsequently the availability group with database level health detection set on would failover due to the database health change.</p>
<p>As another example, when the SQL Server database engine needs to read a data page to fulfill a query, if the data page is cached in the buffer pool memory, then no disk read with physical access may be required to fulfill the query request. Therefore, a missing or unavailable data file may not immediately trigger an automatic failover even when database health option is enabled.</p>
<p>I hope you like this article. Please follow our <a href="https://www.facebook.com/Techyaz/" target="_blank" rel="noopener">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter </a>handle to get latest updates.</p>
<p><span style="color: #800000;"><em><strong>Read More:</strong></em></span></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/" target="_blank" rel="noopener">How to Patch SQL Server Failover Cluster Instance Running with Always on Availability Group?</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/sql-server-alwayson-interview-questions-answers/" target="_blank" rel="noopener">SQL Server Alwayson Interview Questions &amp; Answers</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/sql-server-administration/understanding-sql-server-backup-databases-availability-group/" target="_blank" rel="noopener">Understanding Backup Preferences in Alwayson Availability Group</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/change-failover-mode-of-availability-replica-in-always-on-availability-group/" target="_blank" rel="noopener">How to Change Failover Mode of Availability Replica in AOAG?</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fixing-sap-connectivity-issue-aoag-automatic-failover/" target="_blank" rel="noopener">Fixing Application connectivity Issue after AOAG automatic failover</a></strong></li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/enhanced-database-failover-in-availability-group/">What is Enhanced Database Failover and How to Enable it for Availability Group?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/enhanced-database-failover-in-availability-group/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Upgrade or Patch SQL Server Failover Cluster Instance Running with Availability Group</title>
		<link>https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/</link>
					<comments>https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Mon, 04 Jun 2018 14:39:57 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[Availability Group Upgrade]]></category>
		<category><![CDATA[Clustering]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2391</guid>

					<description><![CDATA[<p>I have explained step by step process to upgrade or patch SQL Server instance that hosts an Always on Availability Group (AOAG) to latest version in attached article. Here, I will explain how to upgrade or patch SQL Server failover&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/">Upgrade or Patch SQL Server Failover Cluster Instance Running with Availability Group</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I have explained step by step process to <strong><a href="https://techyaz.com/sql-server/upgrade-patch-availability-group-instances/" target="_blank" rel="noopener">upgrade or patch SQL Server instance that hosts an Always on Availability Group (AOAG)</a></strong> to latest version in attached article. Here, I will explain how to upgrade or patch SQL Server failover cluster instance running with Always on Availability Group. We should plan and execute such upgrades carefully to avoid any risk during execution. The process to upgrade or patch SQL Server cluster instances running with AOAG is quite similar.</p>
<p><strong>NOTE:</strong> Always test any solution in Lower life cycle environment before deploying it to Production.</p>
<h3><span style="color: #333399;">Points to Remember</span></h3>
<ol>
<li>I have described steps to upgrade or patch SQL Server failover cluster instance having always on availability group. Do not use these steps while upgrading or patching Windows clustering or standalone SQL Server instances running with Always on Availability groups. If you have AOAG configured on standalone SQL Server instances then read <strong><a href="https://techyaz.com/sql-server/upgrade-patch-availability-group-instances/" target="_blank" rel="noopener">attached article</a></strong>.</li>
<li>During the upgrade process, a secondary replica will not be available for failover or for read-only operations, and after the upgrade, it may take some time for the secondary replica to catch up with the primary replica node depending upon the volume of activity on the primary replica node (so expect high network traffic).</li>
<li>A higher version of a SQL Server instance cannot be added as a new replica to an existing AOAG. For example, a SQL Server 2016 replica cannot be added to an existing SQL Server 2014 AG.</li>
<li>Always first upgrade secondary replica then primary replica because an upgraded primary replica can no longer ship logs to any secondary replica. This may cause data loss as data movement to a secondary replica is suspended.</li>
</ol>
<h3><span style="color: #333399;">Planning </span></h3>
<p>We should be very careful while planning upgrade or Patching for your SQL Server Failover cluster instances and if your SQL Server cluster instances are running with availability groups then you need to be more careful considering its complex configuration. Here, i have given multiple steps that you need to plan during patching any AOAG cluster instance.</p>
<ol>
<li>Make sure you can directly upgrade to the latest version of SQL Server 2017. If you are running with SQL Server 2005, you cannot go directly to SQL Server 2017. You must upgrade SQL Server 2005 to SQL Server 2012, 14 or 2016 before moving to latest version SQL Server 2017.</li>
<li>Identify your databases if they are involved in Change Data Capture or Replication then we need to perform some additional activities. These additional steps are given later in this article.</li>
<li>Run DBCC CHECKDB to make sure there is no corruption on databases hosted on these cluster instances.</li>
<li>You must run Full database backups for all your databases to secure a copy in case anything goes wrong and we need it to restore databases.</li>
<li>Make sure Always on Availability Group is working fine and in Healthy state. Fix the issues and make your AOAG configuration in healthy state before going with the upgrade.</li>
<li>Disable the backup job from the system that is going to upgrade (current secondary replica) and make sure to run it from the server that is online and acting as primary replica at the time upgrade will process. You can also <strong><a href="https://techyaz.com/sql-server/sql-server-administration/understanding-sql-server-backup-databases-availability-group/" target="_blank" rel="noopener">change the Backup Preferences of AOAG</a></strong> to run backups always from primary replica during this upgrade.</li>
<li>No replicas are readable or available for backups during a version upgrade whereas during a non-version upgrade you can configure automated backups to run on secondary replicas prior to upgrading the primary replica.</li>
<li>Choose Upgrade approach. As we know, there are three approaches to perform any SQL Server upgrade. In-place upgrade, Side by side upgrade and Rolling upgrade. We will be using rolling upgrade process to apply patch or upgrade SQL Server cluster instances. This approach is used if your SQL Server Instances are required to upgrade in particular sequence. We use this approach if SQL Server is configured with Always on availability group, Database Mirroring, Log Shipping, Replication, Failover Cluster Instances, SQL Server Reporting Scale-out environment.</li>
<li>Make sure that synchronization state of the failover target is SYNCHRONIZED during any failover of Availability Group.</li>
<li>Develop a rollback plan. Executing this plan will enable you to restore your original environment if you need to rollback.</li>
<li>Plan to test the upgrade on Lower life cycle first before deploying on productions.</li>
</ol>
<h3><span style="color: #333399;">Upgrade or Patch SQL Server Failover Cluster Instance running with Availability Group</span></h3>
<p>Here, I will explain how to upgrade or patch SQL Server failover cluster Instance running with Always on Availability group. Let me describe the cluster setup first for this upgrade.</p>
<ul>
<li>We have four database servers that are hosted in two data centers. Two nodes in each data centers.</li>
<li>All four nodes are part of same windows cluster group. two set of storage have been shared between two nodes to install SQL Server failover cluster.</li>
<li>Two SQL Server Failover Cluster Instances have been installed on these nodes of each data centers. One SQL Server failover cluster instance named <strong>FCIA</strong> is installed in data center 1 and another SQL Server cluster instance named <strong>FCIB</strong> is hosted in data center 2.</li>
<li>We have configured Availability Group between these two SQL Server failover cluster instances.</li>
<li>Each SQL Server cluster instance has two nodes. One active and one passive node in their respective data centers. Although active node in data center 2 is not active for connections but this will work as primary in case AOAG failover.</li>
<li>Databases are hosted on shared storage that is connected to their respective nodes in their data centers. You can see this configuration depicted in below image.</li>
</ul>
<p><img decoding="async" class="wp-image-2392 aligncenter" src="https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min-1024x333.jpg" alt="Patch SQL Server failover cluster instance running with AOAG" width="757" height="246" srcset="https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min-1024x333.jpg 1024w, https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min-300x98.jpg 300w, https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min-768x250.jpg 768w, https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min.jpg 1115w" sizes="(max-width: 757px) 100vw, 757px" /></p>
<p>Now we have to upgrade or patch this AOAG cluster instance configuration. Keep reading this article to understand step by step process to patch such complex AOAG configuration.</p>
<p>We can see above SQL Server cluster instances have Always on Availability Group so we will follow rolling upgrade process to perform upgrade or patch on these SQL Server cluster instances. The sequence to upgrade SQL Server cluster instances having AOAG configuration is to go from passive to active. We will upgrade the inactive nodes before upgrading the active nodes. Have a look at below step by step process.</p>
<ol>
<li>First upgrade or patch passive node of SQL Server cluster instance <strong>FCIB</strong> i.e. <em><strong>Node 4</strong></em>.</li>
<li>Once you will update node 4 of above image configuration then next step is to <em><strong>failover</strong></em> second SQL Server cluster instance FCIB to upgraded instance Node 4 that is hosted in data center 2.</li>
<li>Once you performed failover for cluster instance <strong>FCIB</strong> to node 4 then next step is to patch <em><strong>node 3</strong></em> that will be in passive state of this inactive SQL Server cluster instance. You can failback SQL Server cluster instance FCIB to node 3 again post patching. This failback is an optional step and not mandatory. Now you have applied latest patch level or upgraded your SQL Server cluster instance FCIB hosted in two cluster nodes in data center 2. Next, we will follow same process to apply patches in data center 1.</li>
<li>Apply patch on SQL Server cluster <em><strong>node 2</strong></em> or upgrade SQL Server cluster node installed on node 2 machine as it’s passive node of SQL Server cluster instance <strong>FCIA</strong>.</li>
<li>Once you have upgraded or patched node 2 in data center 1 next we will <em><strong>failover</strong></em> SQL Server cluster instance FCIA to node 2. Now node 2 will run active instance of SQL Server cluster setup. But If you have enabled change data capture feature or replication configured on your SQL Server cluster instance then you should run few additional steps as described here. Once you upgraded or patched all secondary replicas then fail over the Availability Group to an upgraded instance. Now run below command on your primary replica.</li>
</ol>
<pre style="padding-left: 60px;"><strong><span style="color: #0000ff;">EXECUTE [master].[sys].[sp_vupgrade_replication];</span></strong></pre>
<ol start="6">
<li>Go ahead after execution of above command and upgrade or patch SQL Server cluster instance that was originally the primary replica i.e. Node 1</li>
</ol>
<ol start="7">
<li>Now, patch SQL Server cluster instance that is hosted on <em><strong>node 1</strong></em> and was original primary replica that is now acting as passive in this cluster setup. Once done you can failback SQL Server cluster instance FCIA to again node 1 as active node. Here, you have patched or upgraded all SQL Server cluster instances hosted on these four nodes.</li>
</ol>
<p>Here, I have described how to upgrade or patch SQL Server failover cluster instance that is running with Always on Availability Group. I hope you like this article. Please follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p><span style="color: #800000;"><em><strong>Read More:</strong></em></span></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/restore-database-participating-alwayson-availability-group/" target="_blank" rel="noopener">How to Restore a Database participating in AOAG?</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/sql-server-alwayson-interview-questions-answers/" target="_blank" rel="noopener">SQL Server Alwayson Interview Questions &amp; Answers</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/change-failover-mode-of-availability-replica-in-always-on-availability-group/" target="_blank" rel="noopener">Change Failover Mode of Availability Replica in AOAG</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/add-database-availability-group/" target="_blank" rel="noopener">Add a New Database to Availability Group</a></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/">Upgrade or Patch SQL Server Failover Cluster Instance Running with Availability Group</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Change Failover Mode of Availability Replica in Always On Availability Group?</title>
		<link>https://techyaz.com/sql-server/alwayson/change-failover-mode-of-availability-replica-in-always-on-availability-group/</link>
					<comments>https://techyaz.com/sql-server/alwayson/change-failover-mode-of-availability-replica-in-always-on-availability-group/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Mon, 21 May 2018 14:44:56 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[availability group]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2339</guid>

					<description><![CDATA[<p>Today, i will describe about the overview of failover modes in AOAG and how to Change failover mode of an availability replica in SQL Server Alwayson Availability Group. As we know SQL Server Always on availability group fails over to&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/change-failover-mode-of-availability-replica-in-always-on-availability-group/">How to Change Failover Mode of Availability Replica in Always On Availability Group?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Today, i will describe about the overview of failover modes in AOAG and how to Change failover mode of an availability replica in <a href="https://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">SQL Server Alwayson Availability Group</a>. As we know SQL Server Always on availability group fails over to one of its secondary replica in case of any failover incident. There are three types of failover exists in SQL Server Always on Availability group. Any such failover might be one of them that are given below.</p>
<ul>
<li>Automatic failover</li>
<li>Planned Manual failover</li>
<li>Forced Manual failover (forced failover).</li>
</ul>
<p><img loading="lazy" decoding="async" class="size-full wp-image-2340 alignright" src="https://techyaz.com/wp-content/uploads/2018/05/Change-Failover-Mode-Availability-Replica.png" alt="How to Change Failover Mode of Availability Replica in SQL Server Always On Availability Group" width="300" height="300" srcset="https://techyaz.com/wp-content/uploads/2018/05/Change-Failover-Mode-Availability-Replica.png 300w, https://techyaz.com/wp-content/uploads/2018/05/Change-Failover-Mode-Availability-Replica-150x150.png 150w, https://techyaz.com/wp-content/uploads/2018/05/Change-Failover-Mode-Availability-Replica-160x160.png 160w, https://techyaz.com/wp-content/uploads/2018/05/Change-Failover-Mode-Availability-Replica-320x320.png 320w" sizes="auto, (max-width: 300px) 100vw, 300px" /></p>
<p>There is no data loss if you perform automatic or planned manual failover but there might be some data loss if you are performing forced manual failover. Whether SQL Server Always on Availability group will failover automatically or manual, it depends on the configuration of AOAG availability mode. SQL Server Always on Availability Group supports two availability modes. First one is Synchronous-commit and another one is Asynchronous-commit mode. Synchronous-commit mode supports Automatic and Manual both failover types whereas Asynchronous-commit mode supports only manual failover that is also forced failover type.</p>
<p>The failover type (Automatic or Manual) will be decided by the failover mode property of availability replica. Always on Availability group failover modes depends on the AOAG availability mode configuration as I described above.</p>
<p>If you have synchronous commit replicas then you would have two failover mode options. One is Automatic failover mode and another is Manual failover mode whereas you have only manual failover mode option available in asynchronous commit replicas.</p>
<p>Here, I will describe how to change failover mode of SQL Server Always On availability group using SSMS and T-SQL statements. You can change from automatic failover mode to manual failover mode or vice-versa based on their availability mode configuration. As I explained above, failover mode is a replica property that determines the failover mode for replicas that run under synchronous-commit availability mode. Read below prerequisites before going to change failover mode of availability replica in SQL Server Always On availability group.</p>
<h3><span style="color: #333399;">Prerequisites</span></h3>
<ul>
<li>Make sure to perform this activity on primary replicas.</li>
<li>As we know SQL Server Failover Cluster Instances (FCIs) do not support automatic failover by availability groups, so any availability replica that is hosted by an FCI can only be configured for manual failover.</li>
<li>Make sure that you have admin privilege or minimum you should have ALTER AVAILABILITY GROUP permission on the availability group, CONTROL AVAILABILITY GROUP permission, ALTER ANY AVAILABILITY GROUP permission, or CONTROL SERVER permission.</li>
</ul>
<h3><span style="color: #333399;">Steps to Change Failover Mode of an Availability Replica</span></h3>
<p>Here, I will describe to change it using two ways. One is using SSMS and another is using T-SQL statements. Let&#8217;s start with SSMS method.</p>
<h5><strong><span style="color: #993300;">Using SQL Server Management Studio</span></strong></h5>
<p>Follow below step to change failover mode of an availability replica.</p>
<ol>
<li>Launch SQL Server Management Studio and connect to the primary replica, and expand the server tree.</li>
<li>Expand the <strong>Always On High Availability</strong>node and then <strong>Availability Groups</strong></li>
<li>Select the availability group for which you have to change the failover mode then right-click on the identified replica, and click <strong>Properties</strong>.</li>
<li>In the <strong>Availability Replica Properties </strong>dialog box, you can select correct <strong>Failover mode</strong> as per your requirement from the dropdown list to change the failover mode of this replica.</li>
<li>Choose any value from drop down as per your requirement and close the windows post apply this new change.</li>
</ol>
<h5><span style="color: #993300;">Using T-SQL</span></h5>
<p>We can change failover mode of an availability replica using T-SQL statement as well. Follow below steps to do this change using T-SQL.</p>
<ol>
<li>Connect to the Primary Replica.</li>
<li>Open New Query window to execute your T-SQL statements.</li>
<li>Run below statement to change the failover mode from Manual to Automatic of an availability group named Techyaz.</li>
</ol>
<pre style="padding-left: 30px;"><strong><span style="color: #0000ff;">ALTER AVAILABILITY GROUP Techyaz MODIFY REPLICA ON 'GURTY01' WITH</span></strong>
<strong><span style="color: #0000ff;">(FAILOVER_MODE = AUTOMATIC);</span></strong></pre>
<p>Techyaz is the name of the availability group and GURTY01 is either the computer name or the failover cluster network name. For named instances add full instance name post \ as well. Use the name that hosts the replica that you want to modify.</p>
<p>Here, I have shown you step by step method to change Failover Mode of Availability Replica in SQL Server Always On Availability Group. I hope you like this article. Please follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p><em><strong><span style="color: #800000;">Read More:</span></strong></em></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/upgrade-patch-availability-group-instances/" target="_blank" rel="noopener">How to Upgrade or Apply Patches on AOAG Instances?</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/sql-server-administration/understanding-sql-server-backup-databases-availability-group/" target="_blank" rel="noopener">Understanding Backup Preferences in Alwayson Availability Group</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/restore-database-participating-alwayson-availability-group/" target="_blank" rel="noopener">How to Restore a Database participating in AOAG?</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/sql-server-alwayson-interview-questions-answers/" target="_blank" rel="noopener">SQL Server Alwayson Interview Questions &amp; Answers</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-alwayson-error-35250-joining-database-secondary-replica-resulted-error/" target="_blank" rel="noopener">Fix SQL Server Alwayson Error 35250: Joining Database on Secondary Replica resulted in an Error</a></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/change-failover-mode-of-availability-replica-in-always-on-availability-group/">How to Change Failover Mode of Availability Replica in Always On Availability Group?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/change-failover-mode-of-availability-replica-in-always-on-availability-group/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Upgrade or Patch Alwayson Availability Group Instances?</title>
		<link>https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/</link>
					<comments>https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Mon, 05 Feb 2018 13:44:59 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[availability group]]></category>
		<category><![CDATA[Availability Group Upgrade]]></category>
		<category><![CDATA[SQL Server Patching]]></category>
		<category><![CDATA[SQL Server Upgrade]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=1737</guid>

					<description><![CDATA[<p>If you are planning to upgrade your SQL Server instance that hosts an Always on Availability Group (AOAG) to a latest version SQL Server 2017 or you are planning to patch Alwayson Availability Group instances, then you should plan it&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/">How to Upgrade or Patch Alwayson Availability Group Instances?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you are planning to upgrade your SQL Server instance that hosts an <strong><a href="http://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">Always on Availability Group</a></strong> (AOAG) to a latest version SQL Server 2017 or you are planning to patch Alwayson Availability Group instances, then you should plan it carefully to minimize downtime and any risk during these activities. I would suggest you read this article before upgrading or patching SQL Server instances that has Always on Availability Group configured.</p>
<p><span style="color: #000000;"><strong>NOTE:</strong> <strong>First Test this solution in Lower Life Cycle environment then deploy in Production.</strong></span></p>
<h3><span style="color: #333399;">Points to Remember </span></h3>
<p><img loading="lazy" decoding="async" class="size-full wp-image-1740 alignright" src="http://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min.png" alt="Upgrade or Patch SQL Server AOAG Instances" width="300" height="300" srcset="https://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min.png 300w, https://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min-150x150.png 150w, https://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min-160x160.png 160w, https://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min-320x320.png 320w" sizes="auto, (max-width: 300px) 100vw, 300px" />Below are important points you should always keep in mind while you are planning or upgrading SQL Server Instances that has Alwayson Availability Group configured.</p>
<ol>
<li>All steps given in this article are limited to upgrading or patching SQL Server Instances that has AOAG configuration. It does not cover operating system upgrade.</li>
<li>Secondary replica will not be available for failover or for read-only operations during the upgrade process.</li>
<li>A higher version of a SQL Server instance cannot be added as a new replica to an existing AOAG. For example, a SQL Server 2016 replica cannot be added to an existing SQL Server 2014 AG.</li>
<li>Don’t upgrade primary replica instance before upgrading or updating any other secondary replica instance. An upgraded primary replica can no longer ship logs to any secondary replica. This may cause data loss as data movement to a secondary replica is suspended.</li>
</ol>
<h3><span style="color: #333399;">Upgrade or Patch SQL Server AOAG Instances &#8211; Prerequisites</span></h3>
<p>Make sure to meet and follow below prerequisites during planning the upgrade or patching of SQL Server Availability Group Instances.</p>
<ol>
<li>Review the Hardware and software requirements for latest SQL Server version on which you are planning to upgrade.</li>
<li>Make sure your application is supported on the latest version of SQL Server on which we are upgrading.</li>
<li>Make sure you can directly upgrade to the latest version of SQL Server 2017. If you are running with SQL Server 2005, you cannot go directly to SQL Server 2017. You must upgrade SQL Server 2005 to SQL Server 2012, 14 or 2016 before moving to latest version SQL Server 2017.</li>
<li>Choose Upgrade approach. As we know, there are three approaches to perform any SQL Server upgrade. In-place upgrade, Side by side upgrade and Rolling upgrade. As we are planning to upgrade AOAG instance so we will choose Rolling Upgrade method. Below are the details of other upgrade methods.</li>
</ol>
<ul>
<li><strong>In-Place Upgrade:</strong> SQL Server setup program upgrades the existing SQL Server installation by replacing the existing SQL Server bits with the new SQL Server bits and then upgrades each of the system and user databases. This method is frequently used in a development environment without a high-availability (HA) configuration or a non-mission critical production environment that can tolerate downtime and that is running on a recent hardware and software.</li>
<li><strong>Side by Side Upgrade:</strong> We build new machine and install all required software keeping source system running separately and then migrate all databases from source to this newly build machine. This method is effective in minimizing the downtime or in case if you need to roll back the upgrade.</li>
<li><strong>Rolling Upgrade:</strong> This method is used if your SQL Server Instances are required to upgrade in particular sequence. We use this approach if SQL Server is configured with Always on availability group, Database Mirroring, Log Shipping, Replication, Failover Cluster Instances, SQL Server Reporting Scale-out environment.</li>
</ul>
<ol start="5">
<li>Develop a rollback plan. Executing this plan will enable you to restore your original environment if you need to rollback.</li>
<li>Plan to test the upgrade on Lower life cycle first before deploying on productions.</li>
<li>Identify your databases if they are involved in Change Data Capture or Replication then we need to perform some addition activities. Have a look into last section of this article before performing the upgrades.</li>
</ol>
<h3><span style="color: #333399;">Upgrade or Patch AOAG Instances &#8211; Planning</span></h3>
<p>Here, I am explaining how to plan SQL Server Availability Group instance patching or upgrade to the newer version. Have a look at below points.</p>
<ol>
<li>Check database integrity on every availability databases that we are going to upgrade. Run DBCC CHECKDB to make sure there is no corruption on databases.</li>
<li>Run Full database backups for all your databases to secure a copy in case anything goes wrong we need it to restore databases.</li>
<li>Make sure Always on Availability Group is working fine and in Healthy state. You can test a manual failover whether it is working fine or not. If any issue during failover or AOAG not in healthy state, you must fix it before going with the upgrade.</li>
<li>Disable the backup job from the system that is going to upgrade (current secondary replica) and make sure to run it from the server that is online and acting as primary replica at the time upgrade will process. You can also<strong> <a href="http://techyaz.com/sql-server/sql-server-administration/understanding-sql-server-backup-databases-availability-group/" target="_blank" rel="noopener">change the Backup Preferences of AOAG</a> </strong>to run backups always from primary replica during this upgrade.</li>
<li>The sequence will be always upgrade the remote secondary replica instances first, then local secondary replica instances next, and the primary replica instance last. If you upgrade the primary replica instance without failing over the Always on availability Group to an upgraded instance with a secondary replica then client applications may suffer extended downtime during the upgrade on the primary replica instance. So better to follow the sequence to reduce downtime.</li>
<li>Always failover the AOAG to a synchronous-commit secondary replica instance. If you fail over to an asynchronous-commit secondary replica instance, you might lose some of your data.</li>
<li>Make sure that synchronization state of the failover target is SYNCHRONIZED during any failover of Availability Group.</li>
</ol>
<h3><span style="color: #333399;">Upgrading or Patching Always on Availability group Instances</span></h3>
<p>Now you have planned and understand the rolling upgrade methodology and the upgrade process of AOAG configured SQL Server Instances. Here, i will explain upgrade or patching of availability group instances into two sections. One has multiple secondary replicas and another have only one secondary replica that also in remote location for DR purpose.</p>
<h5><span style="color: #ff6600;">If Availability Group has Local and Remote Secondary Replicas</span></h5>
<p>Here, I am giving a standard process to perform the upgrade on a configuration that has local secondary replicas as well as remote secondary replicas for DR solution. You can consider it as four replica environments where one replica is hosted on local datacenter and remaining other replicas are hosted on one or multiple remote sites for DR purpose. I have illustrated this configuration in below screenshot where we have one local replica and two remote secondary replicas.</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-1741 size-large" src="http://techyaz.com/wp-content/uploads/2018/02/1-min-1024x499.png" alt="AOAG with four replicas" width="1024" height="499" srcset="https://techyaz.com/wp-content/uploads/2018/02/1-min-1024x499.png 1024w, https://techyaz.com/wp-content/uploads/2018/02/1-min-300x146.png 300w, https://techyaz.com/wp-content/uploads/2018/02/1-min-768x374.png 768w, https://techyaz.com/wp-content/uploads/2018/02/1-min.png 1873w" sizes="auto, (max-width: 1024px) 100vw, 1024px" />Let’s start with upgrade process considering above scenario.</p>
<ol>
<li>Verify you have full database backup for all availability databases. If you don’t have full backups, make sure to run it before this upgrade to protect your data.</li>
<li>Now, change automatic failover on synchronous-commit replicas to manual (between replica A and B) to prevent any accidently failovers during upgrade process.</li>
<li>Test a manual failover and make sure that it is working fine.</li>
<li>Now upgrade all remote secondary replica instances (Replica C and D) running with asynchronous-commit secondary replicas.</li>
<li>Upgrade the all local replica secondary instances (Replica B) that are not currently running the primary replica.</li>
<li>Once all secondary replicas have been upgraded and you left out only with primary replica to upgrade then manually fail over the AG to a local synchronous-commit secondary replica. Here, Replica B will be acting as primary replica now.</li>
<li>Upgrade or update the local replica instance that formerly hosted the primary replica (Replica A).</li>
<li>Verify SQL Server version on all replicas to make sure every instance is upgraded. Failback current primary replica from replica B to A that was primary replica initially.</li>
<li>Now, configure automatic failover partners from manual failover (between replica A and B) as we did in step 2 to prevent unwanted failover during upgrade process.</li>
<li>Perform a failover testing on upgraded instances to make sure everything is working fine.</li>
</ol>
<h5><span style="color: #ff6600;">If Availability Group has only One Secondary Replica for DR solution</span></h5>
<p>If you have configured Availability group only to achieve DR solution having single remote secondary replica with asynchronous-commit mode then you need to follow little different approach for upgrade or apply patches.</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-1742 " src="http://techyaz.com/wp-content/uploads/2018/02/2-min-1024x507.png" alt="AOAG with one remote secondary replica" width="705" height="349" srcset="https://techyaz.com/wp-content/uploads/2018/02/2-min-1024x507.png 1024w, https://techyaz.com/wp-content/uploads/2018/02/2-min-300x148.png 300w, https://techyaz.com/wp-content/uploads/2018/02/2-min-768x380.png 768w, https://techyaz.com/wp-content/uploads/2018/02/2-min.png 1271w" sizes="auto, (max-width: 705px) 100vw, 705px" /></p>
<p>You can follow below step by step method to upgrade or Patch your AOAG instances that has only one secondary replica that also on remote site for DR purpose.</p>
<ol>
<li>Verify you have full database backups to secure your data.</li>
<li>Upgrade your remote secondary replica that is hosted for DR.</li>
<li>Once remote secondary replica is upgraded or Patched, make sure to change the data transfer mode from asynchronous-commit to synchronous-commit to prevent any potential data loss during failover. Do not initiate failover until synchronization state will become SYNCHRONIZED.</li>
<li>Initiate the failover once data is synchronized between both replicas. And once failover will be done again change the data transfer more to asynchronous-commit mode to avoid any data latency issue to application users.</li>
<li>Upgrade the current secondary replica (Previous Primary Replica).</li>
<li>Once both replicas will be upgraded, you can again change the data transfer mode from asynchronous-commit to synchronous-commit to prevent any potential data loss during failover. Do not initiate failover until synchronization state will become SYNCHRONIZED.</li>
<li>Failover the AOAG to remote secondary replica and change the data transfer mode to asynchronous-commit.</li>
<li>Verify details about SQL Server version.</li>
</ol>
<h3><span style="color: #333399;">Additional steps for CDC (change data capture) and Replication</span></h3>
<p>I have described in point no 7 of Prerequisite section to identify databases that are participating in change data capture or in Replication. I have mentioned that because we need to take some additional steps for such databases post upgrade or patching activity.</p>
<ol>
<li>Upgrade each secondary replica as described in above sections.</li>
<li>After all secondary replicas have been upgraded, fail over the AG to an upgraded instance.</li>
<li>Execute below T-SQL statement on the instance that hosts the primary replica:</li>
</ol>
<pre><span style="color: #0000ff;"><strong>EXECUTE [master].[sys].[sp_vupgrade_replication];</strong></span></pre>
<ol start="4">
<li>Upgrade SQL Server instance that was originally configured as primary replica.</li>
</ol>
<p>I hope you like this article. Please Like, Comment, Share &amp; Subscribe to this website to get new articles directly into your inbox. You can also follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/">How to Upgrade or Patch Alwayson Availability Group Instances?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server Alwayson Error 35250: Joining database on Secondary Replica resulted in an error</title>
		<link>https://techyaz.com/sql-server/alwayson/fix-alwayson-error-35250-joining-database-secondary-replica-resulted-error/</link>
					<comments>https://techyaz.com/sql-server/alwayson/fix-alwayson-error-35250-joining-database-secondary-replica-resulted-error/#comments</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Mon, 09 Oct 2017 14:52:27 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[AOAG Listener]]></category>
		<category><![CDATA[endpoints]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[Listener Issue]]></category>
		<category><![CDATA[logins]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=1048</guid>

					<description><![CDATA[<p>We got this Microsoft SQL Server error 35250 while configuring Alwayson Availability Group on one of the SQL Server Instance. There could be multiple reasons behind this SQL error 35250. You can find multiple solutions to fix this issue based&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fix-alwayson-error-35250-joining-database-secondary-replica-resulted-error/">SQL Server Alwayson Error 35250: Joining database on Secondary Replica resulted in an error</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>We got this Microsoft SQL Server error 35250 while configuring <a href="https://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">Alwayson Availability Group</a> on one of the SQL Server Instance. There could be multiple reasons behind this SQL error 35250. You can find multiple solutions to fix this issue based on the nature of the issue. Here I will show you, how to fix this Alwayson error 35250 that came due to SQL Server service accounts.</p>
<h3><span style="color: #000080;">Microsoft SQL Server Error 35250</span></h3>
<p>We generally get this error whenever there is a communication issue between endpoints of both replicas or any replica unable to connect to the endpoints cause this error to generate. You will see below error texts if you are getting this issue.</p>
<p><span style="color: #ff0000;"><em>Alwayson Error 35250</em></span><br />
<span style="color: #ff0000;"><em>Failed to Join the database &#8216;DBName&#8217; to the availability group &#8216;AOAG-Name&#8217; on the availability replica &#8216;Availability Replica Name&#8217;</em></span></p>
<p>There are many reasons behind this error that we will discuss in next section. You might also get below text if you are using T-SQL.</p>
<div><span style="color: #ff0000;"><em>Msg 35250, Level 16, State 7, Line 1</em></span><br />
<span style="color: #ff0000;"><em> The connection to the primary replica is not active.  The command cannot be processed. (microsoft sql server, error: 35250)</em></span></div>
<p>Below is the screenshot of this error.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1049" src="http://techyaz.com/wp-content/uploads/2017/10/1-Error-AOAG.jpg" alt="Error 35250" width="669" height="399" srcset="https://techyaz.com/wp-content/uploads/2017/10/1-Error-AOAG.jpg 669w, https://techyaz.com/wp-content/uploads/2017/10/1-Error-AOAG-300x179.jpg 300w" sizes="auto, (max-width: 669px) 100vw, 669px" /></p>
<h3><span style="color: #000080;">Solution</span></h3>
<p>You should check below points based on attached article <a href="https://blogs.msdn.microsoft.com/alwaysonpro/2013/12/09/create-availability-group-fails-with-error-35250-failed-to-join-the-database/">MSDN link</a> whenever you get this error.</p>
<ul>
<li>Inbound Port 5022 Traffic is Blocked</li>
<li>Endpoint is not created or started</li>
<li>Endpoint permissions</li>
<li>SQL Server is not listening on port 5022</li>
</ul>
<p>But if everything is ok and you are still not able to diagnose this issue, then you should keep reading this article.</p>
<p>I checked everything and all was well on both replicas.  As we know that there should be Grant CONNECT permission on Always On endpoint. I was reassigning GRANT CONNECT on the endpoint and came to know that the SQL Server service account was not added to the SQL Server instance of secondary replica. That is why we faced this error. Let’s first get the endpoint and then we will run Grant connect on endpoint to see the issue. Run below command to get the name of endpoint that is using in this alwayson configuration.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1050" src="http://techyaz.com/wp-content/uploads/2017/10/2-Get-the-endpoint-name.jpg" alt="get endpoint name" width="775" height="227" srcset="https://techyaz.com/wp-content/uploads/2017/10/2-Get-the-endpoint-name.jpg 775w, https://techyaz.com/wp-content/uploads/2017/10/2-Get-the-endpoint-name-300x88.jpg 300w, https://techyaz.com/wp-content/uploads/2017/10/2-Get-the-endpoint-name-768x225.jpg 768w" sizes="auto, (max-width: 775px) 100vw, 775px" /></p>
<p>We can see endpoint name is <strong>hadr_endpoint</strong>. Now run below command to grant connect permission on endpoint hadr_endpoint. The login name is the service account that is used to run SQL Server services.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1051" src="http://techyaz.com/wp-content/uploads/2017/10/3-Run-cmd-togrant-connect.jpg" alt="grant connect on endpoint" width="751" height="179" srcset="https://techyaz.com/wp-content/uploads/2017/10/3-Run-cmd-togrant-connect.jpg 751w, https://techyaz.com/wp-content/uploads/2017/10/3-Run-cmd-togrant-connect-300x72.jpg 300w" sizes="auto, (max-width: 751px) 100vw, 751px" /></p>
<p>You can see, error is saying that the account doesn’t exist on SQL Server.</p>
<p>Although you can directly check this step in SSMS as a prerequisite once error is reported. The SQL Server service accounts should be added to SQL Server Instances. I checked this account on both replica and found that it was very much there on primary replica but it was not created on secondary replica. That was the missing point which caused this issue.</p>
<p>Now create this service account on secondary replica as well or where it was missing on any of the replica then you can try to re-add the database to the AOAG configuration. This time your database will be added to the AOAG configuration. If you are facing issue during joining database to the AOAG configuration then you can remove the existing AOAG and reconfigure it.</p>
<p>Your issue will be fixed if you check and follow all above suggested points including the one mentioned in MSDN link. I hope you like this article. Please follow us on our <a href="https://www.facebook.com/Techyaz/">facebook page</a> and on <a href="https://twitter.com/Tech_yaz">Twitter </a>handle to get latest updates.</p>
<p><em><span style="color: #800000;"><strong>Read More:</strong></span></em></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-976/" target="_blank" rel="noopener">Fix AOAG Error 976:Cannot Connect to Secondary Replica</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/fix-aoag-listener-error-19471-kerberos-status-showing-handle-invalid/" target="_blank" rel="noopener">How to fix AOAG Listener Issue 19471: The handle is Invalid</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/" target="_blank" rel="noopener">Fix Listener Issue that came during AOAG Configuration</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/fix-error-15141-server-principal-owns-one-endpoints-cannot-dropped/" target="_blank" rel="noopener">How to fix Error 15141: The Server Principal owns one or more endpoints</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fixing-sap-connectivity-issue-aoag-automatic-failover/" target="_blank" rel="noopener">Fixing Application connectivity Issue after AOAG automatic failover</a></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fix-alwayson-error-35250-joining-database-secondary-replica-resulted-error/">SQL Server Alwayson Error 35250: Joining database on Secondary Replica resulted in an error</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/fix-alwayson-error-35250-joining-database-secondary-replica-resulted-error/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Fix AOAG Listener Error 19471: Kerberos Status is Showing The handle is Invalid</title>
		<link>https://techyaz.com/sql-server/alwayson/fix-aoag-listener-error-19471-kerberos-status-showing-handle-invalid/</link>
					<comments>https://techyaz.com/sql-server/alwayson/fix-aoag-listener-error-19471-kerberos-status-showing-handle-invalid/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Thu, 28 Sep 2017 13:44:47 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[Clustering]]></category>
		<category><![CDATA[Database Mirroring]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[AOAG Listener]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[Listener Issue]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=985</guid>

					<description><![CDATA[<p>I was configuring AlwaysOn Availability Group between two replicas. Everything was configured successfully but Listener was failed to create with an error 19471. I have already explained how to fix listener error 19471 in attached article but this has not&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fix-aoag-listener-error-19471-kerberos-status-showing-handle-invalid/">Fix AOAG Listener Error 19471: Kerberos Status is Showing The handle is Invalid</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I was configuring <a href="https://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">AlwaysOn Availability Group</a> between two replicas. Everything was configured successfully but Listener was failed to create with an error 19471. I have already explained <a href="https://techyaz.com/sql-server/troubleshooting/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/" target="_blank" rel="noopener">how to fix listener error 19471</a> in attached article but this has not helped me. Here i will explain another aspect of this error along with their fix.</p>
<h3><span style="color: #000080;">AlwaysOn Listener Error 19471</span></h3>
<p>When i checked the <strong>AlwaysOn High Availability</strong> folder in SSMS on any of the replica, everything was working fine. AOAG was configured successfully and working fine but listener was not configured due to below listener error 19471. You can see this in below screenshot.</p>
<div class="codediv"><strong><span class="kwrd" style="color: red;">Create failed for Availability Group Listener &#8216;Listener-Name&#8217;. (Error: 19471)<br />
</span></strong></div>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-987" src="http://techyaz.com/wp-content/uploads/2017/09/1-listenerIssue.jpg" alt="Listener Error 19471" width="673" height="371" srcset="https://techyaz.com/wp-content/uploads/2017/09/1-listenerIssue.jpg 673w, https://techyaz.com/wp-content/uploads/2017/09/1-listenerIssue-300x165.jpg 300w" sizes="auto, (max-width: 673px) 100vw, 673px" /></p>
<p>I tried creating Listener name using &#8220;<strong>Add Listener&#8230;</strong>&#8221; wizard in SSMS but failed with same error. I observed root cause of this issue during following steps given in my last article that i have attached in first paragraph. Make sure to clear all entries from DNS for your listener Name and IP, if there is any.</p>
<h3><span style="color: #000080;">Kerberos Status: The handle is Invalid</span></h3>
<p>First we will create a Client Access Point(CAP) in FCM for this listener name to check the status of NetBIOS, DNS &amp; Kerberos that will help us to go deeper inside the issue.</p>
<ol>
<li>Launch <strong>Failover Cluster Manager</strong> and click on <strong>Roles</strong> tab from left side pane. Here you can see your availability group role in right side pane.</li>
<li>Right click on this role and select &#8220;<strong>Add Resources</strong>&#8221; then &#8220;<strong>Client Access Point</strong>&#8220;.</li>
<li>Enter the <strong>Listener name</strong> and its <strong>IP address</strong> and click on <strong>Next</strong> button to proceed.</li>
<li>Click on <strong>Finish</strong> button of final screen to create the <strong>Listener Client Access Point</strong> in FCM.</li>
<li>Once CAP will be created in FCM, it will be in <strong>Offline</strong> state. <strong>Right click</strong> on listener CAP and click on &#8220;<strong>Bring Online</strong>&#8221; to bring it online. You can see Listener IP comes online but Listener name still shows in offline state.</li>
</ol>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-988" src="http://techyaz.com/wp-content/uploads/2017/09/2-CAL.jpg" alt="client access point in failover cluster manager" width="799" height="481" srcset="https://techyaz.com/wp-content/uploads/2017/09/2-CAL.jpg 799w, https://techyaz.com/wp-content/uploads/2017/09/2-CAL-300x181.jpg 300w, https://techyaz.com/wp-content/uploads/2017/09/2-CAL-768x462.jpg 768w" sizes="auto, (max-width: 799px) 100vw, 799px" /></p>
<p>Now double click on listener client access point or right click on it and choose properties. You will get CAP property window as shown in below image.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-989" src="http://techyaz.com/wp-content/uploads/2017/09/3-CAL-Property.jpg" alt="CAP Property" width="417" height="499" srcset="https://techyaz.com/wp-content/uploads/2017/09/3-CAL-Property.jpg 417w, https://techyaz.com/wp-content/uploads/2017/09/3-CAL-Property-251x300.jpg 251w" sizes="auto, (max-width: 417px) 100vw, 417px" /></p>
<p>You can see, this time issue is with <strong>Kerberos status</strong> that is showing as &#8220;<strong>The handle is invalid</strong>&#8220;. Earlier DNS status was not ok in <a href="https://techyaz.com/sql-server/troubleshooting/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/" target="_blank" rel="noopener">last article</a>.</p>
<h3><span style="color: #000080;">Fix Kerberos Status <em>The handle is invalid</em></span></h3>
<p>When i look into Active Directory server, i found that listener name object was showing as disabled as shown in below image.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-990" src="http://techyaz.com/wp-content/uploads/2017/09/4-AD-1024x124.jpg" alt="listener name is showing as disabled" width="1024" height="124" srcset="https://techyaz.com/wp-content/uploads/2017/09/4-AD-1024x124.jpg 1024w, https://techyaz.com/wp-content/uploads/2017/09/4-AD-300x36.jpg 300w, https://techyaz.com/wp-content/uploads/2017/09/4-AD-768x93.jpg 768w, https://techyaz.com/wp-content/uploads/2017/09/4-AD.jpg 1137w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>I decided to enable it and then to create listener. <strong>Right click</strong> on listener name object on AD that are showing in disable mode with down arrow and click on &#8220;<strong>Enable Account</strong>&#8221; button as per below image.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-991" src="http://techyaz.com/wp-content/uploads/2017/09/5-AD.jpg" alt="Enable listener name object in AD" width="880" height="176" srcset="https://techyaz.com/wp-content/uploads/2017/09/5-AD.jpg 880w, https://techyaz.com/wp-content/uploads/2017/09/5-AD-300x60.jpg 300w, https://techyaz.com/wp-content/uploads/2017/09/5-AD-768x154.jpg 768w" sizes="auto, (max-width: 880px) 100vw, 880px" /></p>
<p>You can see, listener name account is enabled and down arrow that are showing during disabled mode is not showing now.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-992" src="http://techyaz.com/wp-content/uploads/2017/09/6-AD.jpg" alt="Enable listener name object in AD" width="666" height="71" srcset="https://techyaz.com/wp-content/uploads/2017/09/6-AD.jpg 666w, https://techyaz.com/wp-content/uploads/2017/09/6-AD-300x32.jpg 300w" sizes="auto, (max-width: 666px) 100vw, 666px" /></p>
<p>Once you enabled the listener name object in AD, bring your listener CAP online in FCM. Right click on listener client access point and click on bring online. You can see listener CAP is showing online now.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-993" src="http://techyaz.com/wp-content/uploads/2017/09/7-CAL-online.jpg" alt="Bring CAP Online" width="779" height="363" srcset="https://techyaz.com/wp-content/uploads/2017/09/7-CAL-online.jpg 779w, https://techyaz.com/wp-content/uploads/2017/09/7-CAL-online-300x140.jpg 300w, https://techyaz.com/wp-content/uploads/2017/09/7-CAL-online-768x358.jpg 768w" sizes="auto, (max-width: 779px) 100vw, 779px" /></p>
<p>When you will launch its property window, you will see the status of NetBIOS, DNS and Kerberos are showing OK now. Close this property window to proceed.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-994" src="http://techyaz.com/wp-content/uploads/2017/09/8-CAL-Property.jpg" alt="CAP Property" width="419" height="491" srcset="https://techyaz.com/wp-content/uploads/2017/09/8-CAL-Property.jpg 419w, https://techyaz.com/wp-content/uploads/2017/09/8-CAL-Property-256x300.jpg 256w" sizes="auto, (max-width: 419px) 100vw, 419px" /><br />
Now we will follow same process that we have followed in my last article. We will remove this listener CAP from FCM and then add listener in AOAG in SSMS. Right click on <strong>CAP</strong> in FCM and click on <strong>Remove</strong> button to delete it.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-995" src="http://techyaz.com/wp-content/uploads/2017/09/9-Remove-CAL.jpg" alt="Remove CAP" width="563" height="289" srcset="https://techyaz.com/wp-content/uploads/2017/09/9-Remove-CAL.jpg 563w, https://techyaz.com/wp-content/uploads/2017/09/9-Remove-CAL-300x154.jpg 300w" sizes="auto, (max-width: 563px) 100vw, 563px" /></p>
<p>Once CAP will be removed, launch the <strong>SSMS</strong> and connect to your <strong>Primary Replica</strong>. Expand <strong>AlwaysOn High Availability</strong> folder followed by <strong>Availability Group</strong>. Now you can right click on <strong>Availability Group Listeners</strong> and click on <strong>Add Listener</strong> option. You will get below window to configure it.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-996" src="http://techyaz.com/wp-content/uploads/2017/09/10-Create-Listener.jpg" alt="Configure Listener" width="707" height="629" srcset="https://techyaz.com/wp-content/uploads/2017/09/10-Create-Listener.jpg 707w, https://techyaz.com/wp-content/uploads/2017/09/10-Create-Listener-300x267.jpg 300w" sizes="auto, (max-width: 707px) 100vw, 707px" /></p>
<p>Enter the <strong>listener name</strong>, <strong>port</strong> and then add its <strong>IP</strong>. Once you entered all details, click on <strong>OK</strong> button to create the listener. This time, listener will be created on all replicas. You can see i have just created listener for my alwayson availability group that are showing in below image for both replicas.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-997" src="http://techyaz.com/wp-content/uploads/2017/09/11-Listener-created.jpg" alt="listener in ssms" width="363" height="607" srcset="https://techyaz.com/wp-content/uploads/2017/09/11-Listener-created.jpg 363w, https://techyaz.com/wp-content/uploads/2017/09/11-Listener-created-179x300.jpg 179w" sizes="auto, (max-width: 363px) 100vw, 363px" /></p>
<p><em><span style="color: #800000;"><strong>Related Articles:</strong></span></em></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/" target="_blank" rel="noopener">How to fix Listener Error 19471: DNS Status is showing &#8220;The handle is invalid&#8221; for Listener CAP in FCM</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-976/" target="_blank" rel="noopener">Fix Error 976: Cannot connect to Secondary Replica</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/fix-error-15141-server-principal-owns-one-endpoints-cannot-dropped/" target="_blank" rel="noopener">How to fix error 15141: The server principal owns one or more endpoint(s) and cannot be dropped</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-15434-not-drop-login-user-currently-logged/" target="_blank" rel="noopener">Fix Error 15434: Could not drop login ‘XXX\yyyy’ as the user is currently logged in</a></strong></li>
</ul>
<p>I hope you like this article. Please follow us on our <a href="https://www.facebook.com/Techyaz/">facebook page</a> and on <a href="https://twitter.com/Tech_yaz">Twitter </a>handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fix-aoag-listener-error-19471-kerberos-status-showing-handle-invalid/">Fix AOAG Listener Error 19471: Kerberos Status is Showing The handle is Invalid</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/fix-aoag-listener-error-19471-kerberos-status-showing-handle-invalid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Understanding Backup Preferences for AlwaysOn Availability Group Databases</title>
		<link>https://techyaz.com/sql-server/alwayson/understanding-sql-server-backup-databases-availability-group/</link>
					<comments>https://techyaz.com/sql-server/alwayson/understanding-sql-server-backup-databases-availability-group/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Thu, 21 Sep 2017 06:53:07 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[Backup & Recovery]]></category>
		<category><![CDATA[SQL Server Administration]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[availability group]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[HADR]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[T-SQL]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=943</guid>

					<description><![CDATA[<p>We know SQL Server Backups are resource intensive operation that strain on I/O and CPU (with backup compression). AlwaysOn Availability Group has very good capability to offload SQL Server backups and read operations from primary replica to reduce such workloads&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/understanding-sql-server-backup-databases-availability-group/">Understanding Backup Preferences for AlwaysOn Availability Group Databases</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>We know <a href="https://techyaz.com/sql-server/understanding-sql-server-backups/" target="_blank" rel="noopener">SQL Server Backups</a> are resource intensive operation that strain on I/O and CPU (with backup compression). <a href="https://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">AlwaysOn Availability Group</a> has very good capability to offload SQL Server backups and read operations from primary replica to reduce such workloads and utilize secondary replicas in a better way. Read this article to understand backup preferences for AOAG databases.</p>
<p>Before going ahead, we need to understand the rules/points that are very important in order to decide the backup preferences in AOAG configuration. Below are the important points you should consider during designing backup strategy of availability databases.</p>
<ul>
<li>Regular <strong>Full Backups</strong> are not allowed from secondary replicas. Only <a href="https://techyaz.com/sql-server/understanding-sql-server-backups/" target="_blank" rel="noopener">COPY_ONLY full backups</a> are allowed on secondary replicas. That means you cannot run regular Full backup from any of the secondary replica. Remember that copy-only backups do not impact the log chain or clear the differential bitmap.</li>
<li><strong>Differential backups</strong> are not supported on secondary replicas. If you must run differential backups for your availability databases, you should not choose backup preferences as secondary replicas.</li>
<li>Only regular <strong>Log backups</strong> are supported on secondary replicas. COPY_ONLY log backups are not supported on secondary replicas.</li>
<li>Secondary replica must be in <strong>SYNCHRONIZED </strong>or <strong>SYNCHRONIZING </strong>state to backup a secondary database.</li>
<li>Log backup chain is supported across all replicas regardless of where the log backup is taken (primary or secondary replicas) or the mode of the replication (asynchronous or synchronous).</li>
<li>In a distributed availability group, backups can be performed on secondary replicas in the same availability group as the active primary replica, or on the primary replica of any secondary availability groups.</li>
</ul>
<h5><span style="color: #000080;">How SQL Server Decides Which Replica will execute Backup &#8211; Backup Preferences ?</span></h5>
<p>It’s little complex process to determine where backup jobs should run.  If you are confused about this question, then keep reading to get the answer.</p>
<p>To decide on which replica, you should run your backup job depends on your <strong>Backup Preferences</strong> setting. To address this, configure the availability group to specify which availability replicas where you would prefer backups to be performed.</p>
<p>If you choose backup preferences as <strong>secondary only</strong> then you can create jobs on only secondary replicas or if you choose to run it on <strong>primary replica</strong>, then you can configure it on primary replica only. But if you decided to go with default option that is <strong>preferred secondary</strong> then you should schedule backup jobs on all replicas.  Although, Microsoft suggests to create scripted backup-jobs for every availability database on every server instance that hosts an availability replica that is a candidate for performing backups.</p>
<p>Suppose you have chosen <strong>secondary only</strong> preference and you have 3 secondary replicas then question might arise how database engine will decide that on which replica backup should run. Database engine decides where should run backup based on <strong>preferred backup replica</strong> settings and <strong>backup priority</strong> settings. I have explained about these settings later in this article.</p>
<p>AOAG (AlwaysOn Availability group) has a function named <strong>sys.fn_hadr_backup_is_preferred_replica</strong>  to determine which replica is set as preferred backup replica.  If the out of this function returns 1 it means current instance is the preferred backup replica and backup will run on this instance. If returns 0, it means backup will not run on that replica.  We can use this function in a backup script to determine job should run on which replica, so only one of the scheduled jobs actually proceeds to the backup stage.</p>
<p>In the event of a failover, none of the scripts or jobs needs to be modified. Also, if you reconfigure an availability group to add an availability replica, managing the backup job requires simply copying or scheduling the backup job. If you remove an availability replica, simply delete the backup job from the server instance that hosted that replica. Microsoft has given a sample code logic for this function that can be used to develop backup script.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span style="color: #0000ff;">If sys.fn_hadr_backup_is_preferred_replica( @dbname ) &lt;&gt; 1
BEGIN</span>
<span style="color: #008000;">-- If this is not the preferred replica, exit (probably without error).</span>
<span style="color: #0000ff;">END</span>
<span style="color: #008000;">-- If this is the preferred replica, continue to do the backup.
</span></strong></pre>
<p>If you use the Maintenance Plan Wizard to create a given backup job, the job will automatically include the scripting logic that calls and checks the <strong>sys.fn_hadr_backup_is_preferred_replica</strong> function.</p>
<p>If you want to check the preferred backup replica for any availability database, you can get it by running below command. If the output of this function returns 1 it means current instance is the preferred backup replica and backup will run on this instance. If returns 0, it means backup will not run on that replica.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span style="color: #008000;">--Get the backup preference replica for availability database TechYaz.</span>
<span style="color: #0000ff;">SELECT sys.fn_hadr_backup_is_preferred_replica ('TechYaz');
GO
</span></strong></pre>
<p>I have executed same function on my secondary replica. You can see the output is showing as 1, it means this replica is set to run backups.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-944" src="http://techyaz.com/wp-content/uploads/2017/09/1-backup-replica.jpg" alt="Get preferred backup replica" width="461" height="172" srcset="https://techyaz.com/wp-content/uploads/2017/09/1-backup-replica.jpg 461w, https://techyaz.com/wp-content/uploads/2017/09/1-backup-replica-300x112.jpg 300w" sizes="auto, (max-width: 461px) 100vw, 461px" /></p>
<h5><span style="color: #000080;">Configure Backup of Availability Databases to Run only from Secondary Replicas using GUI</span></h5>
<ol>
<li>Connect to the server instance that hosts the primary replica, and click the server name to expand the server tree. You would not be able to change Backup Preferences from any secondary replicas. If you open the AOAG name property, you will find all options greyed out.</li>
<li>Expand the <strong>Alwayson High Availability </strong>node and the <strong>Availability Groups</strong></li>
<li>Click the availability group whose backup preferences you want to configure, and select the <strong>Properties.</strong></li>
<li>In the <strong>Availability Group Properties </strong>dialog box, select <strong>Backup Preferences</strong> You can see backup preference is set to <strong>Prefer Secondary</strong>, now we need to change it to <strong>Secondary only </strong>option<strong>.</strong> The details about each type of backup preference is given in the screenshot and AOAG backup preference property window.</li>
</ol>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-946" src="http://techyaz.com/wp-content/uploads/2017/09/3-AOAG-property-from-Primary.jpg" alt="AOAG Property Window" width="705" height="637" srcset="https://techyaz.com/wp-content/uploads/2017/09/3-AOAG-property-from-Primary.jpg 705w, https://techyaz.com/wp-content/uploads/2017/09/3-AOAG-property-from-Primary-300x271.jpg 300w" sizes="auto, (max-width: 705px) 100vw, 705px" /></p>
<ol start="5">
<li>There are 4 backup preferences in AOAG that are given below with their capabilities. Choose any as per your requirements. Now I will add one more replica to this availability group as per our requirement and set backup preference to secondary only so that backups always run from either of the both secondary replicas. It is not mandatory for you to add additional replica.</li>
</ol>

<table id="tablepress-3" class="tablepress tablepress-id-3">
<thead>
<tr class="row-1">
	<th class="column-1">Backup Preference</th><th class="column-2">Backup Runs on</th><th class="column-3">Remarks</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">Prefer Secondary</td><td class="column-2">Secondary Replica</td><td class="column-3">Default Option. You cannot run differential backup in this option. If only Primary Replica is online, backup will run on Primary Replica.</td>
</tr>
<tr class="row-3">
	<td class="column-1">Secondary only</td><td class="column-2">Only Secondary Replicas</td><td class="column-3">Backup will never run on Primary Replica. If only Primary Replica is online, backup will not run. You cannot run differential backup in this option as well.</td>
</tr>
<tr class="row-4">
	<td class="column-1">Primary</td><td class="column-2">Primary Replica</td><td class="column-3">Choose this option if you want to run differential backup.</td>
</tr>
<tr class="row-5">
	<td class="column-1">Any Replica</td><td class="column-2">Can run on any replica based on backup priority of each availability replica in combination with its operational state and connected state.</td><td class="column-3">Set backup priority carefully between replicas.</td>
</tr>
</tbody>
</table>
<!-- #tablepress-3 from cache -->
<ol start="6">
<li>Use the <strong>Replica backup priorities</strong> grid to change the <strong>backup priority</strong> of the availability replicas. <strong>Backup Priority</strong> (Lowest=1, Highest=100) specifies your priority for performing backups on this replica relative to the other replicas in the same availability group. In my case backup will run on the replica that has priority 60% and if this will not be available then backup will run on the replica that has priority of 50%. Backup will never run on primary replica irrespective of backup priority settings because we have chosen to run backups only on secondary replica.<br />
<img loading="lazy" decoding="async" class="aligncenter size-full wp-image-947" src="http://techyaz.com/wp-content/uploads/2017/09/4-AOAG-property-from-Primary.jpg" alt="Availability group property Window" width="701" height="635" srcset="https://techyaz.com/wp-content/uploads/2017/09/4-AOAG-property-from-Primary.jpg 701w, https://techyaz.com/wp-content/uploads/2017/09/4-AOAG-property-from-Primary-300x272.jpg 300w" sizes="auto, (max-width: 701px) 100vw, 701px" /><br />
We have also an option Exclude Replica to exclude any replica where you don’t want to run backups. This is useful for remote availability replicas to which you never want to run backups there.<br />
You should click on checkbox for your respective replica name for which you want to exclude the backup as shown in above screenshot.</li>
</ol>
<ol start="7">
<li>Click on OK button to apply the changes.</li>
</ol>
<h5><span style="color: #000080;">Configure SQL Server Backup in AOAG to Run with default backup preference using T-SQL</span></h5>
<p>I have shown you how to change backup preference setting to run backups from secondary replicas using GUI. We can do the same using T-SQL commands as well. Here i will show you how to change backup preference using T-SQL. As we have changed the backup preference to secondary only option where backups will never run from primary replica. Now we can revert this change to default option using T-SQL. <strong>Prefer Secondary</strong> is default option in which backups run from secondary replica and if only primary replica is online then it will run from primary replica only.</p>
<p>Connect to the server instance that hosts the primary replica and run below command.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span style="color: #008000;">--Choose backup preference as per your choice and pass that value in AUTOMATED_BACKUP_PREFERENCE = { PRIMARY | SECONDARY_ONLY| SECONDARY | NONE }</span>
<span style="color: #0000ff;">ALTER AVAILABILITY GROUP AG_AOAGName SET (AUTOMATED_BACKUP_PREFERENCE = SECONDARY)
GO
</span></strong></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-948" src="http://techyaz.com/wp-content/uploads/2017/09/5-t-sql.jpg" alt="Change backup preference using T-sql" width="606" height="151" srcset="https://techyaz.com/wp-content/uploads/2017/09/5-t-sql.jpg 606w, https://techyaz.com/wp-content/uploads/2017/09/5-t-sql-300x75.jpg 300w" sizes="auto, (max-width: 606px) 100vw, 606px" /></p>
<p>Now your backup preference would be set to <strong>Prefer Secondary</strong> and backups will run from primary replica if only primary replica will be online.</p>
<p><em><span style="color: #800000;"><strong>Related Articles:</strong></span></em></p>
<ul>
<li><span style="color: #0000ff;"><strong><a style="color: #0000ff;" href="https://techyaz.com/sql-server/troubleshooting/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/" target="_blank" rel="noopener">Fix: Secondary Replica Stucked in to Resolving state</a></strong></span></li>
<li><span style="color: #0000ff;"><strong><a style="color: #0000ff;" href="https://techyaz.com/sql-server/troubleshooting/fixing-sap-connectivity-issue-aoag-automatic-failover/" target="_blank" rel="noopener">Fix: Connectivity Issue after AOAG Automatic Failover</a></strong></span></li>
<li><span style="color: #0000ff;"><strong><a style="color: #0000ff;" href="https://techyaz.com/sql-server/understanding-sql-server-recovery-model/" target="_blank" rel="noopener">Understanding SQL Server Recovery Models</a></strong></span></li>
<li><span style="color: #0000ff;"><strong><a style="color: #0000ff;" href="https://techyaz.com/sql-server/troubleshooting/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/" target="_blank" rel="noopener">Fix: Listener Issue Error 19471</a></strong></span></li>
</ul>
<p>I hope you like this article. Please follow us on our <a href="https://www.facebook.com/Techyaz/">facebook page</a> and on <a href="https://twitter.com/Tech_yaz">Twitter </a>handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/understanding-sql-server-backup-databases-availability-group/">Understanding Backup Preferences for AlwaysOn Availability Group Databases</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/understanding-sql-server-backup-databases-availability-group/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix SQL Server Error 976: Cannot connect to Secondary Replica of AlwaysON Availability Group</title>
		<link>https://techyaz.com/sql-server/alwayson/fix-error-976/</link>
					<comments>https://techyaz.com/sql-server/alwayson/fix-error-976/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Wed, 13 Sep 2017 10:00:51 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[Database Mirroring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Administration]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[Connection Issue]]></category>
		<category><![CDATA[connectivity Issue]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[logins]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=883</guid>

					<description><![CDATA[<p>Today an application user has reported that he is not able to connect to the secondary replica of AlwaysOn Availability Group configuration. The details about error Microsoft SQL Server 976 that he was getting is given below. Cannot connect to&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fix-error-976/">Fix SQL Server Error 976: Cannot connect to Secondary Replica of AlwaysON Availability Group</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Today an application user has reported that he is not able to connect to the secondary replica of <a href="https://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">AlwaysOn Availability Group</a> configuration. The details about error Microsoft SQL Server 976 that he was getting is given below.</p>
<p><span style="color: #ff0000;"><strong><em>Cannot connect to &#8216;Secondary Replica Server&#8217;.<br />
ADDITIONAL INFORMATION:<br />
</em></strong><em>The target database, &#8216;SDGC&#8217;, is participating in an availability group and is currently not accessible for queries. Either data movement is suspended or the availability replica is not enabled for read access. To allow read-only access to this and other databases in the availability group, enable read access to one or more secondary availability replicas in the group.  For more information, see the ALTER AVAILABILITY GROUP statement in SQL Server Books Online. (Microsoft SQL Server, Error: 976)</em></span></p>
<p>The screenshot of this error is given below.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-884" src="http://techyaz.com/wp-content/uploads/2017/09/1-Error-976.jpg" alt="Error 976" width="614" height="326" srcset="https://techyaz.com/wp-content/uploads/2017/09/1-Error-976.jpg 614w, https://techyaz.com/wp-content/uploads/2017/09/1-Error-976-300x159.jpg 300w" sizes="auto, (max-width: 614px) 100vw, 614px" /></p>
<h3><span style="color: #000080;">Solution</span></h3>
<p>Before going ahead let me give you a background about SQL Server configurations.</p>
<ul>
<li>We have <strong>two SQL Servers Server A &amp; Server B</strong> and there is an user database <strong>SDGC</strong> is hosted on both SQL Server Instances.</li>
<li><strong>AOAG</strong> is configured between both servers in <strong>Automatic failover</strong> mode for database <strong>SDGC</strong>.</li>
<li>Availability database <strong>SDGC </strong>hosted on instance B is <strong>inaccessible</strong> because it was restored in <strong>no recovery mode</strong> and not set in read only mode for AOAG configuration.</li>
<li>User&#8217;s login was created on both SQL Server instances with having default database as <strong>SDGC</strong> that are participating in AOAG.</li>
</ul>
<p>Now, the problem is whenever user tries to connect to the secondary replica whether AOAG is active from instance A or instance B, he is not able to connect to the SQL Server Instance and getting given SQL Server error 976. I analyzed this issue and found two solutions to fix this issue:</p>
<ul>
<li>Change <strong>Connect to database</strong> value in SSMS while establishing the connection.</li>
<li>Change <strong>default database </strong>value of your Login in Login Property window.</li>
</ul>
<p><span style="color: #800000;"><strong>Change Connect to database value in SSMS</strong></span></p>
<p>Launch <strong>SQL Server Management Studio</strong>. Click on <strong>Options</strong> tab of connection details window in SSMS as shown in below image.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-885" src="http://techyaz.com/wp-content/uploads/2017/09/2-connect-using-different-user-Copy.jpg" alt="click on connect button in SSMS" width="397" height="290" srcset="https://techyaz.com/wp-content/uploads/2017/09/2-connect-using-different-user-Copy.jpg 397w, https://techyaz.com/wp-content/uploads/2017/09/2-connect-using-different-user-Copy-300x219.jpg 300w" sizes="auto, (max-width: 397px) 100vw, 397px" /></p>
<p>You can see, <strong>Connect to database</strong> value showing as <strong>default</strong> that means it is connecting to the database that is set as <strong>default database</strong> for user&#8217;s login. Remember, <strong>default database</strong> for user&#8217;s login is set as <strong>SDGC</strong> that is running in <strong>norecovery mode</strong>.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-886" src="http://techyaz.com/wp-content/uploads/2017/09/3.0-connect-default-db.jpg" alt="connect to database in ssms" width="374" height="436" srcset="https://techyaz.com/wp-content/uploads/2017/09/3.0-connect-default-db.jpg 374w, https://techyaz.com/wp-content/uploads/2017/09/3.0-connect-default-db-257x300.jpg 257w" sizes="auto, (max-width: 374px) 100vw, 374px" /></p>
<p>Now, we just need to change the <strong>connect to database</strong> value from <strong>default</strong> to <strong>master</strong> or some other database. As <strong>default database</strong> for user&#8217;s login was set to SDGC, so change it master to make database engine to read an accessible database.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-887" src="http://techyaz.com/wp-content/uploads/2017/09/3.5-Change-default-db.jpg" alt="Change connect to database to master in ssms" width="374" height="436" srcset="https://techyaz.com/wp-content/uploads/2017/09/3.5-Change-default-db.jpg 374w, https://techyaz.com/wp-content/uploads/2017/09/3.5-Change-default-db-257x300.jpg 257w" sizes="auto, (max-width: 374px) 100vw, 374px" /></p>
<p>Once you make changes, hit the connect button and establish a database connection. This time you will be able to establish database connection to secondary replica.</p>
<p><span style="color: #800000;"><strong>Change default database value of your Login</strong></span></p>
<p>If <strong>default database</strong> of your login is <strong>not mandatory</strong> to set to <strong>availability database</strong> then you can change it to master and remove this issue permanently. Otherwise, you need to change default database every time you make a connection to secondary replica as discussed in above section.<br />
You can connect to your <strong>secondary replica</strong> or to the server where you are facing this issue using <strong>different admin or security admin account</strong>. If you have such account and password, you don&#8217;t need to logoff and relogin. You can just <strong>right click on SSMS icon</strong> while <strong>pressing SHIFT button</strong> to logged in using different user to the SQL Server instance. You can see that option in below image.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-888" src="http://techyaz.com/wp-content/uploads/2017/09/4-connect-using-different-user.jpg" alt="login using different account" width="451" height="355" srcset="https://techyaz.com/wp-content/uploads/2017/09/4-connect-using-different-user.jpg 451w, https://techyaz.com/wp-content/uploads/2017/09/4-connect-using-different-user-300x236.jpg 300w" sizes="auto, (max-width: 451px) 100vw, 451px" /></p>
<p>Click on &#8220;<strong>Run as different user</strong>&#8221; option. It will display below login screen to enter your new login and password. Enter the credentials.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-889" src="http://techyaz.com/wp-content/uploads/2017/09/5-connect-different-user.jpg" alt="Enter Credentials" width="382" height="329" srcset="https://techyaz.com/wp-content/uploads/2017/09/5-connect-different-user.jpg 382w, https://techyaz.com/wp-content/uploads/2017/09/5-connect-different-user-300x258.jpg 300w" sizes="auto, (max-width: 382px) 100vw, 382px" /></p>
<p>Once your new account will be authenticated, SSMS will be launched and show you the details as shown in below image. Click on <strong>Connect</strong> button to establish the connection.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-890" src="http://techyaz.com/wp-content/uploads/2017/09/6-connect-using-different-user.jpg" alt="connect using different account in ssms" width="397" height="290" srcset="https://techyaz.com/wp-content/uploads/2017/09/6-connect-using-different-user.jpg 397w, https://techyaz.com/wp-content/uploads/2017/09/6-connect-using-different-user-300x219.jpg 300w" sizes="auto, (max-width: 397px) 100vw, 397px" /></p>
<p>Expand <strong>Security</strong> folder. <strong>Identify</strong> your login for which you have to change the default database setting. <strong>Right click</strong> and choose <strong>properties</strong> on this login to launch properties window. You can <strong>double click</strong> on this login as well to launch this properties window. Below window will come to your screen where you can see the default database set for this login.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-891" src="http://techyaz.com/wp-content/uploads/2017/09/7-login.jpg" alt="login property" width="625" height="559" srcset="https://techyaz.com/wp-content/uploads/2017/09/7-login.jpg 625w, https://techyaz.com/wp-content/uploads/2017/09/7-login-300x268.jpg 300w" sizes="auto, (max-width: 625px) 100vw, 625px" /></p>
<p>You can see <strong>default database</strong> is set as <strong>SDGC</strong> in above screenshot. Now we need to <strong>change</strong> it to <strong>master</strong> or any accessible database. Do the changes, you can see i have changed it to master in our screenshot. Once you make changes, click on <strong>Ok</strong> button to proceed.</p>
<p><strong>NOTE:</strong> <em>If you need to change default database back to availability database due to some application dependencies then you need to first make your availability database accessible. You can perform failover to make secondary replica as primary then you can make changes and then you can failback. If you don&#8217;t want to perform failover/failback, then you can do this by changing the availability database from norecovery to read only mode.</em></p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-892" src="http://techyaz.com/wp-content/uploads/2017/09/8-login.jpg" alt="login property" width="621" height="547" srcset="https://techyaz.com/wp-content/uploads/2017/09/8-login.jpg 621w, https://techyaz.com/wp-content/uploads/2017/09/8-login-300x264.jpg 300w" sizes="auto, (max-width: 621px) 100vw, 621px" /></p>
<p>Now your <strong>issue is fixed. </strong>You would be able to connect to the SQL Server Instance that are running as secondary replica in AOAG configuration.  You can see, i have connected to secondary replica using same account with whom i was facing issue.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-893" src="http://techyaz.com/wp-content/uploads/2017/09/9-connect-using-samelogin.jpg" alt="" width="419" height="452" srcset="https://techyaz.com/wp-content/uploads/2017/09/9-connect-using-samelogin.jpg 419w, https://techyaz.com/wp-content/uploads/2017/09/9-connect-using-samelogin-278x300.jpg 278w" sizes="auto, (max-width: 419px) 100vw, 419px" /></p>
<p><span style="color: #800000;"><em><strong>Related Articles:</strong></em></span></p>
<ul>
<li style="list-style-type: none;">
<ul>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/" target="_blank" rel="noopener">Fix Error 19471: Listener Issue during Configuring AOAG</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fixing-sap-connectivity-issue-aoag-automatic-failover/" target="_blank" rel="noopener">How to Fix SAP connectivity issue after AOAG failover</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/" target="_blank" rel="noopener">Fix: Secondary Replica is showing in Resolving state</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/fix-error-15141-server-principal-owns-one-endpoints-cannot-dropped/" target="_blank" rel="noopener">Fix SQL Server Error 15141: Server Principal owns one or more endpoints</a></strong></li>
</ul>
</li>
</ul>
<p>Please comment us to give your feedback. I hope you like this article. Please follow us on our <a href="https://www.facebook.com/Techyaz/">facebook page</a> and on <a href="https://twitter.com/Tech_yaz">Twitter </a>handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fix-error-976/">Fix SQL Server Error 976: Cannot connect to Secondary Replica of AlwaysON Availability Group</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/fix-error-976/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix SQL Server Error 19471: Listener issue that came during Configuring SQL Server AlwaysOn Availability Group</title>
		<link>https://techyaz.com/sql-server/alwayson/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/</link>
					<comments>https://techyaz.com/sql-server/alwayson/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/#comments</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Mon, 11 Sep 2017 11:02:43 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[Clustering]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[AOAG Listener]]></category>
		<category><![CDATA[HADR]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[Listener Issue]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=840</guid>

					<description><![CDATA[<p>I had an AOAG configuration between two replicas that i have deleted in order to perform some activities. I was configuring Always On Availability Group again on this database server. We followed all processes but Listener was failed to create&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/">Fix SQL Server Error 19471: Listener issue that came during Configuring SQL Server AlwaysOn Availability Group</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I had an <a href="http://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">AOAG configuration</a> between two replicas that i have deleted in order to perform some activities. I was configuring Always On Availability Group again on this database server. We followed all processes but Listener was failed to create during AOAG configuration and displayed Microsoft SQL Server error 19471.</p>
<p>I have also explained another aspect of this error in attached article. If your issue is not fixed using this article, you can have a look at this one where i got the same <a href="http://techyaz.com/sql-server/alwayson/fix-aoag-listener-error-19471-kerberos-status-showing-handle-invalid/" target="_blank" rel="noopener">Listener Error 19471 because Kerberos Status was showing &#8216;The handle is invalid&#8217;</a>.</p>
<h5><span style="color: #000080;">Microsoft SQL Server Error 19471: Create failed for Availability Group Listener &#8216;Listener Name&#8217;.</span></h5>
<p>AOAG Listener was failed to create during its configuration and displayed SQL Server error 19471. This error might have multiple reasons. Here i will fix this issue in step by step manner. The full error details are given below.</p>
<div class="codediv"><strong><span class="kwrd" style="color: red;"><em>Creating availability group listener resulted in an error.</em><br />
<em> ADDITIONAL INFORMATION:</em><br />
<em> Create failed for Availability Group Listener &#8216;U********0&#8217;. (Microsoft.SqlServer.Smo)</em><br />
<em> An exception occurred while executing a Transact-SQL statement or batch.</em><br />
<em> The WSFC cluster could not bring the Network Name resource with DNS name &#8216;<span class="kwrd">U*********0</span>&#8216; online. The DNS name may have been taken or have a conflict with existing name services, or the WSFC cluster service may not be running or may be inaccessible. Use a different DNS name to resolve name conflicts, or check the WSFC cluster log for more information.</em><br />
<em> The attempt to create the network name and IP address for the listener failed. The WSFC service may not be running or may be inaccessible in its current state, or the values provided for the network name and IP address may be incorrect. Check the state of the WSFC cluster and validate the network name and IP address with the network administrator. (Microsoft SQL Server, Error: 19471)</em><br />
</span></strong></div>
<p>The screenshot of this error is given below.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-841" src="http://techyaz.com/wp-content/uploads/2017/09/1-AOAG-listener-issue-1024x426.jpg" alt="error 19471" width="1024" height="426" srcset="https://techyaz.com/wp-content/uploads/2017/09/1-AOAG-listener-issue-1024x426.jpg 1024w, https://techyaz.com/wp-content/uploads/2017/09/1-AOAG-listener-issue-300x125.jpg 300w, https://techyaz.com/wp-content/uploads/2017/09/1-AOAG-listener-issue-768x319.jpg 768w, https://techyaz.com/wp-content/uploads/2017/09/1-AOAG-listener-issue.jpg 1335w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><br />
When i checked the AlwaysOn High Availability folder on any of the replica, everything was working fine. AOAG was configured successfully and working fine but listener was not configured due to above error. You can see this in below screenshot.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-842" src="http://techyaz.com/wp-content/uploads/2017/09/2-AOAG-listener-SSMS.jpg" alt="AOAG Listener post error" width="722" height="404" srcset="https://techyaz.com/wp-content/uploads/2017/09/2-AOAG-listener-SSMS.jpg 722w, https://techyaz.com/wp-content/uploads/2017/09/2-AOAG-listener-SSMS-300x168.jpg 300w" sizes="auto, (max-width: 722px) 100vw, 722px" /></p>
<p>You can see there is no listener showing in their respective folder of the AOAG configuration in above screenshot. I tried creating Listener name from &#8220;<strong>Add Listener&#8230;</strong>&#8221; wizard but failed with same error. Let&#8217;s move to next section where we will fix this error.</p>
<h5><span style="color: #000080;">Solution</span></h5>
<p>I did some research on this error code and found a solution suggested by Microsoft in attached <a href="https://blogs.msdn.microsoft.com/alwaysonpro/2013/10/30/create-availability-group-listener-fails-with-message-19471-the-wsfc-cluster-could-not-bring-the-network-name-resource-online/" target="_blank" rel="noopener">MSDN article</a>. I followed step by step process given in this article. High level approach to fix this solution using this method is given below.</p>
<ul>
<li>Create a <strong>Client Access Point (CAP)</strong> for the AOAG <strong>listener</strong> in <strong>Failover Cluster Manager</strong>.</li>
<li>Bring CAP <strong>Online</strong>.</li>
<li><strong>Repair</strong> the CAP, if it is not coming ONLINE.</li>
<li>Once CAP comes online, <strong>remove</strong> it from failover cluster manager.</li>
<li><strong>Add listener</strong> to AOAG in SSMS.</li>
</ul>
<p>You might have a question why we are removing CAP after adding, repairing and bring it online. Creating CAP and bringing it online is to just verify that everything is ok or not. If CAP will not come online then there might be some issue at certain level that needs to be fixed first before creating listener. Let&#8217;s go ahead with above given steps to fix this issue.</p>
<p>I launched <strong>failover cluster manager</strong> and clicked on <strong>Roles</strong> tab from left side pane. Here you can see your <strong>availability group role</strong> in right side pane. Right click on this role and select &#8220;<strong>Add Resources</strong>&#8221; then click on &#8220;<strong>Client Access Point</strong>&#8220;.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-843" src="http://techyaz.com/wp-content/uploads/2017/09/3-client-access-point-FCM.jpg" alt="client access point" width="785" height="501" srcset="https://techyaz.com/wp-content/uploads/2017/09/3-client-access-point-FCM.jpg 785w, https://techyaz.com/wp-content/uploads/2017/09/3-client-access-point-FCM-300x191.jpg 300w, https://techyaz.com/wp-content/uploads/2017/09/3-client-access-point-FCM-768x490.jpg 768w" sizes="auto, (max-width: 785px) 100vw, 785px" /></p>
<p>You will get below screen to enter listener details. I entered listener name into name section and listener IP in to Address section. Once i clicked at Next button to proceed. I got below error which says this<strong> listener is already in use in Active Directory</strong>.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-844" src="http://techyaz.com/wp-content/uploads/2017/09/4-client-access-point-FCM.jpg" alt="Client Access Point Wizard" width="695" height="493" srcset="https://techyaz.com/wp-content/uploads/2017/09/4-client-access-point-FCM.jpg 695w, https://techyaz.com/wp-content/uploads/2017/09/4-client-access-point-FCM-300x213.jpg 300w" sizes="auto, (max-width: 695px) 100vw, 695px" /></p>
<p>As we know, listener name and IP should be unique and unused so here we need to remove this listener details from Active Directory. Contact your domain administrator and tell him to remove the entries for this listener name and IP.</p>
<p><strong>Once listener details will be cleared from Active Directory, go ahead and try to add listener name to the existing AlwaysOn Availability Group</strong>. This time you would be able to create the listener name. If you are still facing some issue, then we will follow remaining steps of the above suggested MSDN article. Read next section to follow remaining steps to fix this issue.</p>
<h5><span style="color: #000080;">Failed to add Listener after clearing DNS entries and DNS Status showing The handle is invalid</span></h5>
<p>If you are still facing same issue during adding listener or configuring AlwaysOn Availability Group then you can again ask your domain admin to relook into Active Directory because there is a possibility of some entries in AD for the listener name and IP during your failed attempts to create the listen name. If domain admin will not find any entry then we will proceed with the steps that Microsoft has suggested in above attached article.</p>
<p>We will create <strong>Client Access Point</strong> in failover cluster manager for Availability Group role as we were trying to create in above section. Right click on Availability Group role and select &#8220;Add Resources&#8221; then &#8220;Client Access Point&#8221; as shown in image no 3. You will get below screen to enter listener name and corresponding IP address in highlighted sections. Click on Next button to proceed post entering the listener details.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-845" src="http://techyaz.com/wp-content/uploads/2017/09/5-CAP.jpg" alt="client access point wizard" width="687" height="481" srcset="https://techyaz.com/wp-content/uploads/2017/09/5-CAP.jpg 687w, https://techyaz.com/wp-content/uploads/2017/09/5-CAP-300x210.jpg 300w" sizes="auto, (max-width: 687px) 100vw, 687px" /></p>
<p>You will get below screen to proceed once you click on next button of above screen.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-846" src="http://techyaz.com/wp-content/uploads/2017/09/6-CAP.jpg" alt="client access point wizard" width="691" height="481" srcset="https://techyaz.com/wp-content/uploads/2017/09/6-CAP.jpg 691w, https://techyaz.com/wp-content/uploads/2017/09/6-CAP-300x209.jpg 300w" sizes="auto, (max-width: 691px) 100vw, 691px" /></p>
<p>Click on Finish button to create the Client Access Point in failover cluster manager for this listener.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-847" src="http://techyaz.com/wp-content/uploads/2017/09/7-CAP.jpg" alt="client access point wizard" width="683" height="475" srcset="https://techyaz.com/wp-content/uploads/2017/09/7-CAP.jpg 683w, https://techyaz.com/wp-content/uploads/2017/09/7-CAP-300x209.jpg 300w" sizes="auto, (max-width: 683px) 100vw, 683px" /></p>
<p>Once you will click on finish button, your Client Access Point for your listener will be created in the failover cluster manager as shown in below screen. Availability Group role was running fine but after adding Client Access Point it has changed into <strong>Partial Running</strong> mode.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-848" src="http://techyaz.com/wp-content/uploads/2017/09/8-CAP-FCM.jpg" alt="CAP in FCM" width="684" height="433" srcset="https://techyaz.com/wp-content/uploads/2017/09/8-CAP-FCM.jpg 684w, https://techyaz.com/wp-content/uploads/2017/09/8-CAP-FCM-300x190.jpg 300w" sizes="auto, (max-width: 684px) 100vw, 684px" /></p>
<p>We can see CAP is showing as offline in above image. That is the reason Availability Group role has changed into Partial Running mode. Now we will bring it online manually. <strong>Right click</strong> on Listener CAP and click on &#8220;<strong>Bring Online</strong>&#8221; option.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-849" src="http://techyaz.com/wp-content/uploads/2017/09/9-CAP-Online.jpg" alt="Bring CAP online" width="591" height="235" srcset="https://techyaz.com/wp-content/uploads/2017/09/9-CAP-Online.jpg 591w, https://techyaz.com/wp-content/uploads/2017/09/9-CAP-Online-300x119.jpg 300w" sizes="auto, (max-width: 591px) 100vw, 591px" /></p>
<p>We can see Listener IP has come online whereas listener name is failed to come online. Now we will check the properties of the client access point (CAP).</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-850" src="http://techyaz.com/wp-content/uploads/2017/09/10-CAP-online.jpg" alt="CAP online" width="477" height="209" srcset="https://techyaz.com/wp-content/uploads/2017/09/10-CAP-online.jpg 477w, https://techyaz.com/wp-content/uploads/2017/09/10-CAP-online-300x131.jpg 300w" sizes="auto, (max-width: 477px) 100vw, 477px" /></p>
<p><strong>Right click</strong> on Listener Name and choose <strong>Properties</strong> option. You will get below screen where you can see <strong>NetBIOS, DNS and Kerberos status</strong>. <strong>NetBIOS</strong> and <strong>Kerberos</strong> <strong>status</strong> is showing OK but <strong>DNS status</strong> is not ok and showing &#8220;<strong>The handle is invalid.</strong>&#8221; This is the issue that needs to be fixed to create listener.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-851" src="http://techyaz.com/wp-content/uploads/2017/09/11-CAP-property.jpg" alt="Client Access Point Property" width="418" height="499" srcset="https://techyaz.com/wp-content/uploads/2017/09/11-CAP-property.jpg 418w, https://techyaz.com/wp-content/uploads/2017/09/11-CAP-property-251x300.jpg 251w" sizes="auto, (max-width: 418px) 100vw, 418px" /></p>
<p>When i checked the cluster events, i saw below error details that are also very much same.</p>
<p><span style="color: #ff0000;"><strong><em>Cluster network name resource &#8216;Cluster Name&#8217; failed registration of one or more associated DNS name(s) for the following reason:</em></strong></span><br />
<span style="color: #ff0000;"><strong><em> The handle is invalid.</em></strong></span><br />
<span style="color: #ff0000;"><strong><em> Ensure that the network adapters associated with dependent IP address resources are configured with at least one accessible DNS server.</em></strong></span></p>
<p><strong>To fix</strong> this DNS issue ( <strong>The handle is invalid</strong> ) we will <strong>repair</strong> this CAP. <strong>Right click</strong> on Listener Name showing in failover cluster manager, click on &#8220;<strong>More Actions</strong>&#8221; and then click on<strong> Repair</strong> as per below image.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-852" src="http://techyaz.com/wp-content/uploads/2017/09/12-CAP-Repair.jpg" alt="CAP Repair" width="797" height="601" srcset="https://techyaz.com/wp-content/uploads/2017/09/12-CAP-Repair.jpg 797w, https://techyaz.com/wp-content/uploads/2017/09/12-CAP-Repair-300x226.jpg 300w, https://techyaz.com/wp-content/uploads/2017/09/12-CAP-Repair-768x579.jpg 768w" sizes="auto, (max-width: 797px) 100vw, 797px" /></p>
<p>Once you will click on <strong>Repair</strong>, it will come online and then go in offline. Now right click on Listener name again and click on <strong>Bring Online</strong> button. This time Listener Name will come online if CAP has been repaired successfully. You can repeat the repair exercise if your CAP is not coming online. If you are still facing issue then you can again contact to domain admin to look into Active Directory server.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-853" src="http://techyaz.com/wp-content/uploads/2017/09/13-CAP-Repair-Online.jpg" alt="CAP status after repair" width="587" height="405" srcset="https://techyaz.com/wp-content/uploads/2017/09/13-CAP-Repair-Online.jpg 587w, https://techyaz.com/wp-content/uploads/2017/09/13-CAP-Repair-Online-300x207.jpg 300w" sizes="auto, (max-width: 587px) 100vw, 587px" /></p>
<p>Now you can see Client Access Point for the listener is showing online now. if you go to the property of this Listener CAP, you can see <strong>NetBIOS, DNS</strong> and <strong>Kerberos status</strong> is showing OK.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-854" src="http://techyaz.com/wp-content/uploads/2017/09/14-CAP-Repair-Property.jpg" alt="Client Access Point Property post Repair" width="425" height="507" srcset="https://techyaz.com/wp-content/uploads/2017/09/14-CAP-Repair-Property.jpg 425w, https://techyaz.com/wp-content/uploads/2017/09/14-CAP-Repair-Property-251x300.jpg 251w" sizes="auto, (max-width: 425px) 100vw, 425px" /></p>
<p>Close above property window. Now DNS issue is resolved that was main culprit during listener creation so next step is to <strong>remove this Client Access Point</strong> for this Listener and create the listener in SSMS that will <strong>create Listener client access point (CAP) automatically in the failover cluster manager.</strong></p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-855" src="http://techyaz.com/wp-content/uploads/2017/09/15-CAP-removal.jpg" alt="Remove Client Access Ppoint" width="583" height="337" srcset="https://techyaz.com/wp-content/uploads/2017/09/15-CAP-removal.jpg 583w, https://techyaz.com/wp-content/uploads/2017/09/15-CAP-removal-300x173.jpg 300w" sizes="auto, (max-width: 583px) 100vw, 583px" /></p>
<p>Once you click on remove button below window will come to proceed. Click on ok to proceed.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-856" src="http://techyaz.com/wp-content/uploads/2017/09/16-CAP-Removal.jpg" alt="CAP removal" width="554" height="291" srcset="https://techyaz.com/wp-content/uploads/2017/09/16-CAP-Removal.jpg 554w, https://techyaz.com/wp-content/uploads/2017/09/16-CAP-Removal-300x158.jpg 300w" sizes="auto, (max-width: 554px) 100vw, 554px" /></p>
<p>Once this CAP will be removed then connect to primary replica of the AOAG configuration. Expand the <strong>AlwaysOn High Availability</strong> folder and then <strong>Availability Group Listeners</strong> folder. You will not be able to see anything as there is no listener as of now. <strong>Right click</strong> on <strong>Availability Group Listeners</strong> folder and click on &#8220;<strong>Add Listener&#8230;&#8221; </strong>option.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-857" src="http://techyaz.com/wp-content/uploads/2017/09/17-Add-Listener.jpg" alt="Add Listener in SSMS" width="389" height="455" srcset="https://techyaz.com/wp-content/uploads/2017/09/17-Add-Listener.jpg 389w, https://techyaz.com/wp-content/uploads/2017/09/17-Add-Listener-256x300.jpg 256w" sizes="auto, (max-width: 389px) 100vw, 389px" /></p>
<p>You will get below image (<strong>New Availability Group Listener Wizard</strong>) to enter the <strong>listener details</strong>. Enter the <strong>Listener DNS Name</strong> then <strong>port</strong> followed by choosing <strong>Network Mode</strong>. Click on <strong>Add</strong> button to enter <strong>Listener IP Address</strong>. Once you are done with all details. Click on Ok button to apply this changes. Add Listener wizard will disappear if listener will be created successfully otherwise it will give you the error on the same wizard.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-858" src="http://techyaz.com/wp-content/uploads/2017/09/18-Add-Listener.jpg" alt="Add listener" width="711" height="637" srcset="https://techyaz.com/wp-content/uploads/2017/09/18-Add-Listener.jpg 711w, https://techyaz.com/wp-content/uploads/2017/09/18-Add-Listener-300x269.jpg 300w" sizes="auto, (max-width: 711px) 100vw, 711px" /></p>
<p>As we have created <strong>Availability Group Listener</strong> for this AOAG configuration so you can go ahead and verify this in SSMS by expanding <strong>Availability Group Listeners</strong> folder. You can see same listener name is showing under Availability Group Listeners folder on both primary as well as secondary replica in below image.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-859" src="http://techyaz.com/wp-content/uploads/2017/09/19-Listener-Created.jpg" alt="Listener created successfully" width="728" height="404" srcset="https://techyaz.com/wp-content/uploads/2017/09/19-Listener-Created.jpg 728w, https://techyaz.com/wp-content/uploads/2017/09/19-Listener-Created-300x166.jpg 300w" sizes="auto, (max-width: 728px) 100vw, 728px" /></p>
<p><em><strong><span style="color: #800000;">Related Articles:</span></strong></em></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">Learn what is AlwaysOn Availability Group.</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/fix-aoag-listener-error-19471-kerberos-status-showing-handle-invalid/" target="_blank" rel="noopener">Fix Listener Error 19471 due to Kerberos Status&#8221;The handle is invalid&#8221;</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fixing-sap-connectivity-issue-aoag-automatic-failover/" target="_blank" rel="noopener">How to fix AlwaysOn Availability group Automatic Failover Issue</a>.</strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/" target="_blank" rel="noopener">Fix: Secondary Replica is showing in Resolving state and not becoming Primary</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/fix-error-15141-server-principal-owns-one-endpoints-cannot-dropped/" target="_blank" rel="noopener">How to fix error 15141: The server principal owns one or more endpoint(s) and cannot be dropped</a></strong></li>
</ul>
<p>I hope you like this article. Please follow us on our <a href="https://www.facebook.com/Techyaz/">facebook page</a> and on <a href="https://twitter.com/Tech_yaz">Twitter </a>handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/">Fix SQL Server Error 19471: Listener issue that came during Configuring SQL Server AlwaysOn Availability Group</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Fixing SAP Connectivity issue after AOAG Automatic failover</title>
		<link>https://techyaz.com/sql-server/alwayson/fixing-sap-connectivity-issue-aoag-automatic-failover/</link>
					<comments>https://techyaz.com/sql-server/alwayson/fixing-sap-connectivity-issue-aoag-automatic-failover/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Fri, 18 Aug 2017 19:46:24 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[connectivity Issue]]></category>
		<category><![CDATA[HADR]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[logins]]></category>
		<category><![CDATA[sap]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=550</guid>

					<description><![CDATA[<p>We have Alwayson Availability Group configuration for our SAP systems. We faced SAP connectivity issue when application team tried to do a failover/HA testing and connect to database post failover, they were failed to connect to the current primary replica&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fixing-sap-connectivity-issue-aoag-automatic-failover/">Fixing SAP Connectivity issue after AOAG Automatic failover</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>We have <span style="color: #333399;"><strong><a href="https://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">Alwayson Availability Group</a></strong></span> configuration for our SAP systems. We faced SAP connectivity issue when application team tried to do a failover/HA testing and connect to database post failover, they were failed to connect to the current primary replica which was secondary replica before failover.</p>
<h3><span style="color: #000080;"><strong>Automatic Failover Worked Well but Application failed to connect</strong></span></h3>
<p>I have an AOAG configuration with Automatic failover between two replicas in my environment.  Last week, we had High Availability testing for all applications. Everything was working fine if we were doing failover from Management Studio. Databases were failing over and failing back successfully.</p>
<p>Issue occurred when application team tried to connect to database server after failover. They were <span style="color: #333399;"><strong><a href="https://techyaz.com/sql-server/troubleshooting/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/" target="_blank" rel="noopener">failed to connect to the secondary replica after every failover</a></strong></span> but applications were working fine from primary replica. Below are the error details that are coming to application team during establishing database connection post failover to current primary replica (earlier secondary replica).</p>
<div class="codediv"><strong><span class="kwrd" style="color: red;">[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid object name &#8216;DBPROPERTIES&#8217;.<br />
[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid object name &#8216;SVERS&#8217;.<br />
</span></strong></div>
<p>When we saw at the database level, everything was working fine.<span style="color: #333399;"><strong> <a href="https://techyaz.com/sql-server/troubleshooting/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/" target="_blank" rel="noopener">Secondary replica was successfully transitioning as primary replica after failover</a></strong></span> and databases were accessible from failover node but application was not able to connect to this replica. We checked all respective logins associated with the application and everything was there on secondary replica.</p>
<p>One thing we have noticed during troubleshooting that SQL login was became orphaned after each failover and we did resolved orphaned user issue manually post each failover. But there is no benefit of automatic failover if you need to establish database connection manually after each failover.</p>
<p>After spending some time, we fixed this issue. Application was not able to connect to database post failover because one of the SQL login which was used by application has different SID on secondary replica than its primary replica. I recreated this login on secondary replica with same SID which was in primary replica and this has fixed the issue. Here, I will explain step by step method to make you understand the issue and its solution.</p>
<h3><span style="color: #000080;"><strong>Resync the SID from Primary Replica</strong></span></h3>
<p>First check the current configuration of this AOAG. Run below command to get the AOAG details. We can see the configuration is running into automatic failover mode along with replica names.</p>
<pre class="brush: sql; title: ; notranslate" title=""><span class="kwrd" style="color: blue;"><strong>SELECT replica_server_name, availability_mode_desc, failover_mode_desc
FROM sys.availability_replicas
</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-551" src="http://techyaz.com/wp-content/uploads/2017/08/1-AOAG-details.jpg" alt="AOAG details" width="697" height="221" srcset="https://techyaz.com/wp-content/uploads/2017/08/1-AOAG-details.jpg 697w, https://techyaz.com/wp-content/uploads/2017/08/1-AOAG-details-300x95.jpg 300w" sizes="auto, (max-width: 697px) 100vw, 697px" /></p>
<p>If you do failover between replicas then it will not throw any error in SSMS or database level. But if you will ask application team to connect to database server using Listener post failover, you will get error.</p>
<p>You will face error because SID of the login used by application is different on both replica servers. You can also get the error when the login used by application to establish database connection is not present on secondary replica. You need to sync the login, password and SID of this login to the secondary replica. Follow this tip to fix the issue that are coming due to any of the given reason.</p>
<p>The SID identifies the security context of the login and is unique within the server instance. If the login is created from a Windows user or group, it is given the Windows SID of the source principle; the Windows SID is unique within the domain. If the login is created as a legacy-style <strong>SQL Server login </strong>that requires a password, the server will generate a SID. Now check the SID of the login which is used to connect to database on primary replica.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span class="kwrd" style="color: green;">--Replace your identified login with xyz.</span><span class="kwrd" style="color: blue;">
select name,sid from syslogins
where name='xyz'
</span></strong></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-552" src="http://techyaz.com/wp-content/uploads/2017/08/2-check-sid.jpg" alt="check sid" width="394" height="185" srcset="https://techyaz.com/wp-content/uploads/2017/08/2-check-sid.jpg 394w, https://techyaz.com/wp-content/uploads/2017/08/2-check-sid-300x141.jpg 300w, https://techyaz.com/wp-content/uploads/2017/08/2-check-sid-520x245.jpg 520w, https://techyaz.com/wp-content/uploads/2017/08/2-check-sid-720x340.jpg 720w" sizes="auto, (max-width: 394px) 100vw, 394px" /></p>
<p>Now run same command on secondary replica. You can see SID is different on both replicas for same login. Ideally everything should be same and in sync with primary replica that are associated with AOAG.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-553" src="http://techyaz.com/wp-content/uploads/2017/08/3-check-sid.jpg" alt="check sid" width="361" height="198" srcset="https://techyaz.com/wp-content/uploads/2017/08/3-check-sid.jpg 361w, https://techyaz.com/wp-content/uploads/2017/08/3-check-sid-300x165.jpg 300w" sizes="auto, (max-width: 361px) 100vw, 361px" /></p>
<p>Now we need to delete this login from secondary replica and recreate it using same SID which is present on primary replica. Next, drop the login either using SSMS or T-SQL. SSMS way is given below:</p>
<ul>
<li>Connect to target SQL Server Instance.</li>
<li>Expand the security folder.</li>
<li>Expand the Logins folder.</li>
<li>Right click and choose delete on the identified login which needs to be deleted.</li>
<li>Click on Ok button of the login deletion window.</li>
</ul>
<p>If you want to drop this login using T-SQL command then open a query window and execute below command.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span class="kwrd" style="color: green;">--change the name of xyz with your login name which you want to delete.</span><span class="kwrd" style="color: blue;">
DROP Login 'xyz'
</span></strong></pre>
<p>You might get multiple dependency errors during dropping this login because there is possibility, this login might own few objects, agent jobs or databases on this instance. I got <span style="color: #333399;"><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-15170/" target="_blank" rel="noopener">Error 15170 during dropping this login</a> </strong></span>which i fixed in attached tip to remove this login. You can also read below articles if you are getting different kind of DROP Login failed issues:</p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-the-error-15174/" target="_blank" rel="noopener">How to fix Error 15174: Login owns one or more databases.</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-15173/" target="_blank" rel="noopener">How to fix Error 15173: Revoke the permissions before dropping the login.</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-15138-error-3729/" target="_blank" rel="noopener">How to fix error 15138 &amp; Error 3729: DROP login failed</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/fix-error-15141-server-principal-owns-one-endpoints-cannot-dropped/" target="_blank" rel="noopener">How to fix error 15141: The server principal owns one or more endpoint(s) and cannot be dropped</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-15434-not-drop-login-user-currently-logged/" target="_blank" rel="noopener">How to fix error 15434: Could not drop login as the user is currently logged in</a></strong></li>
</ul>
<p>Once login will be dropped, go ahead and create same login with same password and SID which are used on primary replica. Copy the SID from <strong>image 2</strong> when you check the SID for this login on primary replica and use that during CREATE Login statement. If you don&#8217;t have this login on secondary replica yet then also you can follow same process to create the login.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span class="kwrd" style="color: green;">--copy the SID from primary replica.</span><span class="kwrd" style="color: blue;">
CREATE Login xyz WITH password = 'password@123', CHECK_Policy=Off, SID = 0xC2Cabcdefghijk123hghj6C3
</span></strong></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-554" src="http://techyaz.com/wp-content/uploads/2017/08/4-create-login-sid.jpg" alt="create login" width="960" height="204" srcset="https://techyaz.com/wp-content/uploads/2017/08/4-create-login-sid.jpg 960w, https://techyaz.com/wp-content/uploads/2017/08/4-create-login-sid-300x64.jpg 300w, https://techyaz.com/wp-content/uploads/2017/08/4-create-login-sid-768x163.jpg 768w" sizes="auto, (max-width: 960px) 100vw, 960px" /></p>
<p>We can see command executed successfully. Now issue will be fixed if you don&#8217;t had this login on secondary replica and you just created it for very first time. But you might get orphaned user issue if you had this login earlier with different SID on this instance. Now we need to fix the orphaned users on the secondary replica.</p>
<h3><span style="color: #000080;"><strong>Fix Orphaned Users</strong></span></h3>
<p>Now you need to run below command to check the orphaned users on your database. Make sure that your database is working as primary otherwise you would not be able to run this command. You can failover and then run this command if database will become primary.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span class="kwrd" style="color: green;">--change the dbname</span><span class="kwrd" style="color: blue;">
USE DBNAME
Go
sp_change_users_login 'report'
</span></strong></pre>
<p>If you will get your user name which was mapped to the identified login then we need to fix this orphaned user. Run below command to fix this issue.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span class="kwrd" style="color: green;">--change the dbname
--Map database user xyz to login xyz.  </span></strong><span class="kwrd" style="color: blue;"><strong>
USE DBName;  
GO  
EXEC sp_change_users_login 'Update_One', 'xyz', 'xyz';  
GO </strong> 
</span></pre>
<p>Now orphaned user issue is also resolved and we have fixed the application connectivity issue that was reported after automatic failover of AOAG. You can do failover testing again to make sure application connectivity is working fine after AOAG failover.</p>
<p>I hope you like this article. Please follow us on our <strong><a href="https://www.facebook.com/Techyaz/">facebook page</a> </strong>and on<strong> <a href="https://twitter.com/Tech_yaz">Twitter </a></strong>handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/fixing-sap-connectivity-issue-aoag-automatic-failover/">Fixing SAP Connectivity issue after AOAG Automatic failover</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/fixing-sap-connectivity-issue-aoag-automatic-failover/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Why is Secondary Replica Showing in Resolving state after AOAG Automatic failover?</title>
		<link>https://techyaz.com/sql-server/alwayson/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/</link>
					<comments>https://techyaz.com/sql-server/alwayson/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/#comments</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Wed, 02 Aug 2017 15:29:46 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[Clustering]]></category>
		<category><![CDATA[HADR]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=341</guid>

					<description><![CDATA[<p>Sometimes AOAG configuration stuck in resolving state and its secondary Replica does not come online. When you check the Alwayson Availability Group configuration, you find it showing in resolving state after Automatic failover of AOAG Configuration. Let us get the&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/">Why is Secondary Replica Showing in Resolving state after AOAG Automatic failover?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes AOAG configuration stuck in resolving state and its secondary Replica does not come online. When you check the Alwayson Availability Group configuration, you find it showing in resolving state after Automatic failover of AOAG Configuration. Let us get the reason behind secondary replica stuck in resolving state and solution to overcome such issues in future.</p>
<h3><span style="color: #000080;"><strong>SQL Server AlwaysOn Availability Group</strong></span></h3>
<p><strong><a href="https://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">SQL Server AlwaysOn Availability Group</a></strong> is an advanced version of database mirroring and introduced in SQL Server 2012. AOAG is HA &amp; DR solution for SQL Server databases. We can group a bunch of databases as one Availability Group and failover/failback as one entity whereas it was not possible in database mirroring. Database Mirroring can be configured only for single database at a time. You can visit the attached link to learn more about <strong><a href="https://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">AlwaysOn Basics.</a></strong></p>
<p>I have also an AOAG configuration in my environment which is set for Automatic failover between both replicas. Last week, we faced an issue during automatic failover. Secondary replica was not transitioning as primary replica during an automatic failover and it was stuck in &#8220;Resolving&#8221; state. It was full down time for application because primary replica was lost and availability databases were not coming online on secondary replica.</p>
<p>I will explain step by step method to make you understand the issue and the fix.</p>
<h3><span style="color: #000080;"><strong>Automatic Failover Not Working and Secondary Replica Stuck in Resolving State</strong></span></h3>
<p>As secondary replica is not transitioning as primary replica after failover because secondary replica hung in resolving state so here, we will check the main root cause and its fix so that secondary replica comes online after every failover. Let&#8217;s check the current configuration of this AOAG. Run below command to get the AOAG details. We can see the configuration is running into automatic failover mode.</p>
<div class="codediv">
<pre><strong><span style="color: #0000ff;">SELECT replica_server_name, availability_mode, availability_mode_desc, failover_mode, failover_mode_desc
FROM sys.availability_replicas
</span></strong></pre>
</div>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-342" src="http://techyaz.com/wp-content/uploads/2017/08/1-check-AOAG-details.jpg" alt="Check AoAG details" width="1009" height="171" srcset="https://techyaz.com/wp-content/uploads/2017/08/1-check-AOAG-details.jpg 1009w, https://techyaz.com/wp-content/uploads/2017/08/1-check-AOAG-details-300x51.jpg 300w, https://techyaz.com/wp-content/uploads/2017/08/1-check-AOAG-details-768x130.jpg 768w" sizes="auto, (max-width: 1009px) 100vw, 1009px" /></p>
<p>Now connect to secondary replica in SQL Server Management Studio. Expand the AlwaysOn High Availability folder followed by Availability Group folder. Here, you can see the current state of this availability group which is showing in <em>Resolving</em> state.<br />
<img loading="lazy" decoding="async" class="aligncenter size-full wp-image-343" src="http://techyaz.com/wp-content/uploads/2017/08/2-secondary-replica-status-post-failover.jpg" alt="secondary replica status in resolving state post failover" width="463" height="317" srcset="https://techyaz.com/wp-content/uploads/2017/08/2-secondary-replica-status-post-failover.jpg 463w, https://techyaz.com/wp-content/uploads/2017/08/2-secondary-replica-status-post-failover-300x205.jpg 300w" sizes="auto, (max-width: 463px) 100vw, 463px" /></p>
<p>I checked the SQL Server error log file but i did not get enough information about this issue to proceed. I searched about this issue and got few suggestions on web that i should check the cluster log. I checked failover cluster manager for critical events. I got below event in failover cluster manager.</p>
<div class="codediv">
<pre><strong><span style="color: #0000ff;">Clustered role 'AG_***' has exceeded its failover threshold. It has exhausted the configured number of failover attempts within the failover period of time allotted to it and will be left in a failed state.
No additional attempts will be made to bring the role online or fail it over to another node in the cluster.
Please check the events associated with the failure. After the issues causing the failure are resolved the role can be brought online manually or the cluster may attempt to bring it online again after the restart delay period.</span></strong></pre>
</div>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-344" src="http://techyaz.com/wp-content/uploads/2017/08/3-check-cluster-events.jpg" alt="check cluster events" width="799" height="333" srcset="https://techyaz.com/wp-content/uploads/2017/08/3-check-cluster-events.jpg 799w, https://techyaz.com/wp-content/uploads/2017/08/3-check-cluster-events-300x125.jpg 300w, https://techyaz.com/wp-content/uploads/2017/08/3-check-cluster-events-768x320.jpg 768w" sizes="auto, (max-width: 799px) 100vw, 799px" /></p>
<h3><span style="color: #000080;"><strong>Fix Resolving state and Make Secondary Replica Primary</strong></span></h3>
<p>Above issue clearly indicates about some cluster configuration related to role created for AOAG. As we can see, there is one role is showing under roles tab of this cluster group in below image. We can see the current owner of this role is still showing as node 1.<br />
<img loading="lazy" decoding="async" class="aligncenter size-full wp-image-345" src="http://techyaz.com/wp-content/uploads/2017/08/4-FCM-status.jpg" alt="failover cluster manager status" width="799" height="212" srcset="https://techyaz.com/wp-content/uploads/2017/08/4-FCM-status.jpg 799w, https://techyaz.com/wp-content/uploads/2017/08/4-FCM-status-300x80.jpg 300w, https://techyaz.com/wp-content/uploads/2017/08/4-FCM-status-768x204.jpg 768w" sizes="auto, (max-width: 799px) 100vw, 799px" /></p>
<p>Now right click on this role and choose properties as per below image.<br />
<img loading="lazy" decoding="async" class="aligncenter size-full wp-image-346" src="http://techyaz.com/wp-content/uploads/2017/08/5-FCM-Roles-Properties.jpg" alt="Role properties in FCM" width="583" height="430" srcset="https://techyaz.com/wp-content/uploads/2017/08/5-FCM-Roles-Properties.jpg 583w, https://techyaz.com/wp-content/uploads/2017/08/5-FCM-Roles-Properties-300x221.jpg 300w" sizes="auto, (max-width: 583px) 100vw, 583px" /></p>
<p>You will get a properties window as shown in below screenshot. Now click on &#8220;Failover&#8221; tab of this screen to check the failover threshold details.<br />
<img loading="lazy" decoding="async" class="aligncenter size-full wp-image-347" src="http://techyaz.com/wp-content/uploads/2017/08/6-FCM-Roles-property.jpg" alt="FCM Role Properties" width="421" height="495" srcset="https://techyaz.com/wp-content/uploads/2017/08/6-FCM-Roles-property.jpg 421w, https://techyaz.com/wp-content/uploads/2017/08/6-FCM-Roles-property-255x300.jpg 255w" sizes="auto, (max-width: 421px) 100vw, 421px" /></p>
<p>We can see the failover threshold is set to only 1 in the 6 hours. It means if any failover happen more than once in the 6 hrs time period it will remain in failed state and will not try to come online. Now increase this value as per your need. I have changed it to 10. Click on apply and Ok button.<br />
<img loading="lazy" decoding="async" class="aligncenter size-full wp-image-348" src="http://techyaz.com/wp-content/uploads/2017/08/7-FCM-Roles-property-change-value.jpg" alt="FCM Role Properties" width="409" height="495" srcset="https://techyaz.com/wp-content/uploads/2017/08/7-FCM-Roles-property-change-value.jpg 409w, https://techyaz.com/wp-content/uploads/2017/08/7-FCM-Roles-property-change-value-248x300.jpg 248w" sizes="auto, (max-width: 409px) 100vw, 409px" /></p>
<p>Now, secondary replica of availability databases will not come online automatically. We need to bring them online. We have multiple options to bring them online from resolving state. You can directly run the failover by right click on availability group in SSMS and then proceed with failover.</p>
<p>Another option is to bring them online from failover cluster manager. You can either right click on the AOAG role and click on &#8220;Bring Online&#8230;&#8221; option or you can failover it to best possible node. As primary replica is down and not accessible so it will be failed over to the secondary replica only because this node is only available this time. Let&#8217;s right click on AOAG role in failover cluster manager, choose move and then click on &#8220;Best Possible Node&#8221;<br />
<img loading="lazy" decoding="async" class="aligncenter size-full wp-image-349" src="http://techyaz.com/wp-content/uploads/2017/08/8-FCM-Failover-post-change.jpg" alt="FCM failover post increasing failover threshold " width="807" height="375" srcset="https://techyaz.com/wp-content/uploads/2017/08/8-FCM-Failover-post-change.jpg 807w, https://techyaz.com/wp-content/uploads/2017/08/8-FCM-Failover-post-change-300x139.jpg 300w, https://techyaz.com/wp-content/uploads/2017/08/8-FCM-Failover-post-change-768x357.jpg 768w" sizes="auto, (max-width: 807px) 100vw, 807px" /></p>
<p>It will process and come online within few seconds and this time you can see this role is online from node 2 as current owner is showing as node 2 now.<br />
<img loading="lazy" decoding="async" class="aligncenter size-full wp-image-350" src="http://techyaz.com/wp-content/uploads/2017/08/9-AOAG-Role-online.jpg" alt="Bring role online" width="801" height="365" srcset="https://techyaz.com/wp-content/uploads/2017/08/9-AOAG-Role-online.jpg 801w, https://techyaz.com/wp-content/uploads/2017/08/9-AOAG-Role-online-300x137.jpg 300w, https://techyaz.com/wp-content/uploads/2017/08/9-AOAG-Role-online-768x350.jpg 768w" sizes="auto, (max-width: 801px) 100vw, 801px" /></p>
<p>We can also validate this change while making a database connection to the secondary replica in SSMS. Connect to secondary replica and expand the AlwaysOn Availability Group folders. You can see now availability group is showing as primary. That means your database is online from secondary replica to accept the user connections.<br />
<img loading="lazy" decoding="async" class="aligncenter size-full wp-image-351" src="http://techyaz.com/wp-content/uploads/2017/08/10-AOAG-secondary-replica.jpg" alt="resolving state changed to primary" width="271" height="275" /></p>
<p>You can also test this exercise to make sure automatic failover is working fine or not to prevent this kind of future outages. Once your earlier primary replica comes online, you shutdown SQL Server services on secondary replica/current primary replica. Once it will go down, your current secondary replica becomes primary automatically. Before shutdown SQL Server services, make sure databases should be fully synchronized.</p>
<p>Hee, we have fixed Alwayson issue where secondary replica is not coming online after failover and hung in resolving state. I hope you like this article. Please follow us on our <a href="https://www.facebook.com/Techyaz/">facebook page</a> and on <a href="https://twitter.com/Tech_yaz">Twitter </a>handle to get latest updates.</p>
<p><em><strong>Read More:</strong></em></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/upgrade-patch-availability-group-instances/" target="_blank" rel="noopener">How to Upgrade or Apply Patches on AOAG Instances?</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/fix-aoag-listener-error-19471-kerberos-status-showing-handle-invalid/" target="_blank" rel="noopener">Fix AOAG Listener Error 19471: The handle is Invalid</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/restore-database-participating-alwayson-availability-group/" target="_blank" rel="noopener">How to Restore a Database participating in AOAG?</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fixing-sap-connectivity-issue-aoag-automatic-failover/" target="_blank" rel="noopener">Fix Application Connectivity Issue after AOAG Failover</a></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/">Why is Secondary Replica Showing in Resolving state after AOAG Automatic failover?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/secondary-replica-not-coming-online-showing-resolving-state-automatic-failover-alwayson-availability-group-configuration/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
