![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipyWzfmK7K7QRGqr6JjkX9bVJKVxjXceWHERuneQXeTClY8SDW0lQJj3KZUphfarzR7xJaIuqJTFZ9u7V0aZmfG3Kz0p3gTzVK1tDpSTD677VkDpqVX4IASXGqomEsSVkG6O13dFPx_GeA/s400/1.bmp)
A log record is no longer needed in the transaction log if all of the following are true:
The transaction of which it is part has committed.
The database pages it changed have all been written to disk by a checkpoint.
The log record is not needed for a backup (full, differential, or log).
The log record is not needed for any feature that reads the log (such as database mirroring or replication).
A log record that is still needed is called active, and a VLF that has at least one active log record is also called active. Every so often, the transaction log is checked to see whether all the log records in a full VLF are active or not; if they are all inactive, the VLF is marked as truncated (meaning the VLF can be overwritten once the transaction log wraps). When a VLF is truncated, it is not overwritten or zeroed in any way—it is just marked as truncated and can then be reused.
This process is called log truncation—not to be confused with actually shrinking the size of the transaction log. Log truncation never changes the physical size of the transaction log—only which portions of the transaction log are active or not.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglU8djA_TOtCPOZnNScOKB46xUX390kbfhWNdbRVQMALOokQ5vAQ_9gVveP4hJobcDrLcI0xPXnCNGg193qLqph8kFaIoT5x0qRemy639DZls1clIDB1zr8k3JhSBfP3kAQ41no6I4-cvZ/s400/2.bmp)
The check whether log truncation can take place under either of the following circumstances:
When a checkpoint occurs in the SIMPLE recovery model or in other recovery models when a full backup has never been taken. (This implies that a database will remain in a pseudo-SIMPLE recovery model after being switched out of SIMPLE until a full database backup occurs.)
When a log backup completes.
There are two common issues that can prevent log truncation:
A long-running active transaction. The entire transaction log since the first log record from the oldest active transaction can never be truncated until that transaction commits or aborts.
Switching to the FULL recovery model, taking a full backup, and then never taking any log backups. The entire transaction log will remain active, waiting to be backed up by a log backup.