DBA Scripts – SQL Server Toolkit

DBA Scripts is a practical toolkit for SQL Server environments. It contains reusable scripts for day-to-day DBA tasks, built for situations where you need answers quickly, not documentation.

GitHub Repo: 🔗 https://github.com/peterwhyte-lgtm/dba-scripts

Typical use cases:

  • blocking incidents
  • performance degradation
  • backup verification
  • migration preparation
  • production diagnostics

Quick Start

git clone https://github.com/peterwhyte-lgtm/dba-scripts
cd dba-scripts
.\Initialize-Environment.ps1

To target a specific instance:

.\Initialize-Environment.ps1 -ServerInstance PROD01\SQL2025

Once set, all scripts automatically use that connection.


What’s Included

⚡ Performance & Troubleshooting
> Blocking, long queries, wait stats, missing indexes, deadlocks.

📊 Monitoring & Health
> CPU, memory, disk pressure, Temp DB, SQL Agent jobs, configuration checks.

💾 Backups & Recovery
> Backup coverage, history, restore validation, gap detection.

🔐 Security & Configuration
> Logins, permissions, sysadmin review, orphaned users.

🟢 High Availability
> Always On health, replica state, sync latency.

🚚 Migration Support
> Compatibility checks, deprecated features, dependency discovery.


How It Works

Three simple ways to use it:

SQL Scripts
Copy SQL Scripts directly from GitHub or Repo into SSMS → run → get results immediately.

PowerShell
Run named scripts → export outputs to CSV for analysis or reporting.

Health checks
Run a full instance scan in a single command.


📝 Published DBA Script Articles

Browse the published DBA Script posts below. Each article includes usage notes, examples, and a direct link to the script in GitHub.

  • MSSQL Scripts

    DBA Scripts – SQL Server Toolkit DBA Scripts is a practical toolkit for SQL Server environments. It contains reusable scripts for day-to-day DBA tasks, built for situations where you need answers quickly, not documentation. GitHub Repo: 🔗 https://github.com/peterwhyte-lgtm/dba-scripts Typical use cases: Quick Start To…