SQL Server Log Explorer
SQL Transaction Log

SQL Server log_reuse_wait_desc Values With Fixes for a Full Log

Andrew Jackson Published: 7 Minutes Reading
On this page

Quick Answer

Fix log_reuse_wait_desc waits in 5 ways. Query sys.databases to see the value. Take a log backup for LOG_BACKUP. Close the open transaction for ACTIVE_TRANSACTION. Resume mirroring or replication for the rest. Edit the recovery model only when you accept the data risk. Query log_reuse_wait_desc again after every fix.

log_reuse_wait_desc is a column in sys.databases that names the reason SQL Server cannot reuse space in a transaction log. Error 9002 and a log file that grows without stopping both point to log_reuse_wait_desc.

This guide explains all 13 states, shows the query and gives 5 methods to clear the wait.

What is log_reuse_wait_desc in SQL Server?

log_reuse_wait_desc is a text value that tells you what SQL Server waits for before it frees log space. Its partner column log_reuse_wait stores the same answer as a number. According to Microsoft, both columns show the wait as of the last checkpoint.

Log truncation frees space inside the log file. Truncation never shrinks the physical file. Large files with the value NOTHING are normal.

Do You Know? Our error 9002 transaction log full guide starts with the log_reuse_wait_desc query below.

What are the System and Software Specifications?

These tables list what your server and your workstation need to check log_reuse_wait_desc. Hardware figures come from the Microsoft SQL Server 2022 requirements page.

System Specifications

Component Requirement
Processor x64 processor, 1.4 GHz minimum and 2.0 GHz or faster recommended
Memory 1 GB minimum (512 MB for Express) and 4 GB or more recommended
Storage 6 GB of available space for SQL Server setup
Operating system Windows Server 2016 or later, Windows 10 version 1607 or later
Workstation for SSMS 22 x64 processor, 4 GB RAM minimum and a 1366 x 768 display

Software Specifications

Item Requirement
SQL Server version SQL Server 2008 or later returns the column. XTP_CHECKPOINT needs 2014 and SLOG_SCAN needs 2019
Client tool SQL Server Management Studio 22 (works with SQL Server 2014 and later) or sqlcmd
Permission Every login has VIEW ANY DATABASE through the public role by default
Recovery model FULL or BULK_LOGGED for the LOG_BACKUP, DATABASE_MIRRORING, REPLICATION and AVAILABILITY_REPLICA values
.NET Framework 4.7.2 for SQL Server 2022 setup

How do You Check log_reuse_wait_desc for a Database?

Query sys.databases and select the three columns below. Every database on the instance gets one row.

SELECT name, log_reuse_wait, log_reuse_wait_desc
FROM sys.databases;

Find the row of the database with the full log. Its log_reuse_wait_desc text tells you which section below to open.

What do the log_reuse_wait_desc Values Mean?

SQL Server shows 13 log_reuse_wait_desc values. Microsoft marks numbers 10, 11 and 12 as internal use only and number 14 (OTHER_TRANSIENT) as unused.

log_reuse_wait_desc What SQL Server waits for Fix
NOTHING Reusable log files exist None needed
CHECKPOINT No checkpoint since the last truncation. Routine for all recovery models Wait or execute CHECKPOINT
LOG_BACKUP A log backup (FULL and BULK_LOGGED only) Method #1
ACTIVE_BACKUP_OR_RESTORE A data backup or restore in progress Wait or cancel the backup
ACTIVE_TRANSACTION An open or long transaction Method #2
DATABASE_MIRRORING A paused mirror or a mirror far behind Method #3
REPLICATION Publication transactions not yet delivered Method #4
DATABASE_SNAPSHOT_CREATION A snapshot in creation. Routine and brief Wait
LOG_SCAN A log scan. Routine and brief Wait
AVAILABILITY_REPLICA A secondary replica applying log records Method #3
OLDEST_PAGE Indirect checkpoints make the oldest page older than the checkpoint Wait or execute CHECKPOINT
XTP_CHECKPOINT A checkpoint for memory optimized tables Wait. SQL Server takes one after 1.5 GB of log growth
SLOG_SCAN A scan of the secondary log with Accelerated Database Recovery (SQL Server 2019 and later) Wait

Two entries cause nearly all full log files. LOG_BACKUP appears when nobody backs up the log and ACTIVE_TRANSACTION appears when one session remains open.

How do You Fix a log_reuse_wait_desc Wait?

