• Skip to main content
  • Skip to primary sidebar

DallasDBAs.com

SQL Server Database Consulting

  • Services
  • Pocket DBA®
  • Blog
  • Testimonials
  • Contact
  • About

Kevin3NF

How old are those stats?

September 30, 2021 by Kevin3NF 2 Comments

Image by angel1238812 from Pixabay

SQL Server maintains a variety of stats about all sort of performance items.

  • Index usage (or missing indexes)
  • Query performance
  • Corrupt pages
  • Disk IO performance
  • Way more than I care to list here

I was trying to troubleshoot some TerriBad * tempdb write performance…almost 3000ms per write, on a server that we recently migrated to.

Our data center vendor of course said the storage was perfect and that we should try troubleshooting SQL Server.  (Duh?)

These stats are stored in the sys.dm_io_virtual_file_stats DMF, and I found this gem under the ‘sample_ms’ column description in the result set:

“The data type is int for SQL Server 2008 through SQL Server 2014 (12.x). In these versions, the value will reset to 0 after approximately 25 days of continuous database engine uptime.”

Now, this is a SQL 2017 box, but this tells me that these stats are going to reset at some point.

When I re-ran my IO stalls query…the writes for all 8 tempdb data files are at 7ms.  The sample_ms is currently 3,097,351,985 which is about 36 days if I’ve done my math right. Server uptime is approaching 90 days.

The takeaway for you, dear reader, is to know where to find the stats but also to know what timeframe they represent.

* Thanks to Brent Ozar (b|t) for this highly amusing term 🙂

Thanks for reading!

Kevin3NF

Follow @Dallas_DBAs

Filed Under: Performance Tuning Tagged With: performance, syndicated

Ola log backup job failure

September 28, 2021 by Kevin3NF Leave a Comment

I had a log backup job that was not failing, and was also not backing up logs:

EXECUTE [DBA].[dbo].[DatabaseBackup]
@Databases = 'USER_DATABASES. model',
@Directory = 'D:\Backups\KBH-Precision_SQL2016',
@BackupType = 'LOG',
@Verify = 'Y',
@CleanupTime = NULL,
@CheckSum = 'Y',
@LogToTable = 'Y'

Older version of Ola. Newer versions give this:

Date and time: 2021-09-28 14:56:12
Server: KBH-PRECISION\SQL2016
Version: 13.0.5026.0
Edition: Developer Edition (64-bit)
Platform: Windows
Procedure: [DBA].[dbo].[DatabaseBackup]
Parameters: Removed for cleanliness
Version: 2020-12-31 18:58:56
Source: https://ola.hallengren.com
The following databases in the @Databases parameter do not exist: [USER_DATABASES. model].
Date and time: 2021-09-28 14:56:12
Completion time: 2021-09-28T14:56:12.6474426-05:00

 

Watch those typos, kids!

Thanks for reading!

Kevin3NF

Follow @Dallas_DBAs

Filed Under: backup Tagged With: ola

GroupBy Conference May 2021

May 17, 2021 by Kevin3NF 1 Comment

Dallas DBAs is proud to be sponsoring the May 2021 GroupBy Conference, Americas DBA track

GroupBy is a different sort of conference as it has been online since it began in 2019 (Thanks Brent! (b|t)) Sessions are voted on by the community with the top vote getters being accepted.

As part of our Virtual Group sponsorship we get to present a session, so we asked the first-runner up in the vote tally to “guest present” for us.

Jeff Moden (L), Mr. “NO RBAR” himself will be presenting “Black Arts” Index Maintenance – GUIDs v.s. Fragmentation – They’re not the problem… WE ARE!” at 22:00 UTC on May 25.

This will be a roughly 30 second “About Dallas DBAs” bit, and the rest is all Jeff.

Session Abstract:

This is NOT your typical presentation on the fragmentation problems of Random GUIDs. No… Instead we’re going to DESTROY THE MYTH OF RANDOM GUID FRAGMENTATION.

