1-800-691-1991 | 9am - 8pm ET
EN

SQL LDF not smaller after truncation

KB ID: 1876
Product: Veeam Backup & Replication 11, Veeam Backup & Replication 10, Veeam Backup & Replication 9.5, Veeam Backup & Replication 9.0, Veeam Backup & Replication 8.0, Veeam Backup & Replication 7.0
Published: 2014-04-21
Last Modified: 2021-09-24
Languages: DE

Challenge

After Veeam Backup & Replication or Veeam Agent for Windows successfully truncates a SQL server with Application-Aware Processing enabled, the LDF files do not become smaller.

Cause

This is due to the fact that the LDF file itself is a container, when truncation occurs the internals of the LDF are cleared and space is freed within it, but the LDF itself is not made smaller.

One could manually shrink or configure “Auto Shrink” to make the LDF itself physically smaller.

Solution

Considerations regarding Shrinking

The information provided below is a limited explanation of shrinking and is only intended to demonstrate how to perform a shrink operation. Veeam Support highly recommends before shrinking, you review options with your SQL Administrator and conduct independent research. Many tech articles recommend against shrinking when it is not strictly necessary. Before performing a shrink operation, you should fully understand the impacts of shrinking (e.g. fragmentation and performance).

Advised reading regarding SQL shrinking can be found here:
https://docs.microsoft.com/en-us/sql/relational-databases/databases/shrink-a-file

To view the actual free space within the LDF file, perform the following.

  1. Open SQL Management Studio and connect to the SQL instance where the database in question is located.
  2. Right-Click on the database and go to Tasks>Shrink>Files
shrink Note: This screenshot shows the VeeamBackup database only as an example. One should perform the shrink task against the database whose log file needs to be explicitly shrunk.
  1. Switch to "Log" under [File type:]
spacetoshrink
This will display the currently allocated space and the available free space. The database in this example is set for "Simple" recovery model, which keeps the log size low. When a SQL database is configured for "Full" recovery model, the LDF could be considerably larger depending on the time between truncation events.
KB ID: 1876
Product: Veeam Backup & Replication 11, Veeam Backup & Replication 10, Veeam Backup & Replication 9.5, Veeam Backup & Replication 9.0, Veeam Backup & Replication 8.0, Veeam Backup & Replication 7.0
Published: 2014-04-21
Last Modified: 2021-09-24
Languages: DE

Couldn't find what you were looking for?

Below you can submit an idea for a new knowledge base article.
Report a typo on this page:

Please select a spelling error or a typo on this page with your mouse and press CTRL + Enter to report this mistake to us. Thank you!

Spelling error in text

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Your report was sent to the responsible team. Our representative will contact you by email you provided.

Oops! Something went wrong.

Please try again later.

KB Feedback/Suggestion

By submitting, you are agreeing to have your personal information managed in accordance with the terms of Veeam's Privacy Policy.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Thank you for your interest in Veeam products!
We've sent a verification code to:
  • Incorrect verification code. Please try again.
An email with a verification code was just sent to
Didn't receive the code? Click to resend in sec
Didn't receive the code? Click to resend

ty icon

Thank you!

We have received your request and our team will reach out to you shortly.

OK

error icon

Oops! Something went wrong.

Please try again later.