The disk alert fires at 2 a.m. The data file is modest. The transaction log has grown to fill the volume. You run a shrink, nothing happens, and the log stays the same size.
Shrinking is almost never the answer. The log is large because something is stopping SQL Server from reusing it, and you need to find out what.
How the log works
Every change in SQL Server is written to the transaction log before it is considered committed. The log is divided internally into virtual log files, or VLFs. SQL Server writes through them in order and wraps around when it can.
It can only reuse a VLF once it is no longer needed. Truncation, which marks VLFs reusable, does not shrink the file. It makes space inside the file available again.
If truncation cannot happen, the log keeps growing to make room. That is the usual story behind a runaway log: the file grows because nothing can be reused, not because the work was unusually large.
Ask the database why
SQL Server tells you what is blocking reuse. Run this:
select name, recovery_model_desc, log_reuse_wait_desc
from sys.databases
order by name;
The log_reuse_wait_desc column names the current reason. A few values cover most cases:
LOG_BACKUP: the database is in full or bulk-logged recovery and the log has not been backed up since the space was used.ACTIVE_TRANSACTION: a transaction is still open, and the log from its start onward cannot be reused.REPLICATION: a replication or change tracking reader has not caught up.AVAILABILITY_REPLICA: a secondary replica has not yet received or hardened the log.ACTIVE_BACKUP_OR_RESTORE: a backup or restore is running.NOTHING: no wait right now. The file is large but reusable.
Read the value first, before you touch anything else. It points to the fix.
The most common cause: no log backups
In the full recovery model, the log is kept until a log backup captures it. If you never take log backups, or the job has been failing, the log grows until the disk is full.
The full recovery model exists so you can restore to a point in time. If you need that, schedule log backups at an interval that matches how much data you can afford to lose. If you do not need it, the simple recovery model truncates the log at checkpoints and removes the issue, at the cost of point-in-time restore.
Be deliberate about the switch. Changing a database to simple recovery and back breaks the log backup chain. After you return to full recovery, take a full or differential backup to start a new chain, or log backups will not be restorable in sequence.
Many databases end up in full recovery because that is the default for some setups, without anyone choosing it. Check which databases need point-in-time recovery and which do not.
Open transactions
When the wait is ACTIVE_TRANSACTION, find the transaction. A forgotten session, a long batch job or an application that opens a transaction and never commits can hold the log hostage.
These commands help:
dbcc opentran;
select session_id, transaction_id, name, transaction_begin_time
from sys.dm_tran_active_transactions
order by transaction_begin_time;
DBCC OPENTRAN reports the oldest active transaction in the current database. Match the session to a person or an application and fix the cause. Killing a session that is partway through a large change forces a rollback, and the rollback itself can take a long time and needs log space.
Checking how much log is really in use
Do not assume a large file means a full log. The size of the file and the space in use are separate numbers:
select total_log_size_in_bytes / 1048576.0 as total_mb,
used_log_space_in_bytes / 1048576.0 as used_mb,
used_log_space_in_percent
from sys.dm_db_log_space_usage;
If usage is low and the wait is NOTHING, the log reached a large size at some point and is now mostly empty. That is the case where a one-time shrink is reasonable.
Shrink once, then size it properly
A shrink is acceptable when you have fixed the cause and want to give back space that is no longer needed. Do it once, to a sensible size, and move on.
Repeated shrinking makes things worse. The log grows again, and every growth event costs time while SQL Server initializes the new space. Writers wait during growth, so transactions stall at the worst moments.
Growth settings matter too. Percentage growth on a large log produces ever larger chunks. Fixed-size growth, set from what your workload actually needs, is easier to reason about. Avoid a very large number of tiny growths, because they create many small VLFs, which can slow recovery and startup.
Size the log from observation. Watch peak usage across a full business cycle, including month-end processing and index maintenance, which can generate a lot of log. Then set the initial size above that peak and leave headroom.
Make it hard to miss
Alert before the disk fills, not after. Watch the free space on the log volume, and alert when log_reuse_wait_desc stays at LOG_BACKUP or ACTIVE_TRANSACTION for longer than your backup interval.
A failed log backup job is the single most common root cause. Monitor the job’s outcome and the age of the last log backup per database, and treat a missed backup as an incident, not a note.
A quick runbook
- Query
log_reuse_wait_desc. - Fix what it names: back up the log, end or resolve the transaction, repair the replica.
- Confirm with
sys.dm_db_log_space_usagethat space is reusable. - Shrink once, only if you must, and set a fixed growth size.
- Add the alert so the next one reaches you before the disk does.

