Need Help on Shrinking Database....

  • Thanks everyone for your response.

    I know shrink is bad idea but as Paul said we do it with calculation. We try to shrink the log file to 1/4 of the mdf file and in my current scenario, shrink never happens as most of my log files are around 15-20% of the data file.

    We are using shrink option in order to control the log file growth.......

    Once again thanks everyone for your reponse......

  • Shrink is not how you control the growth of the log. The log should be big enough for the largest single transaction, the largest number of transactions between log backups and left alone. If the log reaches half the size of the MDF during regular activity that's because it needs to be that size.

    Once-off shrinks after unusual activity is fine, regular shrinks are just going to hinder the performance of your system

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 1) don't shrink the tlogs - they are VERY likely to grow back up again, leading to OS disk file fragmentation

    2) logs won't necessarily shrink when you force it due to internal structures known as Virtual Log Files (VLFs). If the active portion of the log is in a VLF near the end of the physical file you won't get much size decrease. You can add "dummy" transactional data to the log to get the VLF to "wrap" back to the beginning of the physical file.

    3) don't shrink the tlogs! :w00t:

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 3 posts - 16 through 17 (of 17 total)

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