Shrinking log file implications

  • Hi everyone, I asked the below question in another thread but since there was no reply, I decided to create it's own thread. Thank you.

    Question for the experts here, is dbcc shrinkfile('log_file', truncateonly) the same as the option "Compress pages and then truncate free space from the file" in EM > Shrink File? And if yes, does running this option also remove the inactive transactions (and so requiring an immediate full backup)?

  • No.

    "Compress pages and then truncate free space from the file" is equivalent to  dbcc shrinkfile('log_file').

    dbcc shrinkfile('log_file', truncateonly) is equivalent to "Truncate free space from end of file".  No log data is moved.

    The log content is not truncated, only unused space from previous truncations. You would have to truncate the log FIRST, then shrink, to get the minimum file size.

     

  • Great, thank you for clearing that up for me.

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

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