<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Bill's SQL Server Blog]]></title><description><![CDATA[Bill's SQL Server Blog]]></description><link>https://billg.sqlteam.com/</link><image><url>https://billg.sqlteam.com/favicon.png</url><title>Bill&apos;s SQL Server Blog</title><link>https://billg.sqlteam.com/</link></image><generator>Ghost 6.32</generator><lastBuildDate>Tue, 21 Apr 2026 07:12:34 GMT</lastBuildDate><atom:link href="https://billg.sqlteam.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[IsItSQL 2.0]]></title><description><![CDATA[I've been making small improvements in IsItSQL and finally released a new version.  The goal of the application is for non-SQL Server experts to be able to see quickly if SQL Server is having a problem.  It also works for my clients to send screen shots so I can see what is happening.]]></description><link>https://billg.sqlteam.com/2024/01/20/isitsql-2-0/</link><guid isPermaLink="false">65ac00cea4bd9f00010a9ab8</guid><category><![CDATA[Is It SQL]]></category><category><![CDATA[SQL Server]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Sat, 20 Jan 2024 18:08:16 GMT</pubDate><content:encoded><![CDATA[<p>I&apos;ve been making small improvements in IsItSQL and finally released a new version.  You can download it at <a href="https://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">https://www.scalesql.com/isitsql/</a>.</p><p>The goal of the application is for non-SQL Server experts to be able to see quickly if SQL Server is having a problem.  It also works for my clients to send screen shots so I can see what is happening.</p><p>The new features fell into a broad range of categories.</p><h2 id="waits">Waits</h2><p>Prior to 2.0, waits were captured every minute from <code>sys.dm_os_wait_stats</code> which means we only saw the wait when it ended. &#xA0;Starting in 2.0, waits are polled every second from running processes and the page is updated every minute.</p><p>This means we only see waits for user sessions and don&apos;t include waits for background processes. &#xA0;This shows fewer waits, but they are timely and actionable.  There is a server wait page at <code>/server/:server_key/w2</code> that compares the two waits. </p><figure class="kg-card kg-image-card"><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2024/01/image-1.png" class="kg-image" alt loading="lazy" width="1104" height="402" srcset="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/size/w600/2024/01/image-1.png 600w, https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/size/w1000/2024/01/image-1.png 1000w, https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2024/01/image-1.png 1104w" sizes="(min-width: 720px) 720px"></figure><p>The Waits on the left are the old-style waits for all processes &#x2013; including background sessions.  The Waits on the right are polled every second and only show the Waits from user sessions.</p><h2 id="blocking">Blocking</h2><p>The application displays better blocking information.  The sessions are listed by how many other sessions they are blocking.  For each session, it shows the root blocker and the immediate blocker (greyed out).  This refreshes in real-time as you refresh the page.  It also displays orphaned sessions that are blocking. </p><figure class="kg-card kg-image-card"><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2024/01/image-4.png" class="kg-image" alt loading="lazy" width="1049" height="252" srcset="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/size/w600/2024/01/image-4.png 600w, https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/size/w1000/2024/01/image-4.png 1000w, https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2024/01/image-4.png 1049w" sizes="(min-width: 720px) 720px"></figure><h2 id="memory-reporting">Memory Reporting</h2><ul><li>There is a memory page at <code>/memory</code> that lists all the SQL Servers, OS memory, SQL Server memory maximum, used, and OS memory free.  I find I have problems if I let OS Available Memory get below 5%.</li></ul><figure class="kg-card kg-image-card"><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2024/01/image-2.png" class="kg-image" alt loading="lazy" width="931" height="155" srcset="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/size/w600/2024/01/image-2.png 600w, https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2024/01/image-2.png 931w" sizes="(min-width: 720px) 720px"></figure><h2 id="file-configuration">File Configuration</h2><p>Many of my clients run multiple parallel data centers.  Keeping multiple instances up to date is annoying and tedious.  This version allows the list of monitored servers to be stored in multiple <code>HCL</code> files.  Those files look like this:</p><pre><code>server &quot;D40\SQL2016&quot; {
  tags = [&quot;newer&quot;, &quot;prod&quot;, &quot;dashboard&quot;]
  credential = &quot;sqlmonitor&quot;
  key = &quot;d40-sql2016&quot;
}</code></pre><p>Servers can be grouped however you like.  We use Puppet to push these files to all the servers that run IsItSQL.  We have files for development and then production for each business unit. This gives you cool URLs like   <code>isitsql.corp.com/servers/d40-sql2016</code> if you set the key.  </p><p>You can also use this feature to assign friendly names to Availability Groups.  There are more details in an <code>optional</code> folder in the ZIP file as well as a linter to help with editing the files before pushing.&#xA0;</p><h2 id="other">Other</h2><ul><li>The Availability Group page now has a link to JSON output.  We use this for simple alerting for heath state &#x2013; for example, online but not healthy.  It also displays the first Listener name instead of the AG name.  It displays the send and redo queue sizes.  Warning and Alert thresholds can be configured for those values.</li><li>On the database page, if a database is in an Availability Group, it displays the role, health, and send and redo queue sizes.  </li><li>Improved support for SQL Server on Linux throughout the application. </li><li>Added a Server Connection Detail page at&#xA0;<code>/server/:server_key/conn</code> that shows if you are getting a Kerberos connection.</li><li>Improved reporting of <code>tempdb</code> size.</li><li>The OS version is shown in more places.  In the screen shot for Waits above, The Windows version and architecture are shown.  This should also work for Linux and containers.  There is a SQL Server Versions page that lists the SQL Server Version, Edition, OS Version, installed date, cores, and memory.  That can be downloaded as a CSV.</li><li>SQL Servers running in containers ignore the &quot;Other&quot; CPU category.</li><li>The application now uses the native GO SQL Server driver supplied by Microsoft instead of the ODBC driver.</li><li>The waits and metrics persist between restarts.  They also display per minute which helps if servers don&apos;t poll for a time.</li><li>The settings page can limit the settings changes to members of a domain group.</li></ul>]]></content:encoded></item><item><title><![CDATA[SQL Server Desired State Configuration]]></title><description><![CDATA[<p>At one of my clients, I&apos;ve seen the benefits of using tools like Puppet to push configurations to servers.  I&apos;ve long tried to write idempotent configuration scripts for my servers.  Those are scripts that can be run multiple times without changing the end result.  They try</p>]]></description><link>https://billg.sqlteam.com/2020/07/01/sql-server-desired-state-configuration/</link><guid isPermaLink="false">5eb18b086ee7e90039570d1d</guid><category><![CDATA[Desired State Configuration]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Wed, 01 Jul 2020 12:48:22 GMT</pubDate><content:encoded><![CDATA[<p>At one of my clients, I&apos;ve seen the benefits of using tools like Puppet to push configurations to servers.  I&apos;ve long tried to write idempotent configuration scripts for my servers.  Those are scripts that can be run multiple times without changing the end result.  They try to bring the server to the state that I want and only make changes when needed.  A simple example is to only add the new database mail account when it doesn&apos;t exist.</p><p>I spent time testing Puppet, Chef, Ansible, Microsoft&apos;s own DSC tools.  In the end I wasn&apos;t happy with any of them.  And so I did what I often do in situations like this .... I wrote my own.  I mean, how hard can it be?  Right?  &#x1F60E;</p><p>My goal is to help you to define the state of your servers in version-controlled files and push that to your SQL Servers.  That starts with a configuration files that looks something like this:</p><figure class="kg-card kg-image-card"><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2020/05/hcl-2.png" class="kg-image" alt loading="lazy"></figure><p>This example will:</p><ul><li>Set the <code>model</code> database to SIMPLE recovery mode</li><li>Disable the <code>sa</code> login</li><li>Set the cost threshold for parallelism to 50</li></ul><p>Applying these change to my local DEV box produces these results:</p><figure class="kg-card kg-image-card"><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2020/05/cmd-2.png" class="kg-image" alt loading="lazy"></figure><p>Running it a second time doesn&apos;t produce any changes.  </p><p>You can download this from my corporate site at <a href="https://www.scalesql.com/sqldsc/?ref=billg.sqlteam.com">SQL Server Desired State Configuration</a> utility page.  I&apos;ve already written <a href="https://docs.sqldsc.com/?ref=billg.sqlteam.com">extensive documentation</a> to get you started.  If you have any questions, please use my <a href="https://www.scalesql.com/contact/?ref=billg.sqlteam.com">contact page</a> to send me an email.</p>]]></content:encoded></item><item><title><![CDATA[Naming Linked Servers v2]]></title><description><![CDATA[<p>I&apos;ve always had a love-hate relationship with linked servers. &#xA0;On one hand, they are very easy to use and query. &#xA0;On the other they can be a pain to configure, secure, and performance tune.</p><p>I wrote about <a href="https://billg.sqlteam.com/2011/08/15/how-to-name-linked-servers/">naming linked servers</a> in 2011. &#xA0;After living with</p>]]></description><link>https://billg.sqlteam.com/2020/04/28/capturing-linked-server-activity/</link><guid isPermaLink="false">5ea819381ef335003935dbe9</guid><category><![CDATA[SQL Server]]></category><category><![CDATA[linked-servers]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Tue, 28 Apr 2020 12:38:34 GMT</pubDate><content:encoded><![CDATA[<p>I&apos;ve always had a love-hate relationship with linked servers. &#xA0;On one hand, they are very easy to use and query. &#xA0;On the other they can be a pain to configure, secure, and performance tune.</p><p>I wrote about <a href="https://billg.sqlteam.com/2011/08/15/how-to-name-linked-servers/">naming linked servers</a> in 2011. &#xA0;After living with various schemes, I&apos;m happy with something like what&apos;s below. &#xA0;This would probably work well into the low hundreds of servers.</p><ul><li>Create a zone for static DNS entries. &#xA0;This should be separate from any other domains you have. &#xA0;Something simple like <code>static.loc</code> is fine.</li><li>You can use either &quot;A&quot; records or CNAMEs depending on what you&apos;re pointing to. &#xA0;CNAMEs can point to availability group listeners. &#xA0;&quot;A&quot; records can point to IP addresses. &#xA0;We still use &quot;A&quot; records for the AGs and have tooling around the cross-data center fail over process to push changes to all DNS servers.</li><li>All the hosts in this zone are named something like <code>db-txn</code> or <code>db-dw</code> or <code>db-apps</code>. &#xA0;Something short, simple, and descriptive. &#xA0;So the full name would be <code>db-txn.static.loc</code>. &#xA0;</li><li>We use prefixes for different types of &quot;things&quot;. &#xA0;So all the DNS entries for databases get a <code>db</code> prefix.</li><li>All linked servers, applications, and users should point to these static DNS entries and NEVER the actual server name or IP address.</li><li>All linked servers should be named for these DNS entries. &#xA0;For example, the linked server that points to <code>db-txn.static.loc</code> is named <code>db-txn</code>. &#xA0;I&apos;ve also considered naming them with a prefix like <code>ls-db-txn</code> but haven&apos;t needed that level of indirection so far.</li><li>The hyphen is the key part of this name. &#xA0;That forces &#xA0;the name to always be enclosed with brackets. &#xA0;So you have to run <code>SELECT [name] FROM [db-txn].master.sys.databases</code>. &#xA0;That makes it MUCH easier to find TSQL code using the linked servers.</li></ul><p>Most of these static DNS entries are named for a server (one DNS entry per server). &#xA0;Some are named for specific databases on a server. &#xA0;We try to decide what group of databases could logically migrate together. &#xA0;Many of our databases are on their third generation of server with the same static DNS name.</p><p>For example, packaged software from ACME Corporation that requires a database might get a DNS named <code>db-acme.static.loc</code>.</p><p>Hopefully this helps your management of linked servers. &#xA0;</p>]]></content:encoded></item><item><title><![CDATA[ClearTrace for Extended Events]]></title><description><![CDATA[<p>I found the time to update ClearTrace to support Extended Events. &#xA0;You can download <a href="https://www.scalesql.com/cleartrace/download/?ref=billg.sqlteam.com">ClearTrace for Extended Events</a> from my corporate site. &#xA0;A few notes about this build</p><ul><li>It&apos;s a very early release. &#xA0;Everything seems to work for me and it passes all the tests.</li></ul>]]></description><link>https://billg.sqlteam.com/2019/07/07/cleartrace-for-extended-events/</link><guid isPermaLink="false">5d2268fb64245a0038b64851</guid><category><![CDATA[ClearTrace]]></category><category><![CDATA[SQL Server]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Sun, 07 Jul 2019 22:05:44 GMT</pubDate><content:encoded><![CDATA[<p>I found the time to update ClearTrace to support Extended Events. &#xA0;You can download <a href="https://www.scalesql.com/cleartrace/download/?ref=billg.sqlteam.com">ClearTrace for Extended Events</a> from my corporate site. &#xA0;A few notes about this build</p><ul><li>It&apos;s a very early release. &#xA0;Everything seems to work for me and it passes all the tests. &#xA0;Please report any issues in the <a href="https://forums.sqlteam.com/c/cleartrace?ref=billg.sqlteam.com">ClearTrace support forums</a>.</li><li>This version is hard-coded to require SQL Server 2017 SMO. &#xA0;There&apos;s a link for it on the download page.</li><li>The previous version supported choosing files via a wilcard or selecting the first trace file and allowing it to process all the files. &#xA0;Right now, this version only allows a multi-file selection through the dialog box. &#xA0;That has worked much better for me given how trace files are named.</li><li>The database format is the same as ClearTrace for Trace. &#xA0;However the SQL batches reported by XE can be formatted differently than trace. &#xA0;Which means my &quot;normalized&quot; SQL may be different. &#xA0;I&apos;d enourage you to start a new database &#x2013; or at least new trace groups.</li><li>Right now it only suports <code>rpc_completed</code> and <code>sql_batch_completed</code> events. &#xA0;</li><li>The command-line version isn&apos;t included in this download. &#xA0;It really needs the wildcard bit to work again before it&apos;s very useful.</li></ul><p>Download and it take it for a spin and give me any feedback in the <a href="https://forums.sqlteam.com/c/cleartrace?ref=billg.sqlteam.com">forums</a>. &#xA0;</p>]]></content:encoded></item><item><title><![CDATA[Running GO as a Windows Service]]></title><description><![CDATA[Checklist for successfully running a GO executable as a Windows service]]></description><link>https://billg.sqlteam.com/2018/07/17/running-go-as-a-windows-service/</link><guid isPermaLink="false">5ce53e64b957d1001730bf5c</guid><category><![CDATA[go]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Tue, 17 Jul 2018 00:35:47 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Lately I&apos;ve been spending time writing GO (or GOLANG) applications.  I&apos;m a big fan of the language.  Often what I write needs to run as a Windows service.  I&apos;ve found a few things you can do to make your life easier.</p>
<h1 id="useashell">Use a Shell</h1>
<p>There are three &quot;shells&quot; I&apos;ve found that you can wrap your code in.  That means you plug your code into these &quot;shell&quot; applications.</p>
<ul>
<li>The <a href="https://godoc.org/golang.org/x/sys/windows/svc?ref=billg.sqlteam.com">standard GO Windows service shell</a>.  This provides basic functionality to install, debug, remove, start, and stop the service.  It also includes a package to write to the Windows Event Log.</li>
<li>My modified version of the GO Windows service shell at <a href="https://github.com/billgraziano/go-windows-svc?ref=billg.sqlteam.com">https://github.com/billgraziano/go-windows-svc</a>.  It includes all the features of the official version and adds a few things I&apos;ve found helpful.
<ul>
<li>The code is reorganized to make it more explicit where to make your changes and add your code.  All your work can be done in <code>main.go</code>.</li>
<li>It has a <code>setup()</code> routine that will exit the service if it returns an error.  I use that to configure basic logging and configuration and anything else I can&apos;t continue without.</li>
<li>I added the excellent <a href="https://github.com/pkg/errors?ref=billg.sqlteam.com">https://github.com/pkg/errors</a> package for better errors.</li>
</ul>
</li>
<li><a href="https://github.com/kardianos/service?ref=billg.sqlteam.com">The Kardianos &quot;service&quot; package</a>.  This works on Windows, Linux, OSX, etc.  I haven&apos;t worked with it but it seems well used.  If I&apos;d known this was available when I was starting I might be using it instead.</li>
</ul>
<h1 id="fixthedirectory">Fix the Directory</h1>
<p>Windows services run in <code>C:\windows\system32</code> by default.  So that&apos;s where your logging will probably go.  And that&apos;s where it will look for configuration files.  I use code like this to look for these next to my executable.</p>
<pre><code>var s string
var err error 
s, err = os.Executable()
if err != nil {
  return &quot;&quot;, errors.Wrap(err, &quot;os.executable&quot;)
}
ext := filepath.Ext(s)
outfile := s[0:len(s)-len(ext)] + &quot;.toml&quot;
return outfile, nil
</code></pre>
<h1 id="changethestartupaccount">Change the Startup Account</h1>
<p>After installing the service, I usually change it to run as a domain or managed service account if there&apos;s database access involved.  You&apos;ll also need to set it to start Automatically.</p>
<h1 id="grantpermissionsonthedirectory">Grant Permissions on the Directory</h1>
<p>And of course, that service account probably won&apos;t have permissions to read your configuration file or write to a log file.  So make sure to grant those on the directory where your EXE lives.</p>
<h1 id="checktheeventlog">Check the Event Log</h1>
<p>If you&apos;re using my shell or the GO version, any errors preventing the service from starting should be logged to the Windows Application Log.  I&apos;m not sure about the Kardionos version.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Send SQL Server Extended Events to Logstash (ELK)]]></title><description><![CDATA[xelogstash is a great way to send SQL Server Extended Events to Logstash and Elastic Search and Kibana (ELK)]]></description><link>https://billg.sqlteam.com/2018/06/13/send-sql-server-extended-events-to-logstash-elk/</link><guid isPermaLink="false">5ce53e64b957d1001730bf5b</guid><category><![CDATA[SQL Server]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Wed, 13 Jun 2018 11:24:13 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>ELK (or Elastic Search, Logstash, Kibana) is taking over one of my clients.  And I have to admit it&apos;s a very handy tool.  They are pushing all their logs into it and it&apos;s ver easy to search them.</p>
<p><em>Fair warning:  My ELK skills and knowledge are very rudimentary at this point</em>.  Elastic Search is the search engine built on top of Apache&apos;s Lucene.  Logstash is one of many ways to take in log files and push them into Elastic Search.  Kibana is the visualization tool that sits on top of Elastic Search.  It&apos;s all open source as well as available for purchase through the Elastic Search company.  There are also numerous online services providing the ELK stack.</p>
<p>Getting data from SQL Server tables into the ELK stack is straightforward IF the tables have an IDENTITY column -- or any single column, increasing, numeric primary key.  You can use the <a href="https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html?ref=billg.sqlteam.com">JDBC input plugin</a> for Logstash and import your data.  We use this for SSRS execution logs and a few application specific logs.</p>
<p>But I wanted to import SQL Server Extended Events and they use the file name and file offset to keep track of where you are in the file. So I decided to write a little utility to read extended event files and write them to Logstash.  Because really, how hard could it be?</p>
<p>Six weeks and 160 commits later, <a href="https://github.com/billgraziano/xelogstash?ref=billg.sqlteam.com">XELOGSTASH</a> is mostly, finally, sort of ready to see the light of day.  It&apos;s a command-line application and reads extended events, converts them to JSON, and writes them to a Logstash installation.</p>
<p>I run it every minute from a SQL Server Agent job and process roughly 30 servers.  They generate 1,000 events per minute.  Once you get the data in ELK, you get a very basic visualization (this is from my development box).</p>
<p><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2018/06/xelogstash-kibana-ss.png" alt="Kibana Screenshot" loading="lazy"></p>
<p>xelogstash converts extended event data and actions to fields in Elastic Search.</p>
<p>Here are some use cases I&apos;ve found for this data:</p>
<ul>
<li>Find all the servers a domain account uses.  Or find all the clients that have connected to any of the nodes of an AG over the last two weeks.</li>
<li>Show SQL Server exceptions across multiple servers while new applications are being deployed.  This is especially helpful for permission errors when applications are deployed using new service accounts.</li>
<li>Show me the login failures across all my servers</li>
<li>Show me the SQL Server Error Log and AlwaysOn_health events across all AG nodes in one integrated timeline.</li>
<li>Show me the timeline of all failed SQL Server Agent jobs for the last week across all servers.</li>
</ul>
<p>My &quot;little&quot; application ended up doing quite a bit more than just reading extended event files and writing them to ELK.</p>
<ul>
<li>It&apos;s multi-threaded and can process multiple servers at once.  I usually run it at 8 workers to process 30 servers and it never uses more than 10% of a 2 core VM.  The initial loads can be much larger but once you get caught up it&apos;s very light.</li>
<li>You have LOTS of control of the JSON.  You can rename fields, define common fields, and control the overall structure of the JSON.  For example, at one client, all my XE specific fields get nested under an &quot;mssql&quot; field.  When testing with some ELK as a Service providers, they wanted all the fields at the root level.  That&apos;s one line of configuration.</li>
<li>It enriches the extended event with data such as domain, server name, version, computer, database name from database ID, etc.  It also builds a description field where I try to build a single helpful message field.  For a SQL statement, that includes the resource usage and part of the SQL statement.</li>
<li>It can import SQL Server Agent job history for all jobs or just failed jobs.  You can do that with a basic query but this also enriches the data as described above.</li>
<li>It can write it&apos;s own log messages to Logstash (of course).  As well as standard out and a local log file.  Or all three at once.</li>
</ul>
<p>It&apos;s written using the GO language but you can download compiled executables.  If you happen to be one of the people using SQL Server and ELK, please give it a try and give me some feedback.</p>
<p>If you just want to test, I used <a href="https://logz.io/?ref=billg.sqlteam.com">logz.io</a> for testing because they have a free tier.  The works best with the following settings:</p>
<ul>
<li>Enable <code>strip_crlf</code></li>
<li>Copy <code>xe_description</code> to <code>message</code> in the &quot;copies&quot; setting</li>
<li>Set <code>timestamp_field_name</code> to <code>@timestamp</code></li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[SQL Server Extended Events in Production]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>I have finally jumped on the Extended Events bandwagon.  It was tough to pry Trace and Profiler from my cold, legacy hands!  But I&apos;m mostly there.  I&apos;m still working on a good way to hook up ClearTrace to these things.  It might be as simple as</p>]]></description><link>https://billg.sqlteam.com/2018/05/16/sql-server-extended-events-in-production/</link><guid isPermaLink="false">5ce53e64b957d1001730bf5a</guid><category><![CDATA[sql]]></category><category><![CDATA[audit]]></category><category><![CDATA[logging]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Wed, 16 May 2018 14:02:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>I have finally jumped on the Extended Events bandwagon.  It was tough to pry Trace and Profiler from my cold, legacy hands!  But I&apos;m mostly there.  I&apos;m still working on a good way to hook up ClearTrace to these things.  It might be as simple as requiring you to pull down the XE files.  I&apos;d like to make it simpler though.</p>
<p>I&apos;ve read lots of article about Extended Events that describe how to create and query them but very few about which ones are helpful.  Here are the events I&apos;ve been capturing on our production servers that have been helpful.</p>
<h2 id="fields">Fields</h2>
<p>We try to capture a consistent set of fields in addition to the event specific fields. Here&apos;s what we capture:</p>
<ul>
<li><code>client_app_name</code></li>
<li><code>client_hostname</code></li>
<li><code>client_pid</code>.  This is the Process ID on the client that is connecting.  If needed you can consult logs on the client to learn more about what this was.</li>
<li><code>database_name</code>.  Sometimes I capture <code>database_id</code> also.  Especially in older versions where <code>database_name</code> isn&apos;t available.</li>
<li><code>event_sequence</code></li>
<li><code>server_instance_name</code>.  Yes, this is redundant since you&apos;re already connecting to the server and you can query the server name.  I suggest you capture it anyway.  It&apos;s very helpful when you start to centralize these.</li>
<li><code>server_principal_name</code></li>
<li><code>session_id</code></li>
<li><code>sql_text</code></li>
</ul>
<p>There are a few fields I&apos;ve thought about capturing or have captured but found less valuable.</p>
<ul>
<li>Query and Plan hashes.  I had high hopes for these but haven&apos;t ever used them.</li>
<li>Session Server Principal Name.  We don&apos;t do any impersonation that I know of so this hasn&apos;t been useful so far.  I&apos;m still mulling over collecting this instead of just the server principal name.  Ideally I would collect them both and flag any differences.  But I&apos;m not there yet.</li>
</ul>
<h2 id="events">Events</h2>
<p>I typically run two Extended Event sessions: one for logins and one for everything else. We keep logins going back for as long as can on the server.  Right now I&apos;m running ten 50 MB files for these on most servers.  A few high traffic servers have twenty 50 MB files.  It&apos;s also important to filter for <code>is_cached</code> is false.</p>
<p>Many of these events overlap with the <code>system_health</code> and <code>AlwaysOn_health</code> sessions.  I don&apos;t mind the duplicates.  They don&apos;t occur all that often.</p>
<h3 id="errorreported">Error Reported</h3>
<p>I was initially filtering for just severity 14 (security related) and severity &gt;= 16 (general errors).  I&apos;m starting to experiment with capturing 11 and higher but I don&apos;t know enough to write anything meaningful yet.  I also filter out 17830.  For some reason, we get LOTS of them and I&apos;ve never tracked down why.  YMMV.</p>
<p>This event has proven very, very helpful.  I capture our applications doing all kinds of interesting things.  When we do new deployments, I watch this closely.  I often notice problems before the application teams because I can see the application generating errors.  I see permission errors, primary key violations, syntax errors, and all kinds of crazy app stuff.  We&apos;re just starting a project to give our developers and others in the organization easy access to these events.</p>
<p>You will also see pesky things like user generated errors.  You can filter those out in your reporting.  But I&apos;m not a fan of using RAISERROR with a severity higher than 10 unless it&apos;s an actual exception that you plan to fix.</p>
<h3 id="blockedprocessreport">Blocked Process Report</h3>
<p>This requires you to set the <a href="https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/blocked-process-threshold-server-configuration-option?view=sql-server-2017&amp;ref=billg.sqlteam.com">blocked process threshold</a> on your server.  I typically set it at 15 seconds or 60 seconds for servers that run big long ugly queries and 5 or 10 seconds for more transactional system.  The trick is to set a value that generates enough but not too many.  <a href="https://docs.microsoft.com/en-us/sql/relational-databases/policy-based-management/increase-or-disable-blocked-process-threshold?view=sql-server-2017&amp;ref=billg.sqlteam.com">And don&apos;t set it below 5</a>. But it may take some experimentation.</p>
<p>I use this to answer the question, &quot;What was blocking our transactions at 5:30 AM this morning?&quot;</p>
<h3 id="deadlocks">Deadlocks</h3>
<p>There are two deadlock events I capture: <code>lock_deadlock_chain</code> and <code>xml_deadlock_report</code>.  Between the two of them I get enough information to figure out what happened.</p>
<h3 id="highresourcesql">High Resource SQL</h3>
<p>This is four events, <code>rpc_completed</code>, <code>sp_statement_completed</code>, <code>sql_batch_completed</code>, <code>sql_statement_completed</code> and I capture all four.  The batch level and statement level captures give me slightly different views into what was running.  My default filter for these is CPU &gt; 1 second or logical reads &gt; 500,000.  You&apos;ll need to tweak these based on your environment and how much data you want to review.  But these have proven to be a good starting point.</p>
<h3 id="errorlogwritten">Error Log Written</h3>
<p>I typically don&apos;t refer to this one as often but it&apos;s nice to have in place with the others.</p>
<h3 id="objectcreatedalteredordeleted">Object Created, Altered, or Deleted</h3>
<p>I&apos;m just starting to experiment with these.  We currently capture all these through an Event Notification on DDL_EVENT.  And that works really well so I haven&apos;t had the need for this yet.  I do know that you should filter out events on database_id = 2 or you&apos;ll get all the tempdb objects.  And I&apos;m seeing lots of CEIP extended event work which may be related to the fact that these servers can&apos;t see the Internet.</p>
<h2 id="summary">Summary</h2>
<p>So those are the events and fields I capture through Extended Events on production servers.  I&apos;ve found this data to be very helpful troubleshooting production problems.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Is It SQL - 1.0.28 now with better AG backups]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>It&apos;s finally time to push another release of <a href="https://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> out the door.  This has a few big features I&apos;ve been working on.</p>
<h2 id="backups">Backups</h2>
<p>First, it handles remote Availability Group backups properly.  In an AG, you can run a backup on a secondary node.  IsItSQL</p>]]></description><link>https://billg.sqlteam.com/2018/05/15/is-it-sql-1-0-28/</link><guid isPermaLink="false">5ce53e64b957d1001730bf59</guid><category><![CDATA[Is It SQL]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Tue, 15 May 2018 17:45:49 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>It&apos;s finally time to push another release of <a href="https://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> out the door.  This has a few big features I&apos;ve been working on.</p>
<h2 id="backups">Backups</h2>
<p>First, it handles remote Availability Group backups properly.  In an AG, you can run a backup on a secondary node.  IsItSQL now finds backups on any node and shows them on all nodes.</p>
<p><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2018/05/isitsql-ag-backup.png" alt loading="lazy"></p>
<p>My backup of AdventureWorks2014 from December 2016 now shows when it was backed up, the backup file name and the instance that completed the backup.  And it will show that on any AG node that hosts that database.</p>
<h2 id="dashboards">Dashboards</h2>
<p>The dashboard page was the one feature I was really excited about when I first built the software.  But it&apos;s become a page I rarely use.  This latest build allows you to choose which servers appear on the dashboard by assigning the &quot;dashboard&quot; tag.  It will display the first three servers with that tag on the dashboard sorted by the Friendly Name.</p>
<h2 id="availabilitygroupfailovers">Availability Group Failovers</h2>
<p>The last big feature handles aliases that change where they point.  This is often a listener for an availability group.  At one client, every production server has a static DNS that is used by applications.  In some cases, individual databases also have a static DNS entry.  This allows us to easily move to new servers or domains.</p>
<p>In SQL Server, waits and disk I/O are tracked in aggregate.  The value I show in the graph is the value reported less what it was a minute ago.  Which works fine until an AG fails over or we repoint our static DNS to the other replication subscriber.  I always handled negative changes but not super huge positive changes.</p>
<p>Now it checks for a change in the underlying server for for a server restart.  If either one of those changes, we put a message in the log and reset the counters.</p>
<p>You can download <a href="https://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> from the scaleSQL site.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Get a Phone Alert When a Query Finishes]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Today, through various snafus and situations, I found myself waiting a LONG time for a lock to clear up.  Here&apos;s how I got an alert to pop up on my phone (an iPhone) when that stupid SPID finally rolled back.</p>
<p>You&apos;ll need to have database mail</p>]]></description><link>https://billg.sqlteam.com/2017/10/05/generate-phone-alert-when-a-query-finishes/</link><guid isPermaLink="false">5ce53e64b957d1001730bf57</guid><category><![CDATA[SQL Server]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Thu, 05 Oct 2017 02:48:17 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Today, through various snafus and situations, I found myself waiting a LONG time for a lock to clear up.  Here&apos;s how I got an alert to pop up on my phone (an iPhone) when that stupid SPID finally rolled back.</p>
<p>You&apos;ll need to have database mail configured and ready to go.</p>
<p>First, <a href="https://www.imore.com/how-manage-email-and-mailboxes-mail-app-iphone-and-ipad?ref=billg.sqlteam.com#customVIP">configure your iPhone to display an alert when you receive VIP mail</a>.  Open mail and click on the little &quot;i&quot; in the circle by the VIP section in the mailboxes list.  Click &quot;VIP Alerts&quot; and configure as desired.  I have all of them selected and a sound configured.</p>
<p>Second, send yourself an email from the server using <code>sp_send_dbmail</code>.</p>
<p>Third, on your iPhone, open the email and click on the From field.  That will open a contact form for that email address (aka the server).  There should be an option to add to VIP on the screen.</p>
<p>Fourth, write a query to email yourself.  That should look something like this (typed from memory and subject to typos):</p>
<pre><code>USE msdb;

