Hi, I am doing maintenance on my primary server, rebuilding and reorganizing tables. I am doing it parts. Last night I rebuilt an index took an hour. The ldf file grew from 20gb to 70gb and is currently 99% empty. The database is in transaction log-shipping mode. I can see that since then the backup of the log files takes much longer and I am afraid it's because the ldf file is bigger even though it's empty. I want to shrink the ldf on the primary server. Can I do it or will it destroy the transaction log shipping? If I can do it just with TruncateOnly or NoTruncate, from what I found, it seems I can shrink but just with NoTruncate, but would this help me at all?
I would avoid constantly messing about with the log size but, once you've finished these unusual operations, I say shrink the log back to its normal size. The shrink will be log shipped over to the standby database and will cause the log over there to shrink too. (I couldn't find any details about this when I had the same issue so I just tried it and it worked perfectly.)