shrink file

  • I have a database, which is around 2gb but the transactional log file is around nearly 2gb. In order to reduce the size of the log file I was going to shrink performance on the file. Would there be other recommendations because shrinking files should not be done unless it is really necessary.

  • Shrink performance on the file? I don't know what you mean, I'm afraid. But, unless it's a problem that your transaction log is 2GB (perhaps you're running out of space on the disk), my advice is to leave it alone. It's not doing any harm.

    John

  • There are some questions that you need to answer first:

    1. Why did the Tlog file grow to 2gb

    2. What recovery model are you in? Full, Simple or Bulk?

    3. If you shrink the file will it just grow again? (Not good for performance)

    4. How many VLFs do you have now? You might need to shrink the number of VLFs.

    The basic idea is to pre-size the transaction log file to the correct size and leave it alone even if it sits at 1% used. I would suggest you download the following book and read it for best practices for managing your Tlog:

    http://www.red-gate.com/community/books/sql-server-transaction-log-management



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

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

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