Five methods clear the wait. Match the method to the log_reuse_wait_desc value from the table.

Method #1: Take a Log Backup for LOG_BACKUP (Free, Safest)

Select this method when log_reuse_wait_desc shows LOG_BACKUP. Your database uses the FULL or BULK_LOGGED recovery model and no log backup has completed. Our SQL Server full recovery model guide explains why.

BACKUP LOG [YourDatabase]
TO DISK = N'D:\Backups\YourDatabase_log.trn';

Space becomes reusable after the backup finishes. Schedule this backup so the wait does not return.

Method #2: Close the Open Transaction for ACTIVE_TRANSACTION (Free, Needs Care)

Long transactions stop truncation under every recovery model. Find the oldest one with DBCC OPENTRAN.

DBCC OPENTRAN ('YourDatabase');

Output lists the session ID in the SPID line. Ask the owner to commit or roll back the work. Our check active transactions in SQL Server guide lists more queries.

KILL 57;

Heads Up. KILL rolls the transaction back and large transactions need a long rollback. Ask the owner first.

Pro Tip. ACTIVE_TRANSACTION shows that work is open but not what it changed. SQL Server Log Explorer previews the transaction name, time and query from the log.

Method #3: Resume Mirroring or Fix the Secondary Replica (Free, Needs Access to Both Servers)

DATABASE_MIRRORING means the session is paused or the mirror sits far behind. AVAILABILITY_REPLICA means a secondary replica still applies log records of this database.

  • Resume a paused mirroring session from the database properties or with ALTER DATABASE and SET PARTNER RESUME.
  • Open the availability group dashboard and check the synchronization state of the secondary replica.
  • Fix network or disk problems on the secondary server.

Our database mirroring in SQL Server and Always On availability groups guides explain both setups.

Method #4: Clear the Replication Backlog for REPLICATION (Free, Needs Replication Monitor)

REPLICATION means publication transactions have not reached the distribution database yet. Open Replication Monitor and check that the Log Reader Agent is active and error free.

Restart a stopped agent and wait for the backlog to clear. Our transaction replication in SQL Server guide shows the setup.

Method #5: Edit the Recovery Model to SIMPLE (Free, Ends Log Backups)

Select this method only for databases that do not need point in time restore. SIMPLE frees log space at every checkpoint.

ALTER DATABASE [YourDatabase] SET RECOVERY SIMPLE;

Heads Up. This edit breaks the log backup chain. Take a full backup first and review our recovery models and backup types guide.

How do You Confirm the Log Space is Free Again?

Query log_reuse_wait_desc again and check the used space of the log.

SELECT name, log_reuse_wait_desc FROM sys.databases WHERE name = 'YourDatabase';
SELECT total_log_size_in_bytes, used_log_space_in_bytes, used_log_space_in_percent
FROM sys.dm_db_log_space_usage;

Your first query should return NOTHING and your second query returns a lower percentage. Shrink the file only when you must free disk space. Our shrink transaction log file guide shows the safe order.

FAQs

Does log_reuse_wait_desc Show the Wait Right Now?

No. Microsoft states that log_reuse_wait_desc shows the wait as of the last checkpoint. Query again after a checkpoint to see the latest value.

Can log_reuse_wait_desc Say NOTHING While the Log File is Large?

Yes. NOTHING means reusable log files exist and truncation never shrinks the physical file. Shrink it only when you need the disk space.

Does a SIMPLE Database Show LOG_BACKUP?

No. LOG_BACKUP applies to the FULL and BULK_LOGGED recovery models only.

Which Permission do You Need for log_reuse_wait_desc?

No special permission for most logins. Every login has VIEW ANY DATABASE through the public role by default. OFFLINE databases need ALTER ANY DATABASE or CREATE DATABASE in master.

Can One Database Show Two log_reuse_wait_desc Values at Once?

No. Your database shows one value at a time. Fix that cause and query again to see the next one.

Does a Log Backup Shrink the Log File?

No. Log backups free space inside the file. Microsoft states that you must shrink the file to reduce its physical size.

Does log_reuse_wait_desc Update After You Fix the Cause?

Yes. Query sys.databases again after the next checkpoint or log backup. Your log_reuse_wait_desc value moves to NOTHING when no cause remains.

Final Verdict

log_reuse_wait_desc turns a full log from a guess into a clear task. Check the value, open the matching method and query log_reuse_wait_desc again.

Microsoft documents the values on its transaction log architecture page and the column on its sys.databases page.