Tag: Storage and Capacity

  • How to Shrink SQL Server Database Files in Chunks

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity A data file that’s grown far past what the database actually needs, after a one-off bulk load, an archive cleanup, a migration that left behind a much bigger footprint than the data now occupies, eventually needs to come back down.…

  • How to Right-Size SQL Server Database Files

    Auto-growth is not the problem. Unplanned, reactive growth is. When database files are undersized, SQL Server is forced to extend them repeatedly under load. Each growth event introduces a pause. If those pauses occur during peak workload, they can cause noticeable latency, increased I/O pressure, and in some cases application timeouts. Right-sizing database files is…

  • DBA Scripts: Get Disk Space on SQL Server

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity A SQL Server that runs out of disk stops taking writes, and depending on which volume filled up, that can mean suspended databases, a frozen transaction log, or failed backups at exactly the wrong moment. Disk space is the least…

  • Deleting Rows in Batches in SQL Server

    Deleting large volumes of data from a SQL Server table looks simple, but it can cause real problems if done carelessly. A single large DELETE can: When you’re cleaning up historical data or running routine maintenance, deleting rows in batches is usually the safest and most predictable approach. This post shows a simple, production-safe pattern…

  • DBA Scripts: Get Database IO Usage

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning When a SQL Server is struggling and the usual suspects (CPU, memory, blocking) come back clean, the next question is always the same: which database is hammering the disks? On a busy instance hosting ten…

  • Get Database File Names and Paths in SQL Server

    As a DBA, you regularly need to know where your database files live, how big they are, and how they’re configured to grow. Capacity planning, migration prep, new environment review, disk space incidents: they all start here. This script gives you a full picture of every user database file on the instance: physical path, drive…

  • Applying Data Retention Safely in SQL Server

    Data retention in SQL Server usually means deleting old data in a controlled and repeatable way. That might be driven by compliance requirements, table growth that’s starting to hurt performance, SQL Server Express size limits, or simply keeping log and audit tables under control. Whether this is a one-off cleanup or a permanent maintenance task,…