SELECT TOP 1 * FROM TheDB.dbo.TheLockedTable;

EXEC sp_send_dbmail
    @Subject = &apos;It&apos;&apos;s Done!&apos;,
    @Recipients = &apos;YourEmail&apos;;
</code></pre>
<p>Make locking work FOR you for a change.  The SELECT will block until the lock clears.  It sends you an email and you&apos;ll get an alert moments later.</p>
<p>Fifth, remove that server from your VIP list.  The last thing I want is alerts on every email from my database servers.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Is It SQL - 1.0.27]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>I&apos;d like to tell you this release has some great unifying theme.  It doesn&apos;t. It&apos;s just a bunch of things I felt like fixing.</p>
<p>But let&apos;s start with tags.  That&apos;s what I originally wanted to focus on for this release.</p>]]></description><link>https://billg.sqlteam.com/2017/07/27/is-it-sql-1-0-27/</link><guid isPermaLink="false">5ce53e64b957d1001730bf56</guid><category><![CDATA[Is It SQL]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Thu, 27 Jul 2017 14:00:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>I&apos;d like to tell you this release has some great unifying theme.  It doesn&apos;t. It&apos;s just a bunch of things I felt like fixing.</p>
<p>But let&apos;s start with tags.  That&apos;s what I originally wanted to focus on for this release.  The first change is to separate out the user-tags from the system generated tags.  (And you can enable the tagging feature by signing up for the <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">newsletter</a>).  Most times I&apos;m using I want to see how I&apos;ve tagged servers.  But every now and then I&apos;d like to see by SQL Server version, or edition, or domain.</p>
<p>There&apos;s also a tag summary page that lists one row per tag.  It counts the number of instances, disk I/O, RAM, cores, etc.  It&apos;s a great way to get an overview of your environment.  And it works for system generated tags so you can quickly how much data and activity is taking place in each version for example.</p>
<p><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2017/07/1.0.27-row-detail-1.png" alt loading="lazy"></p>
<p>I also made some changes to the detail for tags or servers.  First, I now show the total server memory as well as the amount used by the SQL Server engine.  The total allocated to the server is what I want to see most of the time.  If you hover over the number of cores, it will also show the number of cores actually used.  This is just a simple percent used multiplied by total cores.  I find this especially interesting when I tag groups of VMs.  Then I can see how many cores they are really using.  I may try to make this more prominent in future releases. I&apos;m still trying to figure out what I want to see.</p>
<p>Many of the wait types around SQL Server 2016 are gradually getting hidden away. The latest was related to the Query Store.  And if you aren&apos;t using this you really should be.  It&apos;s a handy little feature.  If you find other wait types showing but you don&apos;t think they should please use the contact page and let me know.</p>
<p>There are lots of little cosmetic fixes.  The version doesn&apos;t display on the list servers any more but does appear on the server detail page.  If you don&apos;t have the right permissions I display a better error message.  The server summary page groups a little better into sizes (core count, databases, etc.) vs. usage (CPU percent, disk I/O, etc.).</p>
<p>You can download 1.0.27 on the <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> page.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Is It SQL has an Admin GUI]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>It&apos;s finally time to push <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL 1.0.25</a> out the door. I sent it to the newsletter subscribers last week and we haven&apos;t discovered any problems yet.</p>
<p><strong>Before upgrading, please read the README in the zip file! Especially if you have custom connection</strong></p>]]></description><link>https://billg.sqlteam.com/2017/05/11/is-it-sql-has-an-admin-gui/</link><guid isPermaLink="false">5ce53e64b957d1001730bf54</guid><category><![CDATA[Is It SQL]]></category><category><![CDATA[Utilities]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Thu, 11 May 2017 22:59:37 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>It&apos;s finally time to push <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL 1.0.25</a> out the door. I sent it to the newsletter subscribers last week and we haven&apos;t discovered any problems yet.</p>
<p><strong>Before upgrading, please read the README in the zip file! Especially if you have custom connection strings and this is running as a service.</strong>  I rewrote it just for this release.  And there are some security and encryption implications in this release that you need to understand.</p>
<p>The first big change is that we now have a simple GUI for servers and settings.  You can access this via the little gears icon in the header menu.</p>
<p><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2017/05/server-edit-smaller.png" alt loading="lazy"></p>
<p>This replaces the servers.txt file.  You can add, edit and delete servers through this.</p>
<p>If you&apos;re upgrading, it will import your servers.txt and rename it as <code>servers_imported_YYYYMMDD.txt</code> or something like that.  I&apos;d also encourage you to delete this file -- especially if it has custom connection strings with passwords.</p>
<p>All the server connections are stored in <code>connections.json</code> in the <code>config</code> directory.  Any password or custom connection string is encrypted in the file.  It&apos;s encrypted using the Windows DPAPI based on the account that is running the application.  This makes changing the service account or machine hosting this tricky so I encourage you to get that right.</p>
<h3 id="newserverurls">New Server URLs</h3>
<p>Previously every server was assigned a URL in the format <code>http://localhost:8143/server/S1</code>.  And the number part was assigned based on the order of the server in <code>servers.txt</code>.  Putting the servers in a JSON configuration file and controlling the edit process means I can finally have consistent URLs.  And of course they&apos;re GUIDs!</p>
<p>So the URL for a server is now something like this:</p>
<p><code>http://localhost:8143/server/f8e451b9-d2a2-472a-be8a-7ec90df23347</code></p>
<p>And that GUID won&apos;t change.  That should make it easier to bookmark servers.</p>
<h3 id="settings">Settings</h3>
<p>There are a few basic settings you can control.  These include:</p>
<ul>
<li>
<p><em>The port the service uses to serve the web site</em>.  I&apos;d love to use port 80 but IIS usually takes that.  This lets you run on any port you want.</p>
</li>
<li>
<p><em>The number of servers that will be polled concurrently</em>.  This defaults to 4 times the number of cores but will always be at least 8.  That&apos;s been a reasonable default up to a hundred servers or so.</p>
</li>
<li>
<p><em>Backup alert thresholds</em>.  Signing up for the newsletter gets you access to some of the advanced features.  One of those is alerts on missing backups.  You can now set the site-wide threshold for missing backups.  It defaults to 36 hours for full or differential backups and 90 minutes for transaction log backups.</p>
</li>
<li>
<p><em>Admin page security</em>.  There&apos;s a setting that controls security on these settings and on editing servers.  Right now the two options are anyone who can reach the web site can change this or limiting it to people that are running on the console of the server itself.  These were simple to implement and seemed like a reasonable compromise.  I&apos;ve been testing Activity Directory authentication but that&apos;s a pretty big leap.</p>
</li>
</ul>
<p>Every setting except the port takes effect immediately.</p>
<h4 id="otherchanges">Other Changes</h4>
<p>There are lots of smaller changes in this release.</p>
<ul>
<li>
<p>If you&apos;ve subscribed to the newsletter, you can monitor Availability Groups.  This release shows failures for both the server and the AG if there are issues. Previously it would show the server as failed and would not update the AG.</p>
</li>
<li>
<p>We now have a favicon.  And of course it&apos;s a bright orange question mark.</p>
</li>
<li>
<p>The application handles backups for servers in time zones east of you.  SQL Server reports backup times in the local time zone so it was seeing future backups and not reporting missing transaction log backups properly.  This now handles those correctly.</p>
</li>
<li>
<p>The menu is simplified.  Anything that reports across servers now falls under a &quot;Global&quot; menu.  This includes Availability Groups, Backup Issues, Database Mirroring Status, and the Summary Page.</p>
</li>
</ul>
<p>Give it a try and let me know what you think.  My email is in the README or you can use the <a href="http://www.scalesql.com/contact.html?ref=billg.sqlteam.com">scaleSQL contact page</a> to reach me.  I also added an <a href="http://forums.sqlteam.com/c/is-it-sql?ref=billg.sqlteam.com">Is It SQL support forum</a> to the <a href="http://forums.sqlteam.com/?ref=billg.sqlteam.com">SQLTeam Forums</a> if you&apos;d like to chat there.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Is It SQL build 24 shows missing backups]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>The latest release of <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> now shows missing backups.</p>
<h1 id="backups">Backups</h1>
<p><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2017/04/blog-isitsql-24-backups-1.png" alt loading="lazy"></p>
<p>The top section gives you a summary of all servers with missing backups and the bottom section lists each individual database that doesn&apos;t have a good backup.  Right now a &quot;good&quot; full backup is</p>]]></description><link>https://billg.sqlteam.com/2017/04/20/untitled/</link><guid isPermaLink="false">5ce53e64b957d1001730bf53</guid><category><![CDATA[Is It SQL]]></category><category><![CDATA[Utilities]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Thu, 20 Apr 2017 11:17:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>The latest release of <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> now shows missing backups.</p>
<h1 id="backups">Backups</h1>
<p><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2017/04/blog-isitsql-24-backups-1.png" alt loading="lazy"></p>
<p>The top section gives you a summary of all servers with missing backups and the bottom section lists each individual database that doesn&apos;t have a good backup.  Right now a &quot;good&quot; full backup is defined as being a full or differential within the last thirty-six hours.  Further, a database in FULL recovery model expects a log backup within the last ninety minutes.</p>
<p>The last backup query can be a little expensive so it only polls backups every five minutes.  If you have more than a million rows of backup history it doesn&apos;t poll that server&apos;s backups at all.  It will include a message indicating this.</p>
<p>There&apos;s a simple text file you can edit to exclude servers and databases from expecting to be backed up.  If you have multiple connections to a server (availability group name and node name) it will still only appear once.</p>
<p><em>And if you&apos;re reading this, welcome to the new blog. That means the RSS feed updated properly.  Or at least you found it some other way.</em></p>
<h1 id="moreconcurrentpolling">More Concurrent Polling</h1>
<p>The number of concurrent servers it will poll has been increased to eight.  This seems to work well so far.  I originally increased this to handle slow backup queries but finally gave in and just fixed the backup queries.  But eight concurrent pollers seems to work well so far.</p>
<h1 id="theinfographic">The &quot;Infographic&quot;</h1>
<p><img src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/2017/04/blog-isitsql-24-summary-1.png" alt loading="lazy"></p>
<p>I really want to add a cool infographic showing a summary of your environment.  I&apos;ve got the numbers but not the graphic part.  So for now I&apos;m calling it a summary.</p>
<p>I&apos;m surprised at just how many databases there are in some the environments I monitor with this.  It&apos;s also been interesting to watch the total IOPS across all servers in near-real time. As you can see, my little development box isn&apos;t very interesting.</p>
<h1 id="miscellaneous">Miscellaneous</h1>
<ul>
<li>
<p>Various wait group names have been cleaned up.  Mostly with regard to SQL Server 2016 and availability groups.</p>
</li>
<li>
<p>If <code>sys.dm_exec_requests</code> shows a percent complete then so does Is It SQL.  If you hover over the duration on the Active Sessions page for a server it will show the start time and percent complete.  I mostly use this to obsess over backups and restores.</p>
</li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Configuring MSDTC Across Domains]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>One of my clients has applications that use MSDTC.&#xA0; We&#x2019;re spinning up a SQL Server 2016 Availability Group to take advantage of the MSDTC support it introduced.&#xA0; Most of these distributed transactions take place across linked servers.&#xA0; And of course the new servers are in</p>]]></description><link>https://billg.sqlteam.com/2016/12/31/configuring-msdtc-across-domains/</link><guid isPermaLink="false">5ce53e64b957d1001730be6a</guid><category><![CDATA[SQL Server Stuff]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Sat, 31 Dec 2016 15:11:58 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>One of my clients has applications that use MSDTC.&#xA0; We&#x2019;re spinning up a SQL Server 2016 Availability Group to take advantage of the MSDTC support it introduced.&#xA0; Most of these distributed transactions take place across linked servers.&#xA0; And of course the new servers are in a new domain with a very limited trust with the old domain.&#xA0; </p>  <p>I found lots of articles and checklists for configuring MSDTC but none had everything I needed.&#xA0; This is the checklist I came up with to configure cross-domain MSDTC with a limited trust in place.&#xA0; (I don&#x2019;t know what kind of trust it is.&#xA0; I just know I have to put accounts into Domain Local groups in order to use them across the trust.&#xA0; And it&#x2019;s one way.)</p>  
<h1 id="resources">Resources</h1>
<p>I found LOTS of articles on configuring MSDTC.&#xA0; These are the ones I found to be the most comprehensive.</p>
<ol>
<li><a href="https://blogs.msdn.microsoft.com/distributedservices/2011/11/22/troubleshooting-msdtc-communication-checklist/?ref=billg.sqlteam.com">Troubleshooting MSDTC Communication Checklist</a> &#x2013; This is one of the better checklists I found.&#xA0; Has a good list of required ports.</li>
<li><a href="https://msdn.microsoft.com/en-us/library/aa561924.aspx?ref=billg.sqlteam.com">Troubleshooting Problems with MSDTC</a> &#x2013; Another good resource</li>
<li><a href="https://www.microsoft.com/en-us/download/details.aspx?id=2868&amp;ref=billg.sqlteam.com">DTCPing</a> &#x2013; A VERY useful utility to confirm basic connectivity.</li>
<li><a href="https://blogs.msdn.microsoft.com/puneetgupta/2008/11/12/troubleshooting-msdtc-issues-with-the-dtcping-tool/?ref=billg.sqlteam.com">Troubleshooting MSDTC issues with the DTCPing tool</a> - Great list of errors that DTCPing can return</li>
<li><a href="https://support.microsoft.com/en-us/kb/293799?ref=billg.sqlteam.com">DTCTester</a> &#x2013; Utility to perform a distributed transaction.</li>
</ol>
<h1>Configuration</h1>  <p>There are the steps that future Bill will need to get this configured next time.</p>  <h2>Name Resolution</h2>  <p>We were crossing a domain boundary and weren&#x2019;t getting good NetBIOS name resolution.&#xA0; I had to put a host file entry on both servers pointing to each other with just the machine name.&#xA0; I eventually had to put a second name in for the Availability Group Listener.&#xA0; You need to be able to have a ping &#x2013;a resolve the names on both sides using only the name and not a FQDN.&#xA0; And if you&#x2019;re editing the hosts file don&#x2019;t forget to run NOTEPAD as an Administrator.</p>  <h2>Fix the Matching CIDs</h2>  <p>I&#x2019;m not sure exactly how this came to happen but both these machines had the same CID values for MSDTC.&#xA0; (Note: I still don&#x2019;t really know what a CID is but I know they can&#x2019;t have the same one &#x2013; see the second document above.)&#xA0; The only way to change the CID value is reinstall MSDTC.&#xA0; If you&#x2019;re building machines from images you&#x2019;ll probably have this problem.&#xA0; You reinstall by running:</p>  <p><font face="Courier New">msdtc &#x2013;uninstall</font></p>  <p><font face="Courier New">msdtc &#x2013;install</font></p>  <p>I suggest a reboot after each step.&#xA0; Until I rebooted I didn&#x2019;t see the service installed.</p>  <h2>Open the Ports</h2>  <p>I had the following ports open in the firewall:</p>  <ol>   <li>Port 135 both ways (for RPC) </li>    <li>The dynamic ports 49152-65535 </li> </ol>  <p>MSDTC starts talking on 135 and then jumps to a dynamic port.&#xA0; I think the firewall people may have done something fancier but that&#x2019;s what I told them.</p>  <p>I also had to:</p>  <ol>   <li>Enable the three inbound Windows Firewall rules for Distributed Transaction Coordinator </li>    <li>Enable the one outbound Windows Firewall rule for Distributed Transaction Coordinator </li> </ol>  <p>Those rules exist but they were disabled by default in my environment.</p>  <h2>Configure MSDTC Permissions</h2>  <p>Using DCOMCNFG.EXE I had to enable the following permissions in MSDTC.</p>  <ol>   <li>Network DTC Access </li>    <li>Allow Inbound </li>    <li>Allow Outbound </li>    <li>No Authentication Required &#x2013; This one was a little frustrating.&#xA0; I&#x2019;d prefer to have them authenticate but I haven&#x2019;t worked on that enough yet. </li> </ol>  <p>There are screenshots of this all over the web that you&#x2019;ve probably already found.</p>  <h2>DTCPing</h2>  <p>At this point you should be able to get DTCPing to work.&#xA0; You run it on both sides and they talk to each other simulating a transaction.&#xA0; It give good error messages in the application.&#xA0; It also writes a text file with more detail diagnostic logging.&#xA0; It&#x2019;s a very handy utility.&#xA0; If you get any errors you&#x2019;ll need to work through those.</p>  <h2>DTCTester</h2>  <p>This little command-line utility actually runs a distributed transaction.&#xA0; It creates a temporary table and and inserts a row into it.&#xA0; You&#x2019;ll need to configure a 32-bit ODBC entry.&#xA0; Look for <font face="Courier New">C:\Windows\SysWOW64\odbcad32.exe</font> to make that entry.&#xA0;&#xA0; The 64-bit utility is in <font face="Courier New">C:\Windows\System32</font> and has the same name.&#xA0; That&#x2019;s some confusing naming right there.&#xA0; You&#x2019;ll also need a SQL Server login and password.&#xA0; If you&#x2019;re going to test against multiple machines your ODBC source should point to a hosts file entry.&#xA0; It makes testing much easier.</p><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Is It SQL now shows Availability Groups]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>The latest release of <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> is out and includes a variety of features.&#xA0; I&#x2019;d like to start with some screen shots of previous features.&#xA0; First up is database mirroring.&#xA0; You can see the mirroring status of a database when looking at the databases</p>]]></description><link>https://billg.sqlteam.com/2016/12/19/is-it-sql-now-shows-availability-groups/</link><guid isPermaLink="false">5ce53e64b957d1001730be6b</guid><category><![CDATA[Utilities]]></category><category><![CDATA[Is It SQL]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Mon, 19 Dec 2016 14:02:42 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>The latest release of <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> is out and includes a variety of features.&#xA0; I&#x2019;d like to start with some screen shots of previous features.&#xA0; First up is database mirroring.&#xA0; You can see the mirroring status of a database when looking at the databases for a particular server.</p>  <p><a href="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_2.png?ref=billg.sqlteam.com"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_thumb.png" width="515" height="145"></a></p>  <p>For each database it will show the role, whether it&#x2019;s synchronized or not, and whether the safety is on or off (synchronous vs. asynchronous).&#xA0; It will also show the send and redo queue for the database.&#xA0; </p>  <p>If you sign up for the newsletter (on the <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> page) it will send instructions on enabling the Enterprise features.&#xA0; That includes a page showing all mirrored databases across all servers you&#x2019;re monitoring.&#xA0; That page includes a &#x201C;Priority&#x201D; column that brings any database with issues to the top.&#xA0; If it&#x2019;s disconnected or has a send or redo backlog it will bring it to the top of the list.&#xA0; If you have instances under multiple names, for example static DNS entries pointing to mirroring partners, it only shows each database once.&#xA0; That gives you a quick way to see all mirrored databases across your enterprise.</p>  <p>All tables are sortable by clicking on their heading.&#xA0; So you can sort these pages by the send queue or redo queue or the priority value I calculate or the database size or server or any other column.&#xA0; The size of the log also moved to its own column so it&#x2019;s sortable now.</p>  <p><a href="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_4.png?ref=billg.sqlteam.com"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_thumb_1.png" width="388" height="135"></a></p>  <p>All the data is polled every minute from the servers and then displayed back on the web page.&#xA0; The pages auto-refresh every minute.&#xA0; Some data is polled in real-time when you refresh the page.&#xA0; This is indicated with a cool little lightning bolt by the section.</p>  <p><a href="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_6.png?ref=billg.sqlteam.com"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_thumb_2.png" width="653" height="223"></a></p>  <p>The availability group monitoring is still pretty basic at this point.&#xA0; After you add the nodes to be monitored it discovers any availability groups and displays them all together on a page.&#xA0; The data comes from the AG DMV&#x2019;s.&#xA0; It is nice to have them all in one place and as easy to access as a web page.</p>  <p><a href="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_8.png?ref=billg.sqlteam.com"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_thumb_3.png" width="641" height="189"></a></p>  <p>The list of servers was just showing the bytes per second read and written for disk I/O.&#xA0; I&#x2019;ve expanded this to include the IOPS, average I/O size, and the average latency.&#xA0; It includes that for both reads and writes.&#xA0; 318ms reads.&#xA0; Yuck.&#xA0; I hope yours are better!</p>  <p><a href="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_12.png?ref=billg.sqlteam.com"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://storage.ghost.io/c/87/2b/872b697a-28d0-47ac-99b3-62b3f7ad44c1/content/images/61504-image_thumb_5.png" width="600" height="74"></a></p>  <p>At the bottom of each list of servers there&#x2019;s a summary.&#xA0; It shows the total disk I/O, batches per second, RAM used, data file size and log files size.&#xA0; If instances are included multiple times it only includes it once.&#xA0; This also works for various tags.&#xA0; For example, I&#x2019;ve tagged servers based on their data center so it&#x2019;s easy to see how much traffic each data center is taking.</p>  <p>And that&#x2019;s where we are so far.&#xA0; It&#x2019;s a handy little utility all in a single 12MB executable.&#xA0; It&#x2019;s easy to run as a service so it&#x2019;s always available.&#xA0; I encourage you to sign up for the newsletter.&#xA0; It includes information on enabling the Enterprise features, tips and tricks, and new releases.&#xA0; You can download it from the <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL</a> page.&#xA0; </p><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Database Mirroring in Is It SQL]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Release 1.0.22 is out and available at the <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL home page</a>.&#xA0; The biggest feature here is database mirroring.&#xA0; </p>  <p>There are two ways to see database mirroring.&#xA0; The first is on a server page it will show the databases that are mirrored.&#xA0; There</p>]]></description><link>https://billg.sqlteam.com/2016/11/10/database-mirroring-in-is-it-sql/</link><guid isPermaLink="false">5ce53e64b957d1001730be6c</guid><category><![CDATA[Utilities]]></category><category><![CDATA[Is It SQL]]></category><dc:creator><![CDATA[Bill Graziano]]></dc:creator><pubDate>Thu, 10 Nov 2016 21:40:24 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Release 1.0.22 is out and available at the <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL home page</a>.&#xA0; The biggest feature here is database mirroring.&#xA0; </p>  <p>There are two ways to see database mirroring.&#xA0; The first is on a server page it will show the databases that are mirrored.&#xA0; There is also a global database mirroring page that shows all mirrored databases.&#xA0; There&#x2019;s an added column named &#x201C;priority&#x201D; that highlights databases that aren&#x2019;t connected and synchronized.&#xA0; It also shows shows databases that have send or receive queues.&#xA0; Since the column is sortable it should always show databases with &#x201C;stuff&#x201D; going on at the top.</p>  <p>Please note that you&#x2019;ll need to sign up for the newsletter for instructions on how to enable the beta features.&#xA0; You can find the link on <a href="http://www.scalesql.com/isitsql/?ref=billg.sqlteam.com">Is It SQL page</a>.</p>  <p>Data that is pulled from servers when the page is refreshed is now identified with a little lightning bolt.&#xA0; Most data is cached every minute but some data refreshes with each page load.&#xA0; This helps identify which is which.&#xA0; The basic rule of thumb is that everything is cached except what has the lightning bolt.</p><!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>