DBAtlas · Database operations atlas

Take a transaction log backup

SQL ServerBackup & Log

Command

BACKUP LOG [Customer]
TO DISK = N'D:\Backup\Customer_log_20260706_1200.trn'
WITH COMPRESSION, CHECKSUM, STATS = 10;

What it does

Takes a transaction log backup and (in FULL/BULK_LOGGED recovery model) truncates the used portion of the log so it can be reused.

When to use it

Regularly in FULL recovery model (e.g. every 15 min), for the point-in-time recovery chain, and when the log file grows.

Caution

Only meaningful in FULL/BULK_LOGGED recovery model (in SIMPLE the log is truncated automatically). At least one FULL backup must exist first so the log chain is not broken. Set up a correct delete/overwrite strategy for backup files.

Open in DBAtlas →

Related