SQL Server Log Won’t Truncate: What log_reuse_wait_desc Is Telling You

This page explains every value of log_reuse_wait_desc, the column in sys.databases that names what is stopping SQL Server from reusing transaction log space. Read it when a log will not truncate, keeps growing or will not shrink.

If a database is already failing writes with error 9002, start with SQL Server Transaction Log Full, the fast incident fix. Come back here for what each value means.


Check Every Database

Before you shrink anything or change a recovery model, ask SQL Server why it will not reuse the space. This lists the reason for every online database, problems first:

SELECT
    name,
    recovery_model_desc,
    log_reuse_wait_desc
FROM sys.databases
WHERE state_desc = 'ONLINE'
ORDER BY CASE WHEN log_reuse_wait_desc = 'NOTHING' THEN 1 ELSE 0 END, name;
SSMS results showing log_reuse_wait_desc per database, six on LOG_BACKUP and six on NOTHING

Here six databases in FULL recovery are waiting on LOG_BACKUP and the rest read NOTHING. The column turns “the log is full” into a named reason with a specific fix.


Reading It on a Real Instance

Output from the lab, using Get-LogReuseWaits, which adds recovery model, log size and the last log backup beside the reason:

SSMS results grid from the Get-LogReuseWaits script listing eight databases with their recovery model, log reuse wait reason, log size, last log backup and a status column. Six rows read LOG_BACKUP with a status of ACTION take a log backup; two read NOTHING with a status of OK. The top row has NULL for both last log backup columns.

Six databases in FULL recovery waiting on a log backup: five last backed up on 2026-07-28, more than a month before this run, and one never. That is not six problems. It is one missing job, and the column found it in a second.


Every Value, and What It Means

Microsoft documents thirteen values. Four of them account for almost every real incident, so those get the detail:

LOG_BACKUP
The database is in FULL or BULK_LOGGED recovery and the log cannot reuse space until a log backup runs. It usually means the log backup job is missing, not failing: a database switched to FULL with no schedule behind it. Take a log backup, then make sure a job exists. If the log has never been backed up, Microsoft says you need two log backups before it truncates.
ACTIVE_TRANSACTION
An open transaction is holding the log, usually a session that started one and never committed. It stops truncation in every recovery model, SIMPLE included. Find it with DBCC OPENTRAN and sys.dm_tran_database_transactions (the full query is in Transaction Log Full), then decide whether to commit or kill it. A kill rolls back, and the rollback needs log space and time too.
AVAILABILITY_REPLICA
An Availability Group secondary has not received or hardened the log yet, so the primary keeps it. This happens in synchronous and asynchronous commit mode alike. Nothing on the primary releases it while a secondary is disconnected or suspended: resume data movement, or remove a replica that is gone for good.
REPLICATION
Transactional replication or change data capture has not read the log yet. CDC reports as REPLICATION too. If the Log Reader Agent or the CDC capture job stops or stalls, the log grows without limit and will not shrink. Check the agent, or the cdc.<database>_capture job in SQL Server Agent, and get it moving.

The Rarer Values

You are unlikely to meet these, and most clear on their own. They are here so that a value you have never seen does not turn into an investigation.

  • NOTHING and CHECKPOINT, healthy. If the file is still enormous, that is a sizing question, not a truncation one.
  • ACTIVE_BACKUP_OR_RESTORE, a data backup or restore is running. Self-clearing, and only a problem when a full backup takes hours.
  • DATABASE_MIRRORING, the mirror is paused or a long way behind. Increasingly rare, since mirroring is deprecated.
  • DATABASE_SNAPSHOT_CREATION, a snapshot is being created. Worth knowing that DBCC CHECKDB builds an internal one, so this can appear during a routine integrity check.
  • LOG_SCAN, something is reading the log. Routine and normally brief.
  • OLDEST_PAGE, indirect checkpoints are on and the oldest dirty page predates the checkpoint LSN. More visible than it used to be, because indirect checkpoint is the default for databases created on SQL Server 2016 and later.
  • XTP_CHECKPOINT, an In-Memory OLTP checkpoint is needed. Only relevant with a memory-optimized filegroup, where Microsoft says to expect this or CHECKPOINT as normal.
  • SLOG_SCAN, Accelerated Database Recovery is scanning its secondary log stream. SQL Server 2019 and later, and the value the documentation covers worst (see below).

Log Won’t Shrink? Something Is Still Holding It

Truncation and shrinking are different things. Truncation frees space inside the log file for reuse and never makes the file smaller. A shrink gives disk back, and it can only release space that nothing still needs.

So if DBCC SHRINKFILE frees nothing, or the log grows straight back, read log_reuse_wait_desc for that database. Whatever it names is holding the log, and the shrink cannot get past it.

A stuck CDC capture job is a classic holder, and one I have met: until the job was moving again, the log could not be shrunk. Fix the holder first, then shrink once, only if the file is genuinely the wrong size for the workload.

Transaction Log Full covers why shrinking is not the fix for a full log, and how to size it instead.


Microsoft’s Own Two Pages Disagree

Worth knowing before you look things up mid-incident. The sys.databases reference lists thirteen values and points to the transaction log page for “more detailed explanations”.

That second page does not cover SLOG_SCAN at all, and it lists a value called OTHER_TRANSIENT that the first page does not. They were updated at different times, so if you cannot find your value on the transaction log page, that is why.

Docs: Microsoft’s reference covers every value in sys.databases, the transaction log and troubleshooting a full transaction log in full.

Frequently Asked Questions

I took a log backup and it still says LOG_BACKUP.

If that log had never been backed up before, that is expected. Microsoft: “If the log has never been backed up, you must create two log backups to permit the Database Engine to truncate the log to the point of the last backup.” Take a second one.

If it persists, the backup may have been copy-only, or the value may be lagging behind the last checkpoint. Transaction Log Full covers both.

Can this bite me in SIMPLE recovery?

Yes, and this is the most common misunderstanding on the topic. SIMPLE means you cannot take log backups, so LOG_BACKUP will never appear. It does not mean the log cannot fill. ACTIVE_TRANSACTION stops truncation under every recovery model, so one forgotten open transaction will grow a SIMPLE database’s log until the disk fills.

Why does my value not appear in Microsoft’s list?

Ids 10, 11 and 12 are documented only as “For internal use only” with no published description, and they are expected to be rare and short-lived. If you catch one, re-query rather than investigate. Anything else is worth reporting, because the documented set is small and stable.

Is there an official query for this?

Not a short one. The sys.databases reference page has three examples and none of them touch this column. What Microsoft does publish is a roughly 190 line diagnostic script, and it lives on the error 9002 troubleshooting page, not on the catalog view page. The three-column query above is the version you can actually remember at 2am.


Summary

When a log will not truncate or will not shrink, SQL Server already knows why and stores the answer in log_reuse_wait_desc. Read that column before you shrink anything, change a recovery model or add a file.

Four values cover almost every case: a missing log backup, an open transaction, a secondary replica that has not caught up, or a replication or CDC reader that has stalled. The rest are mostly routine and clear on their own.


Related

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *