<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Working with Microsoft SQL Server AlwaysOn Availability Groups in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Working-with-Microsoft-SQL-Server-AlwaysOn-Availability-Groups/ta-p/1742049</link>
    <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;To connect to an AlwaysOn availability group, we specify the hostname of the AlwaysOn listener in the SQL Server source endpoint, instead of a specific server in the group. If the AlwaysOn listener is listening on a non-default port we can add the port number after the hostname, e.g. pugsql_dsx,5012&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The AlwaysOn listener will redirect connections to specific servers, and if the specific servers are also using non-default&amp;nbsp;ports we need to specify this when configuring&amp;nbsp;the AlwaysOn availability group, by executing the following command (note that we can specify a port after the replica name)&amp;nbsp;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ALTER AVAILABILITY GROUP [{ag_name}]

MODIFY REPLICA ON '{replica_name}'

WITH (SECONDARY_ROLE (ALLOW_CONNECTIONS = ALL, READ_ONLY_ROUTING_URL='TCP://{replica_name}:{Port}'))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The section above is explained in the User Guide Chapter 8 "Adding and Managing Source Endpoints", under the section "&lt;EM&gt;Using Microsoft SQL Server as a source&lt;/EM&gt;" .. "&lt;EM&gt;Working with Microsoft SQL Server AlwaysOn Availability Groups&lt;/EM&gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have verified that in order to allow a listener on a specific port (non-default port) we need to define the Alias name in order to force the connection to use specific TCP&lt;/P&gt;
&lt;P&gt;We can give this alias name in the program name is CLICNFG.EXE and is usually under c:\windows\system32&lt;/P&gt;
&lt;P&gt;Here are the steps as well:&lt;/P&gt;
&lt;P&gt;Step 1:&amp;nbsp; Go to windows explorer open the path C:\Windows\System32 and open application “&lt;STRONG&gt;cliconfg&lt;/STRONG&gt;”&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Fergen_0-1599577456959.png" style="width: 580px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40224i5ADF80696E9D133F/image-dimensions/580x290?v=v2" width="580" height="290" role="button" title="David_Fergen_0-1599577456959.png" alt="David_Fergen_0-1599577456959.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 2: It will redirect SQL Server Client Network Utility tab. Then go to Alias tab&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Fergen_1-1599577456966.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40223iC618465F4C917B4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="David_Fergen_1-1599577456966.png" alt="David_Fergen_1-1599577456966.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 3: Click on the Add button and select TCP/IP from Network Libraries put the sever name from connection string followed by instance name (use back slash after hostname) for e.g. servername = PUGSQL3.ug.sbicdirectory.com and uncheck “Dynamically determine port” checkbox and put the port number you want to use and put an Alias name which you want to give in Server Alias name and click on ok button.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Fergen_2-1599577456972.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40225iAECFC9F2F2E7487E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="David_Fergen_2-1599577456972.png" alt="David_Fergen_2-1599577456972.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: May have to use fully qualified name of SQL Servers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also follow below link for more information on this.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://sqlandme.com/2011/05/05/create-sql-server-alias-cliconfg-exe/" target="_blank" rel="noopener"&gt;https://sqlandme.com/2011/05/05/create-sql-server-alias-cliconfg-exe/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a query you can use to find out if named pipes is enabled:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SELECT 'Named Pipes' AS [Protocol], iif(value_data = 1, 'Yes', 'No') AS isEnabled

FROM sys.dm_server_registry

WHERE registry_key LIKE '%np' AND value_name = 'Enabled'

UNION

SELECT 'Shared Memory', iif(value_data = 1, 'Yes', 'No')

FROM sys.dm_server_registry

WHERE registry_key LIKE '%sm' AND value_name = 'Enabled'

UNION

SELECT 'TCP/IP', iif(value_data = 1, 'Yes', 'No')

FROM sys.dm_server_registry

WHERE registry_key LIKE '%tcp' AND value_name = 'Enabled'&lt;/LI-CODE&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 05 Feb 2021 21:59:07 GMT</pubDate>
    <dc:creator>David_Fergen</dc:creator>
    <dc:date>2021-02-05T21:59:07Z</dc:date>
    <item>
      <title>Working with Microsoft SQL Server AlwaysOn Availability Groups</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Working-with-Microsoft-SQL-Server-AlwaysOn-Availability-Groups/ta-p/1742049</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;To connect to an AlwaysOn availability group, we specify the hostname of the AlwaysOn listener in the SQL Server source endpoint, instead of a specific server in the group. If the AlwaysOn listener is listening on a non-default port we can add the port number after the hostname, e.g. pugsql_dsx,5012&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The AlwaysOn listener will redirect connections to specific servers, and if the specific servers are also using non-default&amp;nbsp;ports we need to specify this when configuring&amp;nbsp;the AlwaysOn availability group, by executing the following command (note that we can specify a port after the replica name)&amp;nbsp;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ALTER AVAILABILITY GROUP [{ag_name}]

