Category: Storage & Capacity

  • How to Move TempDB Files in SQL Server

    TempDB on the C: drive is a problem waiting for a busy day. It can grow very large, very quickly, sometimes within minutes under the right workload, and when it fills the OS drive it takes the whole server down with it. Moving the tempdb files to their own drive is a standard best practice,…

  • Add a Filegroup to a SQL Server Database

    ADD FILEGROUP then ADD FILE, and the trap in between: a filegroup with no files will accept a CREATE TABLE and only fail at the first INSERT with Msg 622. Placing objects, changing the default, and removing one again.

  • DBA Scripts: Get Autogrowth History

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity SQL Server autogrowth is one of those settings that is often ignored until it becomes a production problem. A database file growing during normal business hours is usually a sign that SQL Server is reacting to a capacity issue. The…

  • DBA Scripts: Get Transaction Log Size and Usage

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Understanding Transaction Log Size Usage Keeping an eye on transaction log usage is one of the simplest ways to prevent unexpected database outages. When a transaction log fills, SQL Server cannot continue writing transactions, backups begin failing, applications stop processing…

  • DBA Scripts: Get Log Reuse Waits

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity The One Question That Actually Matters A transaction log that won’t truncate and keeps growing, or a log backup job that suddenly can’t keep up, always comes back to the same underlying question: what is this database’s log actually waiting…

  • DBA Scripts: Get TempDB Configuration

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity TempDB is shared by every database on the instance, and it’s usually the first thing to show contention under load, long before any user database does. Unlike a user database’s files, TempDB’s default configuration out of the box (a single…

  • DBA Scripts: Get Table Sizes

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Walk onto a new SQL Server instance and the first honest question is usually “where’s all the space going.” Not at the database level, sys.master_files answers that in seconds, but at the table level, inside a database that’s grown for…

  • DBA Scripts: Get SQL Server Database File Details

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Understanding SQL Server Database File Layout SQL Server database files are one of those areas where small configuration issues can become large operational problems. A database may be running perfectly today, but poor file placement, incorrect growth settings, or uncontrolled…

  • DBA Scripts: Get Database Sizes and Free Space

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Get SQL Server Database Sizes and Free Space Database size checks are one of the first things I review when assessing a SQL Server environment. The goal is simple: understand where storage is being consumed, identify databases that need attention,…

  • DBA Scripts: Get VLF Counts

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity VLFs – The Hidden Log Performance Problem Virtual Log File (VLF) count is one of those SQL Server health checks that is often overlooked. It rarely generates alerts, doesn’t usually slow down a single query, and most users never know…