Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Aug 2007
    Location
    Wellington
    Posts
    2,313

    Default SQL Server log files

    Hi all,

    We use Microsoft SQL Server at work (a mix of 2000 and 2005) and have recently discovered that a couple of our databases have massive log files (.ldf), filling up the disk. In one case it's a 7GB log file for a 200MB database!!

    Is there a way to safely reduce the size of them so we can reclaim some disk space? I notice that most of our other databases have 1-5MB log files.

    TIA
    "I would tell you a UDP joke but you might not get it."

  2. #2
    Stoopid Irriot! goodiesguy's Avatar
    Join Date
    Mar 2010
    Location
    Dunedin
    Posts
    2,837

    Default Re: SQL Server log files

    I would probably leave it. If the files are not important, you could delete them, or back them up somewhere to save space.

    I've never used SQL Server so i am probably wasting my time posting this, but i hope this gets sorted.
    An opiniated, but well meaning member

    PC: Intel® Core™ i5-650 3.20 GHz | Intel® Desktop Board DQ57TM | 4GB DDR3 RAM | Windows 7 Pro 64-Bit

  3. #3
    Moderator Jen's Avatar
    Join Date
    Dec 2004
    Location
    Auckland
    Posts
    7,920

    Default Re: SQL Server log files

    Quote Originally Posted by goodiesguy View Post
    I would probably leave it. If the files are not important, you could delete them, or back them up somewhere to save space.

    I've never used SQL Server so i am probably wasting my time posting this, but i hope this gets sorted.
    Please do not give advice on things when you have no idea what you are talking about. Deleting the entire log file (not just contents) in some set-ups can render a system dead in the water, and this isn't someone's home server being discussed.

    jwil1, I would wait for advice from an experienced SQL server user.
    Last edited by Jen; 19-10-2011 at 06:39 AM.

  4. #4
    Misc. User of PressF1 somebody's Avatar
    Join Date
    Dec 2004
    Posts
    5,198

    Default Re: SQL Server log files

    Definitely DON'T delete those files.

    Are you guys backing up these databases, and if so, how?
    Any views expressed here are my own and do not necessarily represent the views of my employer or any affiliated 3rd party.

  5. #5
    Senior Member
    Join Date
    Jan 2008
    Posts
    2,662

    Default Re: SQL Server log files

    Some Server 3rd party backup programs will commit/flush the log files. Doesnt allways work thou.
    in 2003 there is a reg hack to reduce the log file size (you'll have to google it)
    In 2008 there is a setting in the SQL management.

  6. #6
    Senior Member
    Join Date
    Aug 2007
    Location
    Wellington
    Posts
    2,313

    Default Re: SQL Server log files

    Thanks for the input guys.

    In the end I asked a friend who has been a DBA and he advised to set the databases in question to use Simple Recovery mode, then shrink the log files. This worked and it's all good now
    Last edited by jwil1; 19-10-2011 at 01:09 PM.
    "I would tell you a UDP joke but you might not get it."

  7. #7
    Misc. User of PressF1 somebody's Avatar
    Join Date
    Dec 2004
    Posts
    5,198

    Default Re: SQL Server log files

    Good to hear. Be aware that running in Simple Recovery mode limits the recoverability of your database, should you ever need to restore from backup.
    Any views expressed here are my own and do not necessarily represent the views of my employer or any affiliated 3rd party.

Similar Threads

  1. Replies: 20
    Last Post: 03-01-2009, 05:03 PM
  2. compressing JPEG files on a server
    By lance4k in forum PressF1
    Replies: 9
    Last Post: 12-11-2005, 12:23 AM
  3. Replies: 0
    Last Post: 08-09-2003, 01:19 PM
  4. Replies: 1
    Last Post: 18-12-2002, 08:38 PM
  5. Replies: 2
    Last Post: 21-12-2001, 12:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •