Tag: Database Admin

  • SQL Script to Show Exclusive Locks on Tables

    In this post I’m sharing a SQL script that will show exclusive locks for all tables in a database, with added info to help you understand what we’re looking at. Exclusive locks are a natural thing in SQL Server which ensures data integrity during updates or deletions by…

    Read More


  • How to Get SQL Server’s IP Address

    When managing or troubleshooting SQL Server, you might need to get the IP address your SQL Server instance is listening on. While servers can listen on multiple IP addresses, SQL Server offers a straightforward way to determine which address is used for your current connection. In this post…

    Read More


  • 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…

    Read More


  • 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…

    Read More


  • 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…

    Read More


  • 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…

    Read More


  • 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…

    Read More


  • 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,…

    Read More


  • 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…

    Read More


  • 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…

    Read More