Blog Posts
-
SQL Script to Get AAG Latency
In this post, I’m sharing a script that I use frequently as a Production SQL DBA to check Always On Availability Group (AAG) latency. Always On Availability Groups (AAG) are a high-availability and disaster recovery solution in SQL Server, allowing you to synchronize databases across multiple replicas. These…
-
Creating SQL Logins on an Availability Group (AG) Environment
In an Always On Availability Group (AG) environment, SQL logins must be configured with consistent Security Identifiers (SIDs) across all replicas to avoid issues like orphaned users and ensure seamless authentication during failovers. For Domain users in SQL, this sync’s automatically and we just need to create the…
-
CIDR Conversion Table / Subnet Calculator
This blog post provides a quick reference table for CIDR notation, subnet masks, and host counts, making it a valuable tool for tasks like configuring security groups, firewall rules, and subnetting. It simplifies network planning and ensures accurate IP address allocation for efficient and secure network setups. CIDR…
-
Removing Quotes from Multiple CSV Files in a Directory Using PowerShell
Managing CSV files often involves cleaning up data before processing. A common task is removing unwanted quotation marks from the contents of CSV files. I wrote a blog post on how to remove quotes from a single CSV file using PowerShell some years ago, which I have just…
-
Keeping SQL Server and Critical Systems Up to Date
Applying the latest patches to SQL Server, Windows OS, and underlying hardware is a vital part of maintaining secure, high-performing systems. For many organizations, this is done on a regular schedule—monthly, quarterly, or aligned with specific maintenance windows. However, for business-critical, 24/7 systems, patching takes extra planning and…
-
How to Set the Default Database for SQL Server Users
This blog post contains a quick guide on how to change your default database when you or your users next log in to SQL Server via SSMS. When you log into SQL Server using SSMS and open a new query window, you will automatically be set to use…
-
How to Open SSMS as a Different Domain User
If you’re working with SQL Server in a corporate environment, you might need to connect to the server using a different Domain User account, opening SQL Server Management Studio (SSMS) as a another user. This may be required if your computer is joined to a different Domain than…
-
Troubleshooting Database Mirroring Issues in SQL Server
Maintaining high availability and data integrity in a SQL Server environment is one of the main priorities as a SQL DBA. One issue we may encounter is Mirrored databases being left in a Disconnected or In Recovery state. In this article, we’ll share the different methods on how…
-
What’s New in SQL Server 2025
Microsoft announced SQL Server 2025 at Microsoft Ignite, with major new features focused on AI and integrating Azure SQL DB capabilities into on-premises servers. Check out this Microsoft Announcement post for more information: Announcing Microsoft SQL Server 2025: Enterprise AI-ready database from ground to cloud Key Features –…
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)