<?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>Database Mirroring - Techyaz.com</title>
	<atom:link href="https://techyaz.com/category/sql-server/database-mirroring/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Tips, Tutorials and How-to Topics</description>
	<lastBuildDate>Tue, 15 May 2018 15:17:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>

<image>
	<url>https://techyaz.com/wp-content/uploads/2017/11/cropped-Site-icon-150x150.png</url>
	<title>Database Mirroring - Techyaz.com</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Fix Error 1418: The server network address cannot be reached or does not exist.</title>
		<link>https://techyaz.com/sql-server/troubleshooting/fix-error-1418-the-server-network-address-cannot-be-reached-or-does-not-exist/</link>
					<comments>https://techyaz.com/sql-server/troubleshooting/fix-error-1418-the-server-network-address-cannot-be-reached-or-does-not-exist/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Tue, 27 Mar 2018 16:53:07 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[Database Mirroring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[endpoints]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[SQL Server Configuration Manager]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=1997</guid>

					<description><![CDATA[<p>We got error 1418 while configuring Database Mirroring on one of the SQL Server database instance. The error details are given below: The server network address “TCP://ServerName.abc.local:5022&#8243; cannot be reached or does not exist. Check the network address name and&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/troubleshooting/fix-error-1418-the-server-network-address-cannot-be-reached-or-does-not-exist/">Fix Error 1418: The server network address cannot be reached or does not exist.</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>We got error 1418 while configuring Database Mirroring on one of the SQL Server database instance. The error details are given below:</p>
<p><em><span style="color: #ff0000;">The server network address <strong>“TCP://ServerName.abc.local:5022&#8243;</strong> cannot be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (Microsoft SQL Server, Error: 1418)</span></em></p>
<h3><span style="color: #333399;">Reason behind Error 1418</span></h3>
<p>Main reason behind database mirroring error 1418 is because the specified server network address cannot be reached or does not exist. The server network address cannot be reached because of multiple reasons. Some of them are given below.</p>
<p><img fetchpriority="high" decoding="async" class="size-full wp-image-2000 alignright" src="http://techyaz.com/wp-content/uploads/2018/03/fix-error-1418.png" alt="fix error 1418" width="300" height="300" srcset="https://techyaz.com/wp-content/uploads/2018/03/fix-error-1418.png 300w, https://techyaz.com/wp-content/uploads/2018/03/fix-error-1418-150x150.png 150w, https://techyaz.com/wp-content/uploads/2018/03/fix-error-1418-160x160.png 160w, https://techyaz.com/wp-content/uploads/2018/03/fix-error-1418-320x320.png 320w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<ul>
<li>Principal, Mirror and Witness servers are not talking to each other.</li>
<li>Wrong network address name, mirror server instance name or port number.</li>
<li>Mirror database is not ready for mirroring.</li>
<li>Principal or mirror server instance is behind a firewall.</li>
<li>You are using local system account to run SQL Server services and not using certificates for authentication.</li>
<li>SQL Server services are running with different domain accounts on Principal and Mirror server and service accounts don&#8217;t have enough permission on endpoints.</li>
<li>Different endpoint encryption value set on Principal, Mirror and Witness server.</li>
<li>Endpoints are not started on the partner servers.</li>
<li>Principal server instance is not listening on the port assigned to its database mirroring endpoint.</li>
</ul>
<p>We need to verify each option mentioned above carefully to fix this error.</p>
<h3><span style="color: #333399;">Solution</span></h3>
<p>The solution of this issue may vary case to case depending on the nature of issue. To fix this issue we need to find out the main root cause behind error 1418. The root cause may be anything that is given in above section. Here I will describe each probable reason given above and its solution to fix this issue. Make sure to go through with each point given in this article.</p>
<h5><span style="color: #993300;">Principal, Mirror and Witness Servers Should be Accessible</span></h5>
<p>Make sure that SQL Server Instances installed on Principal, Mirror &amp; Witness servers are accessible to each other. If remote login for any SQL Server instance is not enabled then you might get this issue. You can enable remote connectivity by <strong><a href="http://techyaz.com/sql-server/troubleshooting/fix-error-40-network-related-instance-specific-error-occurred-establishing-connection/" target="_blank" rel="noopener">enabling TCP/IP and Named Pipes protocols in SQL Server Configuration Manager</a></strong>. Each system must access the ports of the other SQL Server instances over TCP. You can try telnet the SQL Server ports of other partners.</p>
<h5><span style="color: #993300;">Verify Correct System Details </span></h5>
<p>Sometimes we entered wrong details that end up with throwing errors. Make sure to verify the network address name, mirror server instance name and its port numbers are correct. You can recheck all the details whether you have entered them correctly or not.</p>
<h5><span style="color: #993300;">Mirror Database Preparation</span></h5>
<p>Verify that the mirror database is ready for database mirroring. We should prepare mirror database before configuring or during configuring database mirroring. It is suggested to keep identical drive path for mirror database files. Below are the steps you should take care for preparing your mirroring database.</p>
<ul>
<li>Run full backup and subsequent transactional log backup of the Principal database and copy it to the Mirror server.</li>
<li>Restore database with same name in norecovery state on Mirror server with the copied backup files from above step. You must ensure that restored database on mirror server should be in restoring mode before starting database mirroring configuration.</li>
</ul>
<h5><span style="color: #993300;">Firewall/Ports</span></h5>
<p>One of the probable reason to get error 1418 is partner servers are behind firewall. Make sure that the principal server instance and destination mirror server instance is not behind a firewall and they should talk to each other. Principal server, Mirror server and witness server should be accessible to each other.</p>
<p>Verify that SQL Server port and endpoint ports are enabled and accessible via telnet. If not or you are not able to telnet any of the partner instance from any server participating in mirroring then you should ask your network admins to open these ports to establish the connectivity over given port.</p>
<h5><span style="color: #993300;">Endpoints</span></h5>
<p>Make sure that endpoint has been created on principal, mirror and witness servers. Verify that the endpoints are started on each partner server instances. You can check endpoint status by running below T-SQL query on each instance.</p>
<pre><strong><span style="color: #0000ff;">SELECT state_desc FROM sys.database_mirroring_endpoints</span></strong></pre>
<p>If either endpoint is not started, execute below ALTER ENDPOINT statement to start it.</p>
<pre><span style="color: #008000;"><strong>#Change the name of your endpoints. Here endpoint name is Mirroring</strong></span>
<strong><span style="color: #0000ff;">ALTER ENDPOINT Mirroring</span></strong>
<strong><span style="color: #0000ff;">STATE = STARTED</span></strong>
<strong><span style="color: #0000ff;">AS TCP (LISTENER_PORT = &lt;port_number&gt;)</span></strong>
<strong><span style="color: #0000ff;">FOR database_mirroring (ROLE = ALL);</span></strong>
<strong><span style="color: #0000ff;">GO</span></strong></pre>
<p>Recheck that the principal server instance is listening on the port assigned to its database mirroring endpoint and the mirror server instance is listening on its port. If a partner is not listening on its assigned port, modify the database mirroring endpoint to listen on a different port.</p>
<p>Sometimes this issue got fixed by dropping the existing endpoint and recreate it again on partner servers.</p>
<h5><span style="color: #993300;">Service Accounts</span></h5>
<p>Do not use <em>local system</em> account to run SQL Server services. If you don’t have any choice and want to use local system then ensure to use certificates for authentications.</p>
<p>Make sure that service accounts that you are using to run SQL Server services must have CONNECT permission to mirroring endpoints. Also, if you are configuring database mirroring between two domains then the login of one account must be created in <strong>master</strong> database on the other computer, and that login must be granted CONNECT permissions on the endpoint.</p>
<p>It&#8217;s always advisable to use same service accounts to run SQL Server services on all three Instances on Principal, Mirror and Witness server.</p>
<p>You can comment us your experience about fixing this issue. We will update this article with your solution that you have used to fix this issue.</p>
<p>I hope you like this article. Please follow us on our <a href="https://www.facebook.com/Techyaz/" target="_blank" rel="noopener">Facebook</a> page and <a href="https://twitter.com/Tech_yaz" target="_blank" rel="noopener">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="http://techyaz.com/sql-server/fix-error-15141-server-principal-owns-one-endpoints-cannot-dropped/" target="_blank" rel="noopener">Fix Error 15141: The server principal owns one or more endpoints and cannot be dropped</a></strong></li>
<li><strong><a href="http://techyaz.com/sql-server/troubleshooting/fix-alwayson-error-35250-joining-database-secondary-replica-resulted-error/" target="_blank" rel="noopener">Fix AOAG Error 35250: Joining database on Secondary Replica resulted in an error</a></strong></li>
<li><strong><a href="http://techyaz.com/sql-server/upgrade-patch-availability-group-instances/" target="_blank" rel="noopener">How to Upgrade or Patch Availability Group Instances?</a></strong></li>
<li><strong><a href="http://techyaz.com/sql-server/alwayson/sql-server-alwayson-interview-questions-answers/" target="_blank" rel="noopener">SQL Server Always On Interview Questions and Answers</a></strong></li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://techyaz.com/sql-server/troubleshooting/fix-error-1418-the-server-network-address-cannot-be-reached-or-does-not-exist/">Fix Error 1418: The server network address cannot be reached or does not exist.</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/troubleshooting/fix-error-1418-the-server-network-address-cannot-be-reached-or-does-not-exist/feed/</wfw:commentRss>
			<slash:comments>0</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 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="(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 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="(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>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>
	</channel>
</rss>
