Blog Posts
-
Identify Missing & Unused Indexes in SQL Server
Indexes are crucial for SQL Server query performance. Everyone needs an Index. However, improper indexing strategies can degrade database performance, leading to slow queries and cause resource bottlenecks. Effectively managing indexes involves not only identifying the missing ones that could improve performance, but also pinpointing unused indexes that…
-
SQL Server Performance Tuning: Index Fragmentation Scripts
In this post I’m sharing more scripts to help with SQL Server performance tuning. This time, we’re looking at index and heap fragmentation which are useful for pinpointing inefficiencies on your database. Fragmentation, whether in indexes or heaps, can lead to slower queries, inefficient storage, and increased maintenance…
-
Show User Activity and Blocking in SQL Server
In this post I’m sharing a SQL script that will show currently running and blocking queries in SQL Server, with some other useful info along the way. This is script I run often as a DBA. It’s useful for identifying blocking or long running transactions, or checking in…
-
Download and Install SQL Server Management Studio (SSMS)
In this short post, I’ll share how to easily download and install SQL Server Management Studio (SSMS) on your Windows computer. I’ll include some tips to help improve your SSMS experience too! Step 1: Download SSMS Go to the official Microsoft website to download the latest version of…
-
How to Check and Manage SQL Server Services
As a SQL Server DBA, it’s important that we have quick and efficient ways to check SQL Services. We need to ensure our SQL Services are always available, and we often need to restart or make changes to them in SQL Server Configuration Manager. This includes the SQL…
-
Checking if Query Store is Enabled in SQL Server
This post shares the simple steps and SQL queries to check if Query Store is enabled in SQL Server, and view its options for a database. The Query Store feature was introduced in SQL Server 2016 (13.x) and enabled by default in SQL Server 2022 (16.x), if created…
-
SQL Server Performance Troubleshooting Scripts
When your SQL Server starts to experience performance issues, it’s important to have tools at your disposal to quickly identify and address the root causes. One such tool is having a performance troubleshooting scripts that provides some insights into SQL Server’s current state; including worker threads, running queries,…
-
Checking SQL Server Mirroring Health & Latency
In this blog post I’m sharing info on how to check the health and latency of your Database Mirroring in SQL Server. Monitoring Database Mirroring latency in SQL Server is needed for maintaining database availability and ensuring quick failover readiness. As a DBA we should be monitoring this…
-
SQL Server Replication Monitoring Scripts
In this post I’m sharing scripts and tips that will help you monitor, identify and troubleshoot SQL Server Replication latency and issues. The following is included in this article: 1. Check Latency in Log Reader Agent. 2. Check Latency in Distribution Agent. 3. Check Undistributed Commands. 4. List…
-
Get Last Node Blip in SQL Server FCI
In a SQL Server Failover Cluster Instance (FCI) environment, a “node blip” refers to the event when the active SQL Server instance moves from one cluster node to another. This movement, typically triggered by a Failover or planned maintenance, causes a brief outage—usually 30 to 60 seconds. While…
Useful SQL DBA Scripts
Performance
– Quick Performance Troubleshooting Scripts
– Get Current User Activity & Blocking
– Get Wait Stats & Top Consuming Queries
– Get Database Sizes & Space Used
– Identify Missing & Unused Indexes
High Availability
– Get Always On Availability Group (AAG) Latency
– Get Mirroring Status & Latency
– Get Replication Latency
– Get Last Node Blip in SQL Server FCI
Maintenance
– Get Estimated Database Backup/Restore Time
– Get Last Database Backup Dates/Times
– Get Index & Heap Fragmentation Levels
– Get Table Sizes in SQL
Security & Auditing
– Get SQL User Permissions and Roles
– Creating SQL Users on Availability Groups
– Audit Failed Login Attempts
Categories
– AWS
– DBA Stories
– Linux
– MySQL
– Other
– Postgres
– PowerShell
– Redshift
– SQL Server
– Windows Server
Tags
Always On Availability Groups (AAG) (3) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (71) Database Backups & Recovery (12) Database Mirroring (2) Deleting Data (1) Error Messages (4) Git Commands (5) Importing & Exporting Data (2) Linked Servers (3) Linux Admin (2) Logging & Monitoring (1) Measuring Databases (10) Microsoft Patching (2) PowerShell Scripts (1) SQL Server Agent (4) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (14) SQL Server Network Connectivity (2) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance (5) SQL Server Permissions (1) SQL Server Processes (5) SQL Server Replication (1) SQL Server Scripts (12) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (20)