if I backup the transaction logs regularly, I see that it will also truncate the log to free up space.
My question is, why would I then want to regularly shrink the log file? Isn't both of these operations the same? What am I missing here?
if I backup the transaction logs regularly, I see that it will also truncate the log to free up space.
My question is, why would I then want to regularly shrink the log file? Isn't both of these operations the same? What am I missing here?
Truncating a log file will mark the log VLF as 'ready to be written over'. You can see the VLFs under USE <DBNAME>; DBCC LOGINFO();. Shrinking a log file will literally give the space back to the OS. This could be problematic because a log file must be 0'd out before use, even if you use the Instant File Init. option in Windows. This will block writes until the space is freed up when you need it again. Usually best to leave the log file the same size. If you have a minimum % or mb of space per growth it will wait until that number is reached.
You should also consider sizing and managing your VLFs.