Shrinking T-Log files

  • I need to shrink Transaction Log files since they have grown too much. Also all the databases have Logshipping\Mirroring configured. So if I can get a script to shrink T-Logs for all the databases without disturbing Logshipping\Mirroring (Not breaking log backup chain).

    Please let me know if you have any questions and any help is appreciated.

  • shrinking logs does not break the lsn chain so will not affect logshipping or mirroring.

    However, avoid shrinking the logs if you expect them to grow again due to normal activity.

    ---------------------------------------------------------------------

  • Thanks for your reply. I do not shrink regularly. I just want the script handy in case need to shrink few logs. Any script you send is much appreciated. 🙂

  • I'm afraid I don't have one, I would google it or there may be one or something you can alter in the scripts section of this site

    ---------------------------------------------------------------------

  • Aaitish,

    I agree with previous person. If you look online for SHRINK Database and sp_MSForeachDB you should be able to put together a script that will loop through your database names to do the shrink. Also, I really would not encourage you to do a shrink while your log shipping is in progress. You don't want to be shrinking the log while Log Shipping is trying to back it up.

    I would strongly suggest you visit http://www.sqlskills.com and search for "transaction log throughput" and "VLFs too few or too many". You will find a couple of excellent articles from Kimberly Tripp on managing the transaction log.

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

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