MODIFY REPLICA ON '{replica_name}'

WITH (SECONDARY_ROLE (ALLOW_CONNECTIONS = ALL, READ_ONLY_ROUTING_URL='TCP://{replica_name}:{Port}'))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The section above is explained in the User Guide Chapter 8 "Adding and Managing Source Endpoints", under the section "&lt;EM&gt;Using Microsoft SQL Server as a source&lt;/EM&gt;" .. "&lt;EM&gt;Working with Microsoft SQL Server AlwaysOn Availability Groups&lt;/EM&gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have verified that in order to allow a listener on a specific port (non-default port) we need to define the Alias name in order to force the connection to use specific TCP&lt;/P&gt;
&lt;P&gt;We can give this alias name in the program name is CLICNFG.EXE and is usually under c:\windows\system32&lt;/P&gt;
&lt;P&gt;Here are the steps as well:&lt;/P&gt;
&lt;P&gt;Step 1:&amp;nbsp; Go to windows explorer open the path C:\Windows\System32 and open application “&lt;STRONG&gt;cliconfg&lt;/STRONG&gt;”&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Fergen_0-1599577456959.png" style="width: 580px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40224i5ADF80696E9D133F/image-dimensions/580x290?v=v2" width="580" height="290" role="button" title="David_Fergen_0-1599577456959.png" alt="David_Fergen_0-1599577456959.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 2: It will redirect SQL Server Client Network Utility tab. Then go to Alias tab&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Fergen_1-1599577456966.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40223iC618465F4C917B4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="David_Fergen_1-1599577456966.png" alt="David_Fergen_1-1599577456966.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 3: Click on the Add button and select TCP/IP from Network Libraries put the sever name from connection string followed by instance name (use back slash after hostname) for e.g. servername = PUGSQL3.ug.sbicdirectory.com and uncheck “Dynamically determine port” checkbox and put the port number you want to use and put an Alias name which you want to give in Server Alias name and click on ok button.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Fergen_2-1599577456972.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40225iAECFC9F2F2E7487E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="David_Fergen_2-1599577456972.png" alt="David_Fergen_2-1599577456972.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: May have to use fully qualified name of SQL Servers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also follow below link for more information on this.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://sqlandme.com/2011/05/05/create-sql-server-alias-cliconfg-exe/" target="_blank" rel="noopener"&gt;https://sqlandme.com/2011/05/05/create-sql-server-alias-cliconfg-exe/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a query you can use to find out if named pipes is enabled:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SELECT 'Named Pipes' AS [Protocol], iif(value_data = 1, 'Yes', 'No') AS isEnabled

FROM sys.dm_server_registry

WHERE registry_key LIKE '%np' AND value_name = 'Enabled'

UNION

SELECT 'Shared Memory', iif(value_data = 1, 'Yes', 'No')

FROM sys.dm_server_registry

WHERE registry_key LIKE '%sm' AND value_name = 'Enabled'

UNION

SELECT 'TCP/IP', iif(value_data = 1, 'Yes', 'No')

FROM sys.dm_server_registry

WHERE registry_key LIKE '%tcp' AND value_name = 'Enabled'&lt;/LI-CODE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Feb 2021 21:59:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Working-with-Microsoft-SQL-Server-AlwaysOn-Availability-Groups/ta-p/1742049</guid>
      <dc:creator>David_Fergen</dc:creator>
      <dc:date>2021-02-05T21:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Microsoft SQL Server AlwaysOn Availability Groups</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Working-with-Microsoft-SQL-Server-AlwaysOn-Availability-Groups/tac-p/2109184#M9993</link>
      <description>&lt;P&gt;I'm trying to resolve an issue we have where the target is an AlwaysOn setup. This article has come up a few times and I just want to confirm that the latter scenario only applies when a nonstandard port is being used. The section talking about running the cliconfg to set the Alias, etc.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 21:31:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Working-with-Microsoft-SQL-Server-AlwaysOn-Availability-Groups/tac-p/2109184#M9993</guid>
      <dc:creator>SoonerWatts</dc:creator>
      <dc:date>2023-08-23T21:31:13Z</dc:date>
    </item>
  </channel>
</rss>

