<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>ggaurav</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ggaurav/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ggaurav/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:21:15 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SQL Data Sync table creation error</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/sql-data-sync-table-creation-error</link>
      <pubDate>Sat, 11 Jul 2015 03:53:52 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2015/07/11/sql-data-sync-table-creation-error/</guid>
      <description><![CDATA[As you are setting your first SQL data sync between on-prem and Azure SQL you may come up with an...]]></description>
      <content:encoded><![CDATA[<p>As you are setting your first SQL data sync between on-prem and Azure SQL you may come up with an error when trying to sync the group:</p>
<p>Database provisioning failed with the exception "SqlException Error Code: -2146232060 - SqlError Number:15247,<br />Message: User does not have permission to perform this action.<br />SqlError Number:2759, Message: CREATE SCHEMA failed due to previous errors.<br />"&nbsp;&nbsp;&nbsp; For more information, provide tracing ID &lsquo;3c3e1987-79ff-4984-b41c-69075b1ff18b&rsquo; to customer support.</p>
<p>&nbsp;</p>
<p>As you can see it, we are getting the message about the permission issue. Here it's very clear that if we are able to give the permission to the user with which we are connecting the SQL instance ( user authenticated by SQL authentication). In my scenario, I gave the dbo permission as this was my primary user for the database by using the command shared in <a href="https://msdn.microsoft.com/en-us/library/azure/ee336235.aspx">https://msdn.microsoft.com/en-us/library/azure/ee336235.aspx</a></p>
<p>&nbsp;</p>
<p>Happy Learning &amp; Troubleshooting!!</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Disclaimer</span></strong>:&nbsp; Everything here,&nbsp;is my personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>How Statistics in SQL Server determines performance</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/how-statistics-in-sql-server-determines-performance</link>
      <pubDate>Fri, 10 Apr 2015 04:55:00 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2015/04/10/how-statistics-in-sql-server-determines-performance/</guid>
      <description><![CDATA[SQL Server collects statistical information about indexes and column data stored in the database....]]></description>
      <content:encoded><![CDATA[<p>SQL Server collects statistical information about indexes and column data stored in the database. These statistics are used by the SQL Server query optimizer to choose the most efficient plan for retrieving or updating data. When a large number of rows have been inserted/updated/deleted on a table then statistics may become out of date causing a bad query plan.&nbsp;</p>
<p>&nbsp;</p>
<ul>
<li>&nbsp;Statistics maintained on each table in SQL Server to aid the optimizer in cost-based decision making include the:</li>
</ul>
<ol>Number of rows in the table.</ol>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number of pages used by the table.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number of modifications made to the keys of the table since the last update to the statistics.</p>
<p>&nbsp;</p>
<ul>
<li>&nbsp;Additional information is stored for indexes, including (for each index):</li>
</ul>
<ul>
<ul>An equi-height histogram on the first column.</ul>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Densities on all column prefixes.</p>
<ul>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Average key length.</ul>
<ul>
<li>&nbsp;The basic algorithm for auto update statistics is:</li>
</ul>
<ul>
<ul>If the cardinality for a table is less than six and the table is in the tempdb database, auto update with every six modifications to the table.</ul>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If the cardinality for a table is greater than 6, but less than or equal to 500, update status every 500 modifications.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If the cardinality for a table is greater than 500, update statistics when (500 + 20 percent of the table) changes have occurred.</p>
<p>&nbsp;</p>
<ul>For table variables, cardinality changes does not trigger auto update statistics.</ul>
<p>&nbsp;</p>
<ul>
<li>Statistics are automatically updated when the query optimizer determines that they are out-of-date. This basically means that sufficient data modification operations have occurred since the last time they were updated to minimize their usefulness. The number of operations is tied to the size of the table and is usually something like 500 + 0.2 * (number of rows in the table). This means that the table must have at least 500 modification operations before statistics are updated during query optimization; for large tables, this threshold can be much larger. In this case, when I say "operation" I mean a single row modification. A single UPDATE statement that changes 1000 rows will be counted as 1000 modification operations. You can actually see the number of modification operations in the sysindexes table, in the rowmodctr column.<br />The number of rows affected by every INSERT, UPDATE, or DELETE operation on a table is reflected in the rowmodctr column for the row representing the table itself.</li>
</ul>
<p>&nbsp;</p>
<ul>
<li>The newly-introduced statistical maintenance functionality, AutoStat, may generate unwanted overhead on a production system by performing one of the following actions:</li>
</ul>
<ul>
<ul>Initiating statistical updates during heavy production periods.</ul>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -or-</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Initiating an excessively high number of UPDATE STATISTICS processes at a given point in time.</p>
<ul>
<li>To maintain the statistical information in an as up-to-date fashion as possible, SQL Server introduces AutoStat, which, through SQL Server's monitoring of table modifications, is capable of automatically updating the statistics for a table when a certain change threshold has been<br />reached. Additionally, SQL Server introduces auto-create-statistics, which causes the server to automatically generate all statistics required for the accurate optimization of a specific query.</li>
</ul>
<ul>
<li>&nbsp;The server maintains two counters in sysindexes - rowModCtr and rowModCtrNCMax. &nbsp;RowModCttr tracks the number of update/insert/delete operations made to a table since the statistics were last updated.&nbsp; Specifically, the updates are only &nbsp;tracked when there is a change to a column covered by a histogram on the table. &nbsp;The basic idea is that we maintain the rowModCtr value whenever we touch columns &nbsp;covered by a histogram.&nbsp;&nbsp;Whenever we update the statistics, we only update those &nbsp;statistics required by the current query.&nbsp;&nbsp;&nbsp; In order that we don't loose<br />track &nbsp;of the fact that the other statistics may be stale, we move the rowModCtr value &nbsp;from the parent table to each of the index/stats which were not maintained.&nbsp;&nbsp; We &nbsp;then summaries the maximum change count for all indices in the base index row.</li>
</ul>
<ul>
<li>&nbsp;The&nbsp; sysindexes.rowmodctr column maintains a running total of all modifications to a table that, over time, can adversely affect the query processor's decision making process. This counter is updated each time any of the following events occurs:</li>
</ul>
<ul>
<ul>A single row insert is made.</ul>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A single row delete is made.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An update to an indexed column is made.</p>
<p>NOTE: TRUNCATE TABLE does not update rowmodctr. <br /><br />After table statistics have been updated, the rowmodctr value is reset to 0 and the table's statistics schema version is updated.</p>
<ul>
<li>In addition to cardinality, the selectivity of the predicate also affects AutoStats generation. This means that statistics may not be updated afer every 500 modifications if cardinality were &lt; 500 or for every 20% of changes if cardinality were &gt; 500. A scale up factor (value ranges<br />from 1 to 4, 1 and 4 inclusive) is generated depending on the selectivity and a product of this factor and the number of changes as obtained from the algorithm would be the actual number of modifications required for AutoStats generation.</li>
<li>&nbsp;To determining when Autostats are being run &nbsp;we can use Trace Flag 205.</li>
<li>&nbsp;&nbsp;When set to ON, existing statistics are automatically updated when the statistics become out-of-date because the data in the tables has changed. When set to OFF, existing statistics are not automatically updated; instead, statistics can be manually updated. SQL Server automatically updates this statistical information periodically as the data in the table&rsquo;s changes. The sampling is random across data pages, and taken from the table or the smallest nonclustered index on the columns needed by the statistics. After a data page has been read from disk, all the rows on the data page are used to update the statistical information. The frequency at which the statistical information is updated is determined by the volume of data in the column or index and the amount of changing data. For example, the statistics for a table containing 10,000 rows may need updating when 1,000 index values have changed because 1,000 values may represent a significant percentage of the table. However, for a table containing 10 million index entries, 1,000 changing index values is less significant, and so the statistics may not be automatically<br />updated. SQL Server, however, always ensures that a minimum number of rows are sampled; tables that are smaller than 8 megabytes (MB) are always fully scanned to gather statistics.</li>
</ul>
<p>&nbsp;</p>
<ul>
<li><strong>If needed, selectively use FULLSCAN statistics</strong></li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If you are using auto create and auto update statistics and you are getting a bad query plan because the statistics are not accurate or current, do the following:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. Leave auto create and auto update statistics on.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. Only for those statistics that are not accurate or current enough, use&nbsp; CREATE STATISTICS &hellip; WITH FULLSCAN, NORECOMPUTE and a batch job that does&nbsp; UPDATE STATISTICS &hellip; WITH FULLSCAN, NORECOMPUTE periodically</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3. <strong>Use asynchronous statistics update if synchronous update causes undesired delay </strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If you have a large database and an OLTP workload, and if you enable AUTO_UPDATE_STATISTICS, some transactions that normally run in a fraction of a second may very infrequently take several seconds or more because they cause statistics to be updated.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;If you want&nbsp;to&nbsp;avoid the possibility of this noticeable delay, enable AUTO_UPDATE_STATISTICS_ASYNC. For workloads with long-running queries, getting the best plan is more important than an infrequent delay in compilation. In such cases, use synchronous rather than&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asynchronous auto update statistics.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4. Determining When to Update Statistics Consider updating statistics for the following conditions:</p>
<ul>
<li>&nbsp;Query execution times are slow.</li>
<li>Insert operations occur on ascending or descending key columns.</li>
<li>After maintenance operations.</li>
</ul>
<p><br />Rule of thumb!</p>
<ul>
<li><strong>Use Update Stats with full scan and disable Auto Stats when&nbsp;doing large batch updates and&nbsp;minimal to none ongoing updates.</strong></li>
<li><strong>Use Auto Stats (default)&nbsp;and don't run UPDATE STATS Full Scan&nbsp;when data is modified throughout the day.</strong></li>
</ul>
<p><strong></strong>&nbsp;</p>
<p>Happy Learning &amp; Troubleshooting!!</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Disclaimer</span></strong>:&nbsp; Everything here,&nbsp;is my personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.</p>]]></content:encoded>
    </item>
    <item>
      <title>SQL Cluster resource fails to come online</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/sql-cluster-resource-fails-to-come-online</link>
      <pubDate>Fri, 10 Apr 2015 04:36:12 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2015/04/10/sql-cluster-resource-fails-to-come-online/</guid>
      <description><![CDATA[You have a SQL clustered resource and it's failing to come online as a clustered resource. When you...]]></description>
      <content:encoded><![CDATA[<p>You have a SQL clustered resource and it's failing to come online as a clustered resource. When you look at the SQL Server error log we can see that SQL is starting and all the DB's are also starting however, SQL is shutting down without any error messages. This is because cluster service is taking it down as not able to connect to SQL Server to confirm that the resource is up and running.</p>
<p>When you look at the cluster log by generating it using PowerShell command get-clusterlog we see the following in the cluster logs :</p>
<p>&nbsp;</p>
<p>00000e30.00003700::2015/04/09-00:30:14.994 ERR&nbsp;&nbsp; [RES] SQL Server &lt;SQL Server (Dist)&gt;: [sqsrvres] ODBC Error: [08001] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].&nbsp; (268435455)<br />00000e30.00003700::2015/04/09-00:30:14.994 ERR&nbsp;&nbsp; [RES] SQL Server &lt;SQL Server (Dist)&gt;: [sqsrvres] ODBC Error: [HYT00] [Microsoft][SQL Server Native Client 11.0]Login timeout expired (0)<br />00000e30.00003700::2015/04/09-00:30:14.994 ERR&nbsp;&nbsp; [RES] SQL Server &lt;SQL Server (Dist)&gt;: [sqsrvres] ODBC Error: [08001] [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (268435455)<br />00000e30.00003700::2015/04/09-00:30:14.994 ERR&nbsp;&nbsp; [RES] SQL Server &lt;SQL Server (Dist)&gt;: [sqsrvres] ODBC Error: [08003] [Microsoft][ODBC Driver Manager] Connection not open (0)<br />00001548.000024a0::2015/04/09-00:30:15.384 ERR&nbsp;&nbsp; [RES] SQL Server &lt;SQL Server (ware)&gt;: [sqsrvres] ODBC Error: [08001] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].&nbsp; (268435455)<br />00001548.000024a0::2015/04/09-00:30:15.384 ERR&nbsp;&nbsp; [RES] SQL Server &lt;SQL Server (ware)&gt;: [sqsrvres] ODBC Error: [HYT00] [Microsoft][SQL Server Native Client 11.0]Login timeout expired (0)<br />00001548.000024a0::2015/04/09-00:30:15.384 ERR&nbsp;&nbsp; [RES] SQL Server &lt;SQL Server (ware)&gt;: [sqsrvres] ODBC Error: [08001] [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (268435455)<br />00001548.000024a0::2015/04/09-00:30:15.384 ERR&nbsp;&nbsp; [RES] SQL Server &lt;SQL Server (ware)&gt;: [sqsrvres] ODBC Error: [08003] [Microsoft][ODBC Driver Manager] Connection not open (0)</p>
<p>&nbsp;</p>
<p>From the above error message it's very clear that we are not able to make a connection to SQL instance on the local node. Also when we&nbsp;check the port on which SQL is listening, than it's a non-default port and not listening on 1433. Since it's not listening on the default port so we have to make sure that SQL Browser service is running and the UDP port 1434 is not blocked in the windows firewall. If due to security limitations we can't run SQL Browser service than we can&nbsp;create an alias on the local node to help cluster service connect to the SQL server.<br />&nbsp;</p>
<p>&nbsp;</p>
<p>Happy Learning &amp; Troubleshooting!!</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Disclaimer</span></strong>:&nbsp; Everything here,&nbsp;is my personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.</p>]]></content:encoded>
    </item>
    <item>
      <title>Testing AlwaysOn routing URL using SQLCMD</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/testing-alwayson-routing-url-using-sqlcmd</link>
      <pubDate>Wed, 03 Sep 2014 03:14:00 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2014/09/03/testing-alwayson-routing-url-using-sqlcmd/</guid>
      <description><![CDATA[You have created a listener and have configured routing URL for the replicas in the AlwaysOn group....]]></description>
      <content:encoded><![CDATA[<p>You have created a listener and have configured routing URL for the replicas in the AlwaysOn group. When you are trying to check if the routing URL is working as expected by trying to connect from SQLCMD using the below command:</p>
<p>sqlcmd -S Listenername,portnumber -d databasename -K ReadOnly</p>
<p>&nbsp;</p>
<p>you are getting the below error message :</p>
<p><span style="background-color: #ff6600;">Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Two or more redirections have occurred. Only one redirection per login is allowed.</span></p>
<p>&nbsp;</p>
<p><span style="background-color: #ffffff;">The things which you should be checking are :</span></p>
<p>&nbsp;</p>
<p><span style="background-color: #ffffff;">1. Make sure that you are able to make connection using the listener name. </span></p>
<p><span style="background-color: #ffffff;">2.&nbsp; Make sure that the port on which listener is listening is open in Windows firewall.</span></p>
<p><span style="background-color: #ffffff;">3. Use the below query to find the routing URL :</span></p>
<p><span style="background-color: #ffffff;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></p>
<p>-- Read-only routing url generation script.&nbsp;&nbsp; <br />-- Connect to each replica in your AlwaysOn cluster and run this script to get the read_only_routing_url for the replica.&nbsp;&nbsp;&nbsp; <br />-- Then set this to the read_only_routing_url for the availability group replica =&gt;&nbsp;&nbsp;&nbsp; <br />--&nbsp;&nbsp;&nbsp; alter availability group MyAvailabilityGroup modify replica on N'ThisReplica' with (secondary_role(read_only_routing_url=N'&lt;url&gt;'))&nbsp;&nbsp;&nbsp; <br />print 'Read-only-routing url script v.2012.1.24.1'</p>
<p>print 'This SQL Server instance version is [' + cast(serverproperty('ProductVersion') as varchar(256)) + ']'</p>
<p>if (ServerProperty('IsClustered') = 1)&nbsp;&nbsp;&nbsp; <br />begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is a clustered SQL Server instance.'&nbsp;&nbsp;&nbsp; <br />end&nbsp;&nbsp;&nbsp; <br />else&nbsp;&nbsp;&nbsp; <br />begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is a standard (not clustered) SQL Server instance.'&nbsp;&nbsp;&nbsp; <br />end</p>
<p>if (ServerProperty('IsHadrEnabled') = 1)&nbsp;&nbsp;&nbsp; <br />begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is enabled for AlwaysOn.'&nbsp;&nbsp;&nbsp; <br />end&nbsp;&nbsp;&nbsp; <br />else&nbsp;&nbsp;&nbsp; <br />begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is NOT enabled for AlwaysOn.'&nbsp;&nbsp;&nbsp; <br />end</p>
<p>-- Detect SQL Azure instance.&nbsp;&nbsp; <br />declare @is_sql_azure bit&nbsp;&nbsp;&nbsp; <br />set @is_sql_azure = 0</p>
<p>begin try&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; set @is_sql_azure = 1&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; exec('declare @i int set @i = sql_connection_mode()')&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is a Sql Azure instance.'&nbsp;&nbsp;&nbsp; <br />end try&nbsp;&nbsp;&nbsp; <br />begin catch&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; set @is_sql_azure = 0&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is NOT a Sql Azure instance.'&nbsp;&nbsp;&nbsp; <br />end catch</p>
<p>-- Check that this is SQL 11 or later, otherwise fail fast.&nbsp;&nbsp; <br />if (@@microsoftversion / 0x01000000 &lt; 11 or @is_sql_azure &gt; 0)&nbsp;&nbsp;&nbsp; <br />begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'This SQL Server instance does not support read-only routing, exiting script.'&nbsp;&nbsp;&nbsp; <br />end&nbsp;&nbsp;&nbsp; <br />else&nbsp;&nbsp;&nbsp; <br />begin -- if server supports read-only routing</p>
<p>&nbsp;&nbsp;&nbsp; -- Fetch the dedicated admin connection (dac) port.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; -- Normally it's always port 1434, but to be safe here we fetch it from the instance.&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; -- We use this later to exclude the admin port from read_only_routing_url.&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; declare @dac_port int&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; declare @reg_value varchar(255)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; exec xp_instance_regread&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'HKEY_LOCAL_MACHINE',&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'SOFTWARE\Microsoft\Microsoft SQL Server\\MSSQLServer\SuperSocketNetLib\AdminConnection\Tcp',&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'TcpDynamicPorts',&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @reg_value output</p>
<p>&nbsp;&nbsp;&nbsp; set @dac_port = cast(@reg_value as int)</p>
<p>&nbsp;&nbsp;&nbsp; print 'This SQL Server instance DAC (dedicated admin) port is ' + cast(@dac_port as varchar(255))&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; if (@dac_port = 0)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 'Note a DAC port of zero means the dedicated admin port is not enabled.'&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp;&nbsp;&nbsp; -- Fetch ListenOnAllIPs value.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; -- If set to 1, this means the instance is listening to all IP addresses.&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; -- If set to 0, this means the instance is listening to specific IP addresses.&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; declare @listen_all int&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; exec xp_instance_regread&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'HKEY_LOCAL_MACHINE',&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'SOFTWARE\Microsoft\Microsoft SQL Server\\MSSQLServer\SuperSocketNetLib\Tcp',&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'ListenOnAllIPs',&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @listen_all output</p>
<p>&nbsp;&nbsp;&nbsp; if (@listen_all = 1)&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is listening to all IP addresses (default mode).'&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; end&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; else&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is listening to specific IP addresses (ListenOnAllIPs is disabled).'&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp;&nbsp;&nbsp; -- Check for dynamic port configuration, not recommended with read-only routing.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; declare @tcp_dynamic_ports varchar(255)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; exec xp_instance_regread&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'HKEY_LOCAL_MACHINE',&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'SOFTWARE\Microsoft\Microsoft SQL Server\\MSSQLServer\SuperSocketNetLib\Tcp\IPAll',&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'TcpDynamicPorts',&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tcp_dynamic_ports output</p>
<p>&nbsp;&nbsp;&nbsp; if (@tcp_dynamic_ports = '0')&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is listening on a dynamic tcp port, this is NOT A RECOMMENDED CONFIGURATION when using read-only routing, because the instance port can change each time the instance is restarted.'&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; end&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; else&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 'This SQL Server instance is listening on fixed tcp port(s) (it is not configured for dynamic ports), this is a recommended configuration when using read-only routing.'&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp;&nbsp;&nbsp; -- Calculate the server domain and instance FQDN.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; -- We use @server_domain later to build the FQDN to the clustered instance.&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; declare @instance_fqdn varchar(255)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; declare @server_domain varchar(255)</p>
<p>&nbsp;&nbsp;&nbsp; -- Get the instance FQDN using the xp_getnetname API&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; -- Note all cluster nodes must be in same domain, so this works for calculating cluster FQDN.&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; set @instance_fqdn = ''&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; exec xp_getnetname @instance_fqdn output, 1</p>
<p>&nbsp;&nbsp;&nbsp; -- Remove embedded null character at end if found.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; declare @terminator int&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; set @terminator = charindex(char(0), @instance_fqdn) - 1&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; if (@terminator &gt; 0)&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; begin&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set @instance_fqdn = substring(@instance_fqdn, 1, @terminator)&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp;&nbsp;&nbsp; -- Build @server_domain using @instance_fqdn.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; set @server_domain = @instance_fqdn</p>
<p>&nbsp;&nbsp;&nbsp; -- Remove trailing portion to extract domain name.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; set @terminator = charindex('.', @server_domain)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; if (@terminator &gt; 0)&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; begin&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set @server_domain = substring(@server_domain, @terminator+1, datalength(@server_domain))&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; end&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'This SQL Server instance resides in domain ''' +&nbsp; @server_domain + ''''</p>
<p>&nbsp;&nbsp;&nbsp; if (ServerProperty('IsClustered') = 1)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Fetch machine name, which for a clustered SQL instance returns the network name of the virtual server.&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Append @server_domain to build the FQDN.&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set @instance_fqdn = cast(serverproperty('MachineName') as varchar(255)) + '.' + @server_domain&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp;&nbsp;&nbsp; declare @ror_url varchar(255)&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; declare @instance_port int</p>
<p>&nbsp;&nbsp;&nbsp; set @ror_url = ''</p>
<p>&nbsp;&nbsp;&nbsp; -- Get first available port for instance.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; select&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; top 1&nbsp;&nbsp;&nbsp; -- Select first matching port&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; @instance_port = port&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; from sys.dm_tcp_listener_states&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; where&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; type=0 -- Type 0 = TSQL (to avoid mirroring endpoint)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; and&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; state=0&nbsp;&nbsp;&nbsp; --&nbsp; State 0 is online&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; and&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; port &lt;&gt; @dac_port -- Avoid DAC port (admin port)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; and&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; -- Avoid availability group listeners&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; ip_address not in (select ip_address from sys.availability_group_listener_ip_addresses agls)&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; group by port&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; order by port asc&nbsp; -- Pick first port in ascending order</p>
<p>&nbsp;&nbsp;&nbsp; -- Check if there are multiple ports and warn if this is the case.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; declare @list_of_ports varchar(max)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; set @list_of_ports = ''</p>
<p>&nbsp;&nbsp;&nbsp; select&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; @list_of_ports = @list_of_ports +&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case datalength(@list_of_ports)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when 0 then cast(port as varchar(max))&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else ',' +&nbsp; cast(port as varchar(max))&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; from sys.dm_tcp_listener_states&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; where&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; type=0&nbsp;&nbsp;&nbsp; --&nbsp;&nbsp;&nbsp;&nbsp; Type 0 = TSQL (to avoid mirroring endpoint)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; and&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; state=0&nbsp;&nbsp;&nbsp; --&nbsp; State 0 is online&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; and&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; port &lt;&gt; @dac_port -- Avoid DAC port (admin port)&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; and&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; -- Avoid availability group listeners&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; ip_address not in (select ip_address from sys.availability_group_listener_ip_addresses agls)&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; group by port&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; order by port asc</p>
<p>&nbsp;&nbsp;&nbsp; print 'This SQL Server instance FQDN (Fully Qualified Domain Name) is ''' + @instance_fqdn + ''''&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'This SQL Server instance port is ' + cast(@instance_port as varchar(10))</p>
<p>&nbsp;&nbsp;&nbsp; set @ror_url = 'tcp://' + @instance_fqdn + ':' + cast(@instance_port as varchar(10))</p>
<p>&nbsp;&nbsp;&nbsp; print '****************************************************************************************************************'&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print 'The read_only_routing_url for this SQL Server instance is ''' + @ror_url + ''''&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; print '****************************************************************************************************************'</p>
<p>&nbsp;&nbsp;&nbsp; -- If there is more than one instance port (unusual) list them out just in case.&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; if (charindex(',', @list_of_ports) &gt; 0)&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; begin&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 'Note there is more than one instance port, the list of available instance ports for read_only_routing_url is (' + @list_of_ports + ')'&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 'The above URL just uses the first port in the list, but you can use any of these available ports.'&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; end</p>
<p>end -- if server supports read-only routing&nbsp;&nbsp; <br />go</p>
<p>&nbsp;</p>
<p><span style="background-color: #ffffff;"><span>4.&nbsp; Update the routing URL for each of the servers participating in AlwaysOn:</span></span></p>
<p><span style="background-color: #ffffff;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></p>
<p>--Set ROR URL&rsquo;s</p>
<p>&nbsp;</p>
<p>ALTER AVAILABILITY GROUP [GAG]</p>
<p>&nbsp;</p>
<p>Modify Replica on</p>
<p>&nbsp;</p>
<p>N'GGaurav-N01' with</p>
<p>&nbsp;</p>
<p>(Secondary_Role (READ_ONLY_ROUTING_URL&nbsp; = N'tcp://GGaurav-N01.ft.cp.mt.com:1433'))</p>
<p>&nbsp;</p>
<p>ALTER AVAILABILITY GROUP [GAG]</p>
<p>&nbsp;</p>
<p>Modify Replica on</p>
<p>&nbsp;</p>
<p>N'GGaurav-N03' with</p>
<p>&nbsp;</p>
<p>(Secondary_Role (READ_ONLY_ROUTING_URL&nbsp; = N'tcp://ggaurav-n03.ft.cp.mt.com:1433'))</p>
<p>&nbsp;</p>
<p>ALTER AVAILABILITY GROUP [GAG]</p>
<p>&nbsp;</p>
<p>Modify Replica on</p>
<p>&nbsp;</p>
<p>N'GGaurav-N01' with</p>
<p>&nbsp;</p>
<p>(Primary_Role (READ_ONLY_ROUTING_LIST&nbsp; =('GGaurav-N03','GGaurav-N01')))</p>
<p>&nbsp;</p>
<p><span style="background-color: #ffffff;"><span>5.&nbsp; The below query should have the same routing URL as we got in step 3</span></span></p>
<p>&nbsp;</p>
<p>SELECT ag.name as "Availability Group", ar.replica_server_name as "When Primary Replica Is",</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rl.routing_priority as "Routing Priority", ar2.replica_server_name as "RO Routed To",</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ar.secondary_role_allow_connections_desc, ar2.read_only_routing_url</p>
<p>&nbsp;</p>
<p>FROM sys.availability_read_only_routing_lists rl</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inner join sys.availability_replicas ar on rl.replica_id = ar.replica_id</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inner join sys.availability_replicas ar2 on rl.read_only_replica_id = ar2.replica_id</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inner join sys.availability_groups ag on ar.group_id = ag.group_id</p>
<p>&nbsp;</p>
<p>ORDER BY ag.name, ar.replica_server_name, rl.routing_priority</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/96/0167.Untitled.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-96/0167.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/96/0167.Untitled.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-96/0167.Untitled.png" alt="" border="0" /></a></p>
<p>&nbsp;&nbsp;</p>
<p><span style="background-color: #ffffff;"><span>6. Check if the routing is working using SQLCMD :</span></span></p>
<p><span style="background-color: #ffffff;"><span>sqlcmd -S Listenername,portnumber -d databasename -K ReadOnly</span></span></p>
<p>&nbsp;</p>
<p>Happy Learning &amp; Troubleshooting!!</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Disclaimer</span></strong>:&nbsp; Everything here,&nbsp;is my personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>AlwaysOn:Joining database on secondary replica resulted in an error</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/alwaysonjoining-database-on-secondary-replica-resulted-in-an-error</link>
      <pubDate>Wed, 25 Jun 2014 06:12:00 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2014/06/25/alwaysonjoining-database-on-secondary-replica-resulted-in-an-error/</guid>
      <description><![CDATA[Many a times when you try to create a new Availability group it would fail with the below error...]]></description>
      <content:encoded><![CDATA[<p>Many a times when you try to create a new Availability group it would fail with the below error message :</p>
<p>&nbsp;</p>
<p>TITLE: Microsoft SQL Server Management Studio<br />------------------------------</p>
<p>Joining database on secondary replica resulted in an error.&nbsp; (Microsoft.SqlServer.Management.HadrTasks)</p>
<p>------------------------------<br />ADDITIONAL INFORMATION:</p>
<p>Attempting to join availability group resulted in an error. (Microsoft.SqlServer.Management.HadrTasks)</p>
<p>------------------------------</p>
<p>Failed to join the database 'GAlwaysOnDB' to the availability group 'GAG' on the availability replica 'GGAURAV-N03'. (Microsoft.SqlServer.Smo)</p>
<p>For help, click: <a href="https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;ProdVer=12.0.2000.8+((SQL14_RTM).140220-1752)&amp;EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&amp;LinkId=20476">https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;ProdVer=12.0.2000.8+((SQL14_RTM).140220-1752)&amp;EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&amp;LinkId=20476</a></p>
<p>------------------------------</p>
<p>An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)</p>
<p>------------------------------</p>
<p>The connection to the primary replica is not active.&nbsp; The command cannot be processed. (Microsoft SQL Server, Error: 35250)</p>
<p>For help, click: <a href="https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;ProdVer=12.00.2000&amp;EvtSrc=MSSQLServer&amp;EvtID=35250&amp;LinkId=20476">https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;ProdVer=12.00.2000&amp;EvtSrc=MSSQLServer&amp;EvtID=35250&amp;LinkId=20476</a></p>
<p>------------------------------<br />BUTTONS:</p>
<p>OK<br />------------------------------</p>
<p>&nbsp;</p>
<p>Few of the things to check:</p>
<p>1. You are able to connect to the secondary replica from the SSMS on the primary replica. If this fails, make sure we have the ports on which SQL is listening is opened on Firewall.</p>
<p>2. Also, make sure that the UDP port 1434 is opened so that browser is able to listen to the incoming connection. Else, it would be failing with the below error :&nbsp;</p>
<p>TITLE: Connect to Server<br />------------------------------</p>
<p>Cannot connect to GGAURAV-N02\DISTRIBUTION.</p>
<p>------------------------------<br />ADDITIONAL INFORMATION:</p>
<p>A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)</p>
<p>MSSQLSvc/GGAURAV.xxxxx.cxxxxx.xxxxxxt.com:1433</p>
<p>For help, click: <a href="https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;EvtSrc=MSSQLServer&amp;EvtID=-1&amp;LinkId=20476">https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;EvtSrc=MSSQLServer&amp;EvtID=-1&amp;LinkId=20476</a></p>
<p>------------------------------<br />BUTTONS:</p>
<p>OK<br />------------------------------</p>
<p>&nbsp;</p>
<p>3. Check if the port which is used for mirroring endpoint is opened in the firewall as the communication happens from this port.</p>
<p>4. Check if we are using the same domain account on all the replicas, else we have proper permissions on the endpoint for the service accounts for data to flow through.</p>
<p>5. Check if you have the SPN's created for the SQL instance. Please make use of setspn utility to check. setspn -L accountname.</p>
<p>&nbsp;</p>
<p>Happy Learning &amp; Troubleshooting!!</p>
<p><strong><span style="text-decoration: underline;">Disclaimer</span></strong>:&nbsp; Everything here,&nbsp;is my personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Moving database from On premise to Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/moving-database-from-on-premise-to-azure</link>
      <pubDate>Thu, 15 May 2014 04:16:11 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2014/05/15/moving-database-from-on-premise-to-azure/</guid>
      <description><![CDATA[It may be that you are trying to move your DB from on premise to Azure and using ALTER DATABASE...]]></description>
      <content:encoded><![CDATA[<p>It may be that you are trying to move your DB from on premise to Azure and using ALTER DATABASE command. Once you make the metadata change using ALTER DATABASE and then move the physical file to AZURE, the DB fails to come online with the following error message:</p>
<p>2014-05-15 04:31:59.370 spid26s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Error: 5120, Severity: 16, State: 142.<br />2014-05-15 04:31:59.370 spid26s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Unable to open the physical file "<a href="https://ifxx.blob.core.windows.net/iftpoc/xxx.mdf">https://ifxx.blob.core.windows.net/iftpoc/xxx.mdf</a>". Operating system error 12150: "12150(failed to retrieve text for this error. Reason: 317)".<br />2014-05-15 04:31:59.420 spid26s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Error: 17207, Severity: 16, State: 1.<br />2014-05-15 04:31:59.420 spid26s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'https://ifxx.blob.core.windows.net/iftpoc/xx_log.ldf'. Diagnose and correct the operating system error, and retry th<br />2014-05-15 04:31:59.420 spid26s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File activation failure. The physical file name "<a href="https://ifxx.blob.core.windows.net/ifxxc/xx_log.ldf">https://ifxx.blob.core.windows.net/ifxxc/xx_log.ldf</a>" may be incorrect.</p>
<p>&nbsp;</p>
<p>There are two issue here:</p>
<p>1.&nbsp; When you have moved the files, the files have been moved as block BLOB and not as page Blob. To remove this restriction, you have to make use of API mentioned by PG team to move the files.</p>
<p>2.&nbsp; There are already files with the same name on the blob container which we have created.</p>
<p>&nbsp;</p>
<p>The best option to move the database is to take a backup and then restore it with the move command:</p>
<p>USE master;&nbsp;<br />GO;&nbsp;<br /><br />RESTORE DATABASE TestDB3Restore&nbsp;&nbsp;<br /><br />FROM DISK = 'C:\BACKUP\TestDB3Restore.bak'&nbsp;&nbsp;<br /><br />WITH REPLACE,&nbsp;<br /><br />MOVE 'TestDB3Restore' TO '<a href="https://ifxx.blob.core.windows.net/iftpoc/TestDB3Restore.mdf'">https://ifxx.blob.core.windows.net/iftpoc/TestDB3Restore.mdf'</a>,&nbsp;&nbsp;&nbsp;<br /><br />MOVE 'TestDB3Restore_log' TO '<a href="https://ifxx.blob.core.windows.net/iftpoc/xxx.mdf">https://ifxx.blob.core.windows.net/iftpoc</a>/TestDB3Restore_log.ldf';&nbsp;<br />GO;&nbsp;</p>
<p>&nbsp;</p>
<p>Happy Learning &amp; Troubleshooting!!</p>
<p><strong><span style="text-decoration: underline;">Disclaimer</span></strong>:&nbsp; Everything here,&nbsp;is my personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.</p>]]></content:encoded>
    </item>
    <item>
      <title>Explicit DBO permissions on TempDB for a domain group</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/explicit-dbo-permissions-on-tempdb-for-a-domain-group</link>
      <pubDate>Sun, 20 Apr 2014 23:18:17 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2014/04/20/explicit-dbo-permissions-on-tempdb-for-a-domain-group/</guid>
      <description><![CDATA[To do this we created a stored procedure and added it as a startup procedure so that whenever the...]]></description>
      <content:encoded><![CDATA[<p>To do this we created a stored procedure and added it as a startup procedure so that whenever the SQL server service is restarted then the stored procedure will automatically grant the access to the group on the tempdb. <br /><br />Add the domain group to the SQL server logins and then create the following procedure: <br /><br /><br />create proc sp_grant_access <br /><br />as&nbsp;<br />exec <br />tempdb..sp_grantdbaccess 'ggaurav03\tim','g22'&nbsp;<br /><br />&nbsp;exec <br />tempdb..sp_addrolemember 'db_owner','g22'&nbsp; <br /><br />go&nbsp;<br /><br />sp_procoption 'sp_grant_access','startup', 'on'</p>
<p>&nbsp;</p>
<p>Happy Learning &amp; Troubleshooting!!</p>
<p><strong><span style="text-decoration: underline;">Disclaimer</span></strong>:&nbsp; Everything here,&nbsp;is my personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.</p>]]></content:encoded>
    </item>
    <item>
      <title>Server Manager consuming memory</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/server-manager-consuming-memory</link>
      <pubDate>Wed, 16 Apr 2014 22:25:55 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2014/04/16/server-manager-consuming-memory/</guid>
      <description><![CDATA[You may have seen issues on Windows 2012 server, where even after the users have disconnected from...]]></description>
      <content:encoded><![CDATA[<p>You may have seen issues on Windows 2012 server, where even after the users have disconnected from the server, their session is still consuming the memory. When you open task manager, you would see the session manager of the disconnected session taking huge amount of memory.<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/96/3404.ServerManager.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-96/3404.ServerManager.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/96/3404.ServerManager.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-96/3404.ServerManager.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>This happens when people with disconnected sessions are&nbsp;member of the Administrators group and logs on to the computer. When a member of the local admin group logs onto the machine, server manager starts automatically and stays in the background. You can modify default opening behavior of the Server Manager and Initial Configuration Tasks windows by editing the following registry settings.</p>
<p>&nbsp;</p>
<table>
<tbody>
<tr><th colspan="1">Setting name</th><th colspan="1">Location</th><th colspan="1">Default value</th><th colspan="1">Possible values</th></tr>
<tr>
<td colspan="1">
<p>Do not open Server Manager at logon</p>
</td>
<td colspan="1">
<p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Server Manager</p>
</td>
<td colspan="1">
<p>0</p>
</td>
<td colspan="1">
<p><strong>0</strong> to disable and open the window normally; <strong>1</strong> to enable and prevent the window from opening.</p>
</td>
</tr>
<tr>
<td colspan="1">
<p>Do not open Initial Configuration Tasks at logon</p>
</td>
<td colspan="1">
<p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Server Manager\Initial Configuration Tasks</p>
</td>
<td colspan="1">
<p>0</p>
</td>
<td colspan="1">
<p><strong>0</strong> to disable and open the window normally; <strong>1</strong> to enable and prevent the window from opening.</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>More information can be found in <a href="https://technet.microsoft.com/en-us/library/cc753319.aspx#BKMK_RunningRMT">https://technet.microsoft.com/en-us/library/cc753319.aspx#BKMK_RunningRMT</a> .</p>
<p>&nbsp;</p>
<p>Happy Learning &amp; Troubleshooting!!</p>
<p><strong><span style="text-decoration: underline;">Disclaimer</span></strong>:&nbsp; Everything here,&nbsp;is my personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.</p>]]></content:encoded>
    </item>
    <item>
      <title>Adding a Remote Distributor for a Transactional Replication</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/adding-a-remote-distributor-for-a-transactional-replication</link>
      <pubDate>Fri, 11 Apr 2014 04:59:55 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2014/04/11/adding-a-remote-distributor-for-a-transactional-replication/</guid>
      <description><![CDATA[You may encounter the following messages when creating a remote Distributor :
&nbsp;
TITLE:...]]></description>
      <content:encoded><![CDATA[<p>You may encounter the following messages when creating a remote Distributor :</p>
<p>&nbsp;</p>
<p>TITLE: Configure Distribution Wizard<br />------------------------------</p>
<p>SQL Server could not connect to the Distributor using the specified password.</p>
<p>For help, click: <a href="https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;ProdVer=11.0.2100.60&amp;EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&amp;EvtID=CantConnectAdminPassword&amp;LinkId=20476">https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;ProdVer=11.0.2100.60&amp;EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&amp;EvtID=CantConnectAdminPassword&amp;LinkId=20476</a></p>
<p>------------------------------<br />ADDITIONAL INFORMATION:</p>
<p>An error occurred during decryption.<br />There is no remote user 'distributor_admin' mapped to local user '(null)' from the remote server '759D11CB-6B1A-4AAD-9D8E-5A89B2DAA151'. (Microsoft SQL Server, Error: 15466)</p>
<p>For help, click: <a href="https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;ProdVer=10.50.4000&amp;EvtSrc=MSSQLServer&amp;EvtID=15466&amp;LinkId=20476">https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;ProdVer=10.50.4000&amp;EvtSrc=MSSQLServer&amp;EvtID=15466&amp;LinkId=20476</a></p>
<p>------------------------------<br />BUTTONS:</p>
<p>OK<br />------------------------------</p>
<p>When you would try to create a Linked Server, it would fail with the below message :</p>
<p>&nbsp;</p>
<p>TITLE: Microsoft SQL Server Management Studio<br />------------------------------</p>
<p>Create failed for LinkedServer 'XX\XX.&nbsp; (SqlManagerUI)</p>
<p>For help, click: <a href="https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;ProdVer=10.50.4000.0+((KJ_PCU_Main).120628-0827+)&amp;EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&amp;EvtID=Create+LinkedServer&amp;LinkId=20476">https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;ProdVer=10.50.4000.0+((KJ_PCU_Main).120628-0827+)&amp;EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&amp;EvtID=Create+LinkedServer&amp;LinkId=20476</a></p>
<p>------------------------------<br />ADDITIONAL INFORMATION:</p>
<p>An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)</p>
<p>------------------------------</p>
<p>'(null)' is an invalid product name. (Microsoft SQL Server, Error: 15429)</p>
<p>For help, click: <a href="https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;ProdVer=10.50.4000&amp;EvtSrc=MSSQLServer&amp;EvtID=15429&amp;LinkId=20476">https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;ProdVer=10.50.4000&amp;EvtSrc=MSSQLServer&amp;EvtID=15429&amp;LinkId=20476</a></p>
<p>------------------------------<br />BUTTONS:</p>
<p>OK<br />------------------------------</p>
<p>&nbsp;</p>
<p>1. &nbsp;Please check if you are logged in with the service account to the machine.</p>
<p>2. Check if all the servers &amp; agent ( publisher, distributor) are running with the same service account.</p>
<p>3. Check if there is no issues with SMK ( service master key).</p>
<p>4. Check if the service account is added to the logins on the SQL side.</p>
<p>5. Reboot the machine after adding the service account to the logins, if it was not added so that the SMK can be regenerated.</p>
<p>6. Check if there are any security related errors using :</p>
<p class="L0"><span class="pln">&nbsp;&nbsp;&nbsp;&nbsp; SELECT </span><span class="pun">*</span><span class="pln"> FROM sys</span><span class="pun">.</span><span class="pln">dm_os_ring_buffers </span><span class="pln">WHERE ring_buffer_type </span><span class="pun">=</span><span class="str">'RING_BUFFER_SECURITY_ERROR'</span></p>
<p class="L0"><span class="str">7. Check if the SPN's are fine for the SQL instance as SPN's are used for Kerberos authentication.</span></p>
<p class="L0"><span class="str">8. If it's a cluster check if we have the following key : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\&lt;Instance Name&gt;\Security.</span></p>
<p class="L0"><span class="str">9. If entropy key is missing, then we have to regenerate the SMK ( service master key).</span></p>
<p class="L0"><span class="str">10. Check if we are able to access the "AppData" folder with the SQL agent account.</span></p>
<p class="L0">&nbsp;</p>
<p class="L0"><span class="str">For login failure of distributor_admin we can follow : <a href="https://blogs.msdn.com/b/sqlserverfaq/archive/2009/12/21/error-messages-and-the-solutions-related-to-distributor-admin-login.aspx">https://blogs.msdn.com/b/sqlserverfaq/archive/2009/12/21/error-messages-and-the-solutions-related-to-distributor-admin-login.aspx</a></span><span class="str"></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Master DB restore &amp; Service Master key</title>
      <link>https://docs.microsoft.com/archive/blogs/ggaurav/master-db-restore-service-master-key</link>
      <pubDate>Mon, 07 Apr 2014 02:41:11 GMT</pubDate>
      <dc:creator><![CDATA[GauravSrivastava]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ggaurav/2014/04/07/master-db-restore-service-master-key/</guid>
      <description><![CDATA[If we don&rsquo;t have a recent master backup and have to make use of the files from the DR server,...]]></description>
      <content:encoded><![CDATA[<p>If we don&rsquo;t have a recent master backup and have to make use of the files from the DR server, then as long as our target instance matches the path and build requirements we can restore master and bring it up. If the build is different , we will get an error. If the path for the system databases are different, then we will not be able to start SQL instance after restore of master and have to start the instance with trace flags to prevent recovery of system databases and then alter the path of the system databases to point to the current path. Also you will need to change several configurations like sys.servers, local logins, etc.</p>
<p>The biggest question when we are doing such type of restore is related to encryption of SMK, however &nbsp;as far as encryption is concerned, if the SQL Server on the machine to which the master database is restored to starts with the same service account as the original server we should be covered because <strong>the Service Master Key is encrypted using the service account and the machine account so service account decryption should still be valid.</strong></p>
<p><strong>&nbsp;</strong>For a complete list of various metadata maintained in master that might need tweaks, refer to <a href="https://technet.microsoft.com/en-us/library/ms187580.aspx" target="_blank">Manage Metadata When Making a Database Available on Another Server Instance (SQL Server)</a>&nbsp;(<a href="https://technet.microsoft.com/en-us/library/ms187580.aspx">https://technet.microsoft.com/en-us/library/ms187580.aspx</a>)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>