Today I received an interesting question from the VM admin of one of my consulting companies. The Question was, “I am backing up SQL Server Instances every day at 3am. I have my Veeam tab for SQL Server Logs set to “truncate the log”. Why is the transaction log staying the same size or growing for some of my databases but not all of them.”
First of all shrinking a TLOG is not the same as truncation of a TLOG. Truncation of a TLOG is (not going into all the details) setting of the VLF (Virtual Log File) status to zero, if the VLF can be over written. Basically truncation of a TLOG, frees up space in the file.
Shrinking a TLOG is actually taking the file and making it smaller.
What the Veeam software was doing was truncation of the TLOG, not shrinking.
Unfortunately, the real problem was when the Veeam truncated the TLOG, the backup sequence was broken for the DBA. So the only backup available was the Veeam 3am backup, which is fine if they do not need to restore point in time during the day.
The VM admin was also worried about the space the TLOGs were holding. The databases with the large transaction files were FULL Recovery Mode databases. The TLogs were not being backed up. So the TLogs file size will grow until it is backed up. For the databases that has SIMPLE Recovery Mode, the files were not growing.
In my next blog, I will go into detail about the SQL Server TLOG and how it works with backups, truncation, and shrinking. For now, take a look at these great blogs from others on the TLOG to understand more about why the TLOG in this case is growing.