In one of the most ironic/heterodoxical turns of knowledge you’re ever likely to experience, we’ll see how THE USE OF RANDOM GUIDS CAN ACTUALLY PREVENT FRAGMENTATION! In the end, you’ll witness the results of some simple testing that clearly demonstrate that you can easily insert literally MILLIONs of rows into a Random GUID clustered index with almost no page splits (not even supposed “good” ones) and LESS THAN 1% Logical fragmentation!

We’ll identify the real problem and the seriously effective yet incredibly simple two-part fix for it. In the process, we’ll prove that Random GUIDs actually behave in a manner like most people expect a good index to behave, especially in but not limited to high performance OLTP environments as well as the benefits of doing so.

We’ll also learn how to use a new tool that I created (included in the ZIP file) to ACTUALLY SEE what an index looks like at the page level for all pages in a single graph.

Then, we’ll use that tool to lay waste to what people are currently calling “Best Practice” index maintenance. We’ll literally see what REORGANIZE does to an index at the page level and why it’s one of the very worst things you can do to your Random GUID and many other types of indexes even if you’re limited to the Standard Edition of SQL Server. We also prove that REORGANIZE CAUSES ORDERS-OF-MAGNITUDE WORSE TRANSACTION LOG FILE USAGE than REBUILD especially for Random GUIDs.

As interesting and totally necessary sidebars, we’ll also see how the use of ever-increasing index keys could be (and frequently is) a major source of many of your fragmentation problems and we’ll also see that NEWSEQUENTIALID may NOT the answer that you’re looking for.

See you there (virtually)!

Thanks for reading!

Kevin3NF

Follow @Dallas_DBAs

Filed Under: Uncategorized

Security Update January 2021

January 14, 2021 by Kevin3NF Leave a Comment

SQL Server Security Update: January 12, 2021

