Log File Truncate vs Shrink

  • I know the difference between Truncate and Shrink, while shrink makes file size grow smaller, truncate just removes committed transactions from the log file, hence creating space for future transactions.

    I have misunderstanding on how log file actually saves log records and how long does it save those records in it. Let's say we did a full backup, then one log backup. Now, after the log backup, are still all committed transactions(which were already backed up) kept in log file? Or are they automatically truncated? Do I need to perform repeated truncation otherwise log file will become full and affect performance?

    Thanks for your time!

  • A log file backup doesn't remove transactions from the log file, but it releases them.  The sections of the log file that have been fully committed and backed up are marked as available for reuse.

  • elea.grig - Monday, November 12, 2018 10:47 AM

    I know the difference between Truncate and Shrink, while shrink makes file size grow smaller, truncate just removes committed transactions from the log file, hence creating space for future transactions.

    I have misunderstanding on how log file actually saves log records and how long does it save those records in it. Let's say we did a full backup, then one log backup. Now, after the log backup, are still all committed transactions(which were already backed up) kept in log file? Or are they automatically truncated? Do I need to perform repeated truncation otherwise log file will become full and affect performance?

    Thanks for your time!

    On this site is a series of articles that may make sense to read.  It likely will answer all of your questions. 

    http://www.sqlservercentral.com/stairway/73776/

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

  • Here is the difference between truncating and shrinking the log file in SQL Server. 
    https://www.systoolsgroup.com/updates/difference-between-truncating-and-shrinking-the-log-file/

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply