Author: Peter Whyte

  • DBA Scripts: Get Compression Candidates

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Where Compression Actually Pays Off Row and page compression trade CPU for storage and I/O, and that trade is worth making on some tables and not others. The biggest, least-frequently-updated tables are usually the best candidates: maximum space and I/O…

  • DBA Scripts: Get Schema Change History

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration “What Changed on This Server Recently?” A query that worked yesterday now errors, a report comes back empty, a job that always succeeded fails, and everyone says nothing changed. Before chasing the symptom, answer the basic question directly: did anything…

  • DBA Scripts: Get Active Connections by Database

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting The Check Before You Take Anything Offline Taking a database offline, whether for a decommission, a restore, or a maintenance operation that needs exclusive access, starts with the same question: is anyone actually using it right now? Guessing wrong means…

  • DBA Scripts: Get CDC and Change Tracking

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration Two Features, Same Risk: They Both Grow the Transaction Log Change Data Capture and Change Tracking answer a similar question, “what changed and when,” for two different audiences, ETL/replication consumers for CDC, application-level conflict detection for Change Tracking. They’re unrelated…

  • DBA Scripts: Get Migration Login Audit and Post-Migration Validation

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment You are about to move logins to a new server, or you just did and something cannot log in. These 2 scripts cover both ends: Get-MigrationLoginAudit tells you what each login needs on the target, and Get-PostMigrationValidation gives you 13…

  • DBA Scripts: Get Version Upgrade Readiness

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment Before You Upgrade: What’s Actually Going to Break Migration Risk Assessment covers per-database risk findings when moving to different hardware or infrastructure. This post covers a narrower, earlier question: on THIS server, staying on the same infrastructure, what needs attention…

  • DBA Scripts: Get Query Store Regressions and Forced Plans

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning “What Changed Today” and “Is the Plan I Forced Still Any Good” A query that was fine yesterday is slow today, or a plan you forced has stopped protecting it. The first script compares each…

  • What WITH (NOLOCK) Actually Does in SQL Server

    Almost every SQL Server developer has copied WITH (NOLOCK) onto the end of a query at some point, usually because someone said it “makes queries faster” or “avoids blocking.” Both of those things are technically true. What rarely gets explained is what you’re trading away to get them. WITH (NOLOCK) doesn’t make a query faster…

  • DBA Scripts: High Availability

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks. High availability isn’t one technology, SQL Server ships several: Always On Availability Groups (the current, supported approach), Database Mirroring (deprecated since 2012 but still running in plenty of environments), Failover Cluster Instances, and Replication (which trades availability guarantees for data distribution instead). Whichever…

  • DBA Scripts: Get Replication Agent Status

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: High Availability Publications Look Fine. Are the Agents Actually Keeping Up? Replication Status tells you what’s published and subscribed. It doesn’t tell you whether the jobs actually moving that data, the Log Reader Agent and the Distribution Agent, are keeping up, or whether…