Infrastructure at your Service

All Posts By

Steven Naudet

Steven Naudet

SQL Server: How to delete the msdb backup history kindly

By | Database Administration & Monitoring, SQL Server | No Comments

This week I noticed some slowness on queries related to backup history. The instance had a huge msdb database (more than 10GB size), the backup history had never been purged. I already wrote a post on this topic and provided a small PowerShell script using dbatools to clean the backup history. The issue with sp_delete_backuphistory or Remove-DbaDbBackupRestoreHistory is that the operation is done as one transaction and this could badly impact the msdb transaction log…

Read More
Steven Naudet

SQL Server: Audit changes on Instance Configuration, Linked Servers and Agent Jobs

By | Database Administration & Monitoring, SQL Server | No Comments

Introduction Very often with our customers, there is only one person with the DBA role. The configuration of the instances is then under control and if anything strange has to be questioned, the culprit is quickly identified. 🙂 When many people, not necessarily having DBA knowledge, have high permissions (sysadmin) on instances it becomes important to know who does what. In this blog post, we will see how to get notified by email when certain…

Read More
Steven Naudet

SQL Server connectivity issue – troubleshoot TLS configuration

By | Database Administration & Monitoring, Security, SQL Server | No Comments

In the blog post, I will share a case of troubleshooting a connectivity issue with SQL Server. The problem occurred in a migration context. The SQL Server databases (in version 2008 to 2014) from multiple applications were consolidated on a new server with SQL Server 2019. Application servers were also migrated to new VMs. The new servers are hosted on a brand new infrastructure managed by a third-party provider which my customer has very little…

Read More
Steven Naudet

SQL Server: Create a Shared Storage for your Failover Cluster LAB

By | Database Administration & Monitoring, SQL Server | No Comments

I’m currently working on the migration of a Failover Clustered SSAS instance from Windows Server 2012 to Windows Server 2019. The context is quite complex and in order to choose the right migration scenario I need to play with it on my LAB environment first. I usually work with AlwaysOn architectures and it’s not often that I need to set up an FCI with its Cluster Shared Volume. As a reminder, a Cluster Shared Volume…

Read More
Steven Naudet

SQL Server: Control the size of your Transaction Log file with Resumable Index Rebuild

By | Database Administration & Monitoring, SQL Server | 2 Comments

Introduction In this blog post, I will demonstrate how the Resumable capability of Online index rebuild operation can help you to keep the transaction log file size under control. An index rebuild operation is done in a single transaction that can require a significant log space. When doing a Rebuild on a large index the transaction log file can grow until your run out of disk space. On failure, the transaction needs to rollback. You…

Read More
Steven Naudet

SQL Server TCP: Having both Dynamic Ports and Static Port configured

By | SQL Server | No Comments

Introduction Have you ever seen an SQL Server instance configured to listen on both “TCP Dynamic Ports” and “TCP (static) Port”? This kind of configuration can be caused by the following scenario: A named instance is installed. By default, it is configured to use dynamic ports. Someone wants to configure the instance to listen to a fixed port and set the “TCP Port” value The “TCP Dynamic Ports” is set to value “0” thinking this…

Read More
Steven Naudet

Validate your SQL Server infrastructure with dbachecks

By | Database Administration & Monitoring, SQL Server | 3 Comments

Introduction In this blog post, I’ll do an introduction to the PowerShell module dbachecks. dbachecks uses Pester and dbatools to validate your SQL Server infrastructure. With very minimal configuration you can check that your infrastructure is configured following standard best practices or your own policy. We will see the following topics – Prerequisites for dbachecks Installation – Introduction to Pester – Perform a Check – Manage the Configuration items – Import & Export – Output…

Read More
Steven Naudet

An Introduction to Pester – Unit Testing and Infrastructure checks in PowerShell

By | Database Administration & Monitoring | No Comments

Introduction If you never heard of it, Pester is a PowerShell module, written in PowerShell. It’s a framework for writing and running unit tests, integration tests, and also infrastructure checks as we will see in a moment. Pester is used for example to test PowerShell Core and Pester itself. In this blog post, I’ll do a short introduction to Pester with Installation and basic checks examples. Installation Pester is shipped by default with Windows 10…

Read More
Steven Naudet

Getting started with SQL Server on Linux containers with Docker Desktop and WSL2

By | Database Administration & Monitoring, Docker, SQL Server | One Comment

In this blog post, I will show you the steps I went through to run SQL Server inside a Linux Docker container on my Windows 10 laptop. The aim here is to deploy quickly and easily SQL Server instances in my lab environment. Introduction Since May 2020 Windows ships with WSL 2. Windows System for Linux is a feature that creates a lightweight environment that allows you to run Linux distributions (Debian, Ubuntu, etc.) without…

Read More
Steven Naudet

SQL Server: Generating SQL script using PowerShell and Template file

By | Database Administration & Monitoring, Database management, SQL Server | No Comments

In this blog post, I will share with you a small PowerShell script I did recently. I have noticed that my customer performs a very repetitive and time-consuming task almost every day. New columns are added to tables on their business-critical database and they need to maintain SQL scripts file with all the ALTER TABLE statements for each new column. For every new column, my customer copy-pastes the following SQL Script and then change parts…

Read More