• Sergiy (8/29/2016)


    That's pretty simple.

    During reindexing the log grows until it runs out of free space on the disk.

    Then it fails and stops.

    The backup job comes couple of hours later, cleans up the log and truncates the file.

    By the time you check it in the morning it all looks nice and innocent.

    Solution:

    Add BACKUP LOG step after rebuilding of each index.

    If you do log shipping then start the corresponding job step and don't proceed with a next index until it's completed.

    And do not truncate log files.

    You only fooling yourself by doing that.

    Problem is that the allocated space on the log would still be there, even if the log was truncated. From the stand point of the file system, they would see a full drive.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning