Infrastructure at your Service

All Posts By

Steven Naudet

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
Steven Naudet

SQL Server AlwaysOn node “Add all eligible storage to the cluster”

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

I made a mistake recently when adding a new node to an existing Windows Failover Cluster supporting AlwaysOn SQL Server instances. When adding a new node using the GUI there’s this option checked by default named “Add all eligible storage to the cluster”.   Before performing the operation the disks on the 2 nodes of my cluster were used by the SQL Server instances. Because I’m using the AlwaysOn features the disks are local on…

Read More
Steven Naudet

SQL Server: High SQLCONNECTIONPOOL Memory Clerk consumption

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

In this blog post, I will show you what I did to troubleshoot an interesting problem with Memory on SQL Server. It all started with a job performing DBCC CHECKDB on all databases taking hours to complete instead of 10 minutes. So the Job ran outside of its maintenance window, still running in the morning when users come back to the office. They immediately complained about poor application performance. While running the CHECKDB we could…

Read More
Steven Naudet

SQL Server Installation Wizard error : Failed to retrieve data for this request

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

Today I faced a strange issue when I tried to install a new SQL Server instance : Failed to retrieve data for this request This error occurred just after clicking on “New SQL Server stand-alone installation…” The error message is not helpful at all. So, the first step to troubleshoot an issue is to look at the error logs. The location by default is : C:\Program Files\Microsoft SQL Server\140\Setup Bootstrap\Log There is a summary.txt file…

Read More
Steven Naudet

SQL Server: Change Availability Group Endpoint Ownership

By | Database Administration & Monitoring | No Comments

I’m doing some cleaning on my customer’s instances. I want to delete the login of a previous DBA for 2 reasons; this person does not work anymore in my customer’s company and all DBA are members of a group that is given permission on the instances. I don’t want to see any DBA’s personal login on SQL Server instances. When I try to delete the login I receive the following error; Msg 15173, Level 16,…

Read More
Steven Naudet

Introduction to Azure SQL Database Auto-failover groups

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

SQL Azure Database by default offers a 99.99% availability SLA across all its service tiers. This means that for any database, the downtime should not exceed 52 minutes per year. Using Zone redundancy increases availability to 99.995% which is about 26 minutes per year. These impressive numbers can be achieved through in-region redundancy of the compute and storage resources and automatic failover within the region. Some disruptive events may impact the region’s availability like Datacenter…

Read More
Steven Naudet

How to create an Azure SQL Database using Azure PowerShell

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

In this blog post, I’ll go through the steps to create an Azure SQL Database using Azure PowerShell. Introduction to Azure SQL Database The SQL database services provided by Microsoft on the cloud are now grouped under the name of Azure SQL. The Azure SQL family contains services that I will briefly summarize; Azure SQL Database – DBaaS (Database-as-a-Service) Azure SQL Managed Instance – PaaS (Platform-as-a-Service) SQL Server on Azure VMs – IaaS (Infrastructure-as-a-Service) In…

Read More
Steven Naudet

SQL Server: Synchronize logins on AlwaysOn replicas with dbatools

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

The SQL Server environment  I worked with today has dozens of SQL Server instances using AlwaysOn Availability Groups for High Availability. When a login is created on the Primary replica of an Availability Group it is not synchronized automatically on secondary replicas. This might cause some issues after a failover (Failed logins). Since this is not done automatically by SQL Server out of the box the DBA has to perform this task. To avoid doing…

Read More
Steven Naudet

SQL Server: Quickly clean backup history with dbatools

By | Database Administration & Monitoring | No Comments

I just had to restore a database in production for my customer. Before doing the restore I have the habit to query the msdb.dbo.backupset table to get an overview of the last backups. When running my query, I felt it was taking longer than usual. So out of curiosity, I looked at the SSMS standard report “Disk Usage by Top Tables”. Here is the output. This instance contains dozens of databases in Always On Availability…

Read More
Steven Naudet

SQL Server: Collect Page Split events using Extended Event session

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

Earlier this week someone tried to show me how to capture page split events using Extended Events (XE) but unfortunately, the demo failed. This is a good opportunity for me to refresh my knowledge about page split and set up a simple demo about this. Hopefully, this one will be working. It’s not necessarily a bad thing when a page split occurs. It’s a totally fine behavior when we INSERT a row in a table…

Read More