Tag: Storage and Capacity

SQL Server storage and capacity management topics, including database sizes, file growth, disk usage, free space monitoring, and capacity planning for production environments.

  • Track Database Growth Events Over Time in SQL Server

    SQL Server’s default trace captures database and log file growth events, but it’s short-lived. Once the trace rolls over or the instance restarts, that history is gone. If you want to understand growth patterns over time, react less to disk alerts, and stop guessing which databases are mis-sized, you need to store those events somewhere.…

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

  • Script: I/O Usage by Database

    This script returns total read and write activity per database based on file-level I/O statistics. It helps identify which databases are generating the most disk activity on the instance. This is commonly used during performance troubleshooting, storage pressure investigations, and workload analysis. The Script Example Output The result set shows one row per database, including…

  • Get Database Sizes and Free Space in SQL Server

    Keeping track of database file sizes and available free space is a basic but essential part of SQL Server administration. If you don’t know how large your data and log files are, or how much free space they contain, capacity planning becomes guesswork. Problems tend to surface late, usually during growth events, backups, or unexpected…

  • Show Database Growth Events in SQL Server

    Database file growth events are easy to ignore until they become a problem. When a data or log file autogrows, SQL Server pauses briefly to extend the file. If this happens frequently, it can introduce latency, increase I/O pressure, and in some cases trigger disk space incidents. For DBAs, understanding when files grow and which…

  • How to Check Transaction Log Space Usage in SQL Server

    Monitoring transaction log space usage is a fundamental DBA task. If a log file runs out of space, transactions can fail, applications can stop, and in the worst cases databases can be taken offline. This post shows two practical ways to check log space usage in SQL Server, starting with a built-in command and then…

  • 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. Whether you’re planning disk capacity, reviewing growth settings, troubleshooting space issues, or preparing for a migration, being able to quickly pull data and log file details across an instance is essential. This…

  • Script: Get Database Sizes and Free Space

    This script returns file-level size and free space information for all databases on a SQL Server instance. It shows how much space is allocated, how much is used, and how much free space remains inside each data and log file. This is a go-to check when reviewing storage usage, investigating unexpected growth, or validating capacity…

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

  • Checking Table Sizes in SQL Server

    Checking table sizes in SQL Server is a routine DBA task that supports capacity planning, performance troubleshooting, and data retention work. There are several ways to get this information. Some methods are better suited to automation and reporting, while others are quicker for ad hoc checks in SQL Server Management Studio. This post walks through…