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 10a, 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-03-08
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 prior to shrinking you review options with your SQL Administrator and perform independent research. There are many tech articles which recommend against shrinking when it is not strictly necessary. The impacts of shrinking (e.g. fragmentation and performance) should be fully understood prior to performing a shrink operation.

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 srhink task against the database whose log file needs to be shrunk specifically.
  1. Switch to "Log" under [File type:]
spacetoshrink
This will display the current 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 time between truncation events.
KB ID: 1876
Product: Veeam Backup & Replication 11, Veeam Backup & Replication 10a, 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-03-08
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.
We're working on it please try again later
Knowledge base content request
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.

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 go back try again later.