Microsoft has issued an important security update that affects all installations of SQL Server 2012-2019. This security update addresses an elevation of privilege vulnerability which can allow data to be sent over a network to an affected SQL Server instance that might cause code to run against the SQL Server process if a certain extended event is enabled. (https://support.microsoft.com/en-us/help/4583468/kb4583468-microsoft-sql-server-elevation-of-privilege-vulnerability)

The ”certain Extended Event” has not been disclosed at this time.

You can read the MSRC Security Update Guide document CVE-2021-1636 for more detailed information, and to learn which specific versions of SQL Server are affected by this vulnerability. NOTE: If you are running an instance of SQL Server 2012 or higher and do not find your version number listed, then your SQL Server version is no longer supported and needs an update to the latest Service Pack and/or Cumulative Update.

We recommend all SQL Server users apply this security update during the next available maintenance window to patch this vulnerability.

Filed Under: Uncategorized

2020 Year In Review

January 1, 2021 by Kevin3NF Leave a Comment

TL;DR – It was great and not great

I think we can all pretty much agree that in some regards 2020 was horrible, globally.

So lets move on…

Good stuff:

COVID-19 Vaccines are hitting the market and being distributed!

Boeing 737 MAX is cleared to fly again (Boeing is a Dow 30 component and LOTS of people are employed there or by Boeing suppliers)

US Presidential election appears to be settled (if you want to go all political on this, see you on Twitter!)

We moved the Dallas DBAs Global HQ in Q3 2020. (I moved…we all WFH, there is no physical presence)

Dallas DBAs specific stuff:

  • New customers added in 2020: 29 (+52%)
  • Sales: +28% over 2019
    • Analysis – COVID forced us to take smaller projects, but more of them
  • Pocket DBA customers: +100%
  • Website clicks (blog posts and other pages): +83%
    • Some of this from more advertising/marketing
    • MUCH of it from Jeff (b|t) and Liz (t) adding to the blogs
  • Website clicks over to Tim Mitchell’s (b|t) page: 618 (+38%, number 1 overall site visited from ours)
  • Blog posts: 42 ( down 30%…writing is hard, lol)
  • YouTube:
    • Views + 78%
    • Hours watched: +82%
    • Subscribers: +124%
    • 4 new videos – videos are hard
      • Feel free to suggest a video topic in the comments (something I can cover in 10-20 minutes, beginner DBA stuff)
  • Kevin started the Data Bits podcast and needs to get back on it!
  • Number of employees: 3 – no new hires and NO LAYOFFS!
  • Kevin released a followup Pluralsight video
    • Look for a new one in 2021 as well. Maybe 2 if I get energetic and time permits

Summary

It was a good year for the company. We were able to pivot quickly and offer services that matched the newly shrunken/frozen budgets of our clients and market. We only had one that had to stop a project and I anticipate them picking it back up in 2021.

Personally – we are all healthy here, and that’s a good thing. 2 folks in my extended family contracted COVID but recovered (mostly). I was able to pick up the cycling miles and have a home gym installed in the new home’s garage for throwing some weights around from time to time…gotta keep healthy!

Thanks for reading!

Kevin3NF

Follow @Dallas_DBAs

Filed Under: Career, Dallas DBAs Tagged With: syndicated

Top 3 Upgrade & Migration Mistakes

December 22, 2020 by Kevin3NF Leave a Comment

This is a guest post by another friend of Dallas DBAs – Brendan Mason (L|T)

Upgrading and migrating databases can be a daunting exercise if it’s not something you practice regularly. As a result, upgrades routinely get dismissed as “not necessary right now” or otherwise put off until there is not really another option. Maybe the physical hardware the instance was running on had a motherboard melt down, or perhaps the vendor of your ERP software is forcing your hand by no longer supporting that near decade old version of SQL Server. Or maybe you’re running a current version but find yourself along for the ride when the application team decides they’re moving from on-premise to the cloud.

Everyone wants upgrades and migrations to go smoothly, particularly the folks on the business side of the house who control budgets for outside help. As consultants, we get called in to help with these projects a lot. I have personally been involved in hundreds of database migrations as both an employee and a consultant. It has exposed me to a lot of different scenarios, good and bad. In this post, I’m going to talk about the top 3 mistakes I see companies make when it comes to SQL Server upgrades and migrations.

#1 – Deciding on the solution before analyzing the goals

It seems that everyone thinks they need AlwaysOn Availability Groups these days, whether they know what it is they do or what the alternatives are. Most often, a kick-off meeting for a migration project starts with, “We need you to set up our new Availability Group so that we have multiple copies of the database and never have another outage. We have VMs built and ready for you to install SQL Server on.” This constitutes being proactive to a fault. Sometimes the entire architecture needs to be redone when we tell them that Availability Groups won’t solve their particular use case or give them what they were led to believe, or that their budget simply won’t accommodate Enterprise Edition. Getting too far ahead of yourself can also cost you extra money. I have seen companies go out and buy physical hardware for their new environment, only to discover during our conversation that the processors they paid extra for have more cores than the SQL Server Standard Edition instance they want to use will be able to utilize. It adds insult to injury when I tell them that Microsoft will expect them to license all those cores for SQL Server even when the lone instance won’t be using them all.

In a recent example of a pre-determined solution that was incompatible with the upgrade goals, a client wanted to perform an in-place upgrade of their SQL Server 2012 instance running on Windows Server 2012. They didn’t want to upgrade the operating system and had correctly noted that SQL Server 2019 was not supported on Windows Server 2012. Based on this, they had decided that 2017 Standard would work for them and they just wanted some outside expertise to help with the upgrade process. It wasn’t until we were days away from the upgrade that they shared that Transparent Data Encryption (TDE) was a must-have feature that they needed to enable post-upgrade. This is an easy misinterpretation for someone not well versed in SQL Server editions and features to make. TDE had been an Enterprise Edition feature until 2019 when it was finally included with Standard. The client had been looking at the edition comparison for 2019 and didn’t realize that TDE was not available in Standard edition for the earlier versions.

Another common one I see is the decision being made up front to use a database Platform-as-a-Service (PaaS) solution. I’m a big fan of PaaS in general, but there can be a lot of gotchas – especially when it involves migrating a legacy database.

Remember, we’re here to help guide you during the planning phases, not just the execution, so I recommend engaging early in the process. The more details you share about what problems you’re trying to solve and what you want to get out of your upgrade/migration project, the more likely it is that you’ll land with a cost-effective solution that does exactly what you need.

#2 – Not having an adequate testing plan

You can do everything right as far as sizing your new environment and choosing the right SQL Server edition to meet your requirements, but if you don’t actually test before migrating, you’re taking a huge risk. Inevitably, there is almost always a forgotten dependent application or an old stored procedure that uses an obscure piece of syntax that’s no longer supported. There are also changes made to the database engine with each new version that usually improve query performance, but occasionally cause regressions for certain queries and workloads. If the testing plan is to just “click around” and make sure the application still functions, you can easily miss issues that can escalate under full user load.

Part of testing should be collecting baseline performance metrics. You can’t effectively compare performance of the upgraded databases without a baseline from the source. You can and should also take this opportunity to perform some basic performance tuning prior to upgrading. There have been several cases where I have been able to recommend a reduction in the number of CPU cores and associated cost for the migration just by looking at accurate baseline performance metrics and/or making a few minor performance tweaks.

Another often overlooked part of testing is the usual myriad of connected services and applications. Database Mail, SSIS, SSRS, linked servers, etc. all need to be validated during testing to avoid surprises at go-live.

Note that a solid testing plan is not a replacement for an equally solid rollback plan. You don’t want to be trying to come up with one on the fly. Once a SQL Server database is upgraded to a newer version, you can’t back it up and restore it back to the older version. That means that if you discover a major issue post-upgrade, you need to either work through it, roll back to the database backup that was taken immediately prior to upgrading, or have a process in place to reconcile the deltas.

#3 – Not taking advantage of the new version

Every new version of SQL Server comes with improvements to performance, security, and functionality. You’re paying for these things, so you might as well use them, right? Unfortunately, clients can often be reluctant to take full advantage of these enhancements as part of an upgrade project. Those who wait to upgrade until the SQL Server version they’re running is about to go out of support tend to just want to get upgraded with as little change as possible. However, you’re missing out on a lot of benefits when you take that approach. Everyone will have a slightly different situation that dictates which new features warrant trying out, but there are a few general recommendations I have for getting more value from your upgraded SQL Server instance:

Query Store – When upgrading from a SQL Server version prior to 2016, I suggest enabling Query Store after the upgrade. It’s a valuable tuning tool (the so-called “flight recorder”) and you don’t want to wait until you really need it to turn it on.

Compatibility level – In order to take advantage of all the latest enhancements and Query Optimizer fixes, your databases should be at the latest compatibility level. Leaving them at their legacy setting post-upgrade is the “good enough” approach, but if you’re doing proper testing, you might as well test changing the compatibility level while you’re at it. There are tools that will analyze database code and queries and identify incompatibilities, so there’s not a good excuse to not at least test this. Unlike upgrading the database itself, changing the compatibility level is not a one-way operation and it’s a trivial change to go back, if necessary. Bonus points if you enable Query Store prior to changing the compatibility level – it can help identify performance regressions and target individual queries that might need attention. Just always be sure to follow vendor requirements if the database is used by third-party software.

Keep in mind that I’m not advocating that you do these things on go-live night as part of the actual upgrade. I’ve simply witnessed too many upgrades that ended with the database online and passing all the smoke tests, but with no further effort devoted to maximizing value gained from the upgrade.

Wrapup

There you have it – Those are the top 3 mistakes I see during upgrades and migrations. This by no means comprehensive and I have purposely left out some especially cringeworthy experiences to protect the guilty. Upgrading versions or moving to new hardware or platforms doesn’t have to be painful. In fact, with good processes and procedures it should be so predictable and straightforward that it becomes a regular part of keeping your systems up to date.

 

ED: Please feel free to leave some comments in the ummm…comments section!

Filed Under: SQL Tagged With: SQL, syndicated

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 10
  • Go to page 11
  • Go to page 12
  • Go to page 13
  • Go to page 14
  • Interim pages omitted …
  • Go to page 44
  • Go to Next Page »

Primary Sidebar

Search

Sign up for blogs, DBA availability and more!

Home Blog About Privacy Policy
  • Home-draft
  • Blog
  • About Us

Copyright © 2026 · WordPress · Log in

 

Loading Comments...