How to shrink the sharepoint database log file
Hello, I have a SharePoint content database with the size 70GB but he log file is 450GB. i wanted to shrink the log file. Can anyone tell me how to do that ? It would be great if anyone can provide me the complete flow. Do I have to shink the log file when the database is offline? what if we just take the backup and create a new log file ? How do we restrict the size of the log file by not growing big but just auto shrink by it self. This is all on the production server, i need to fix this asap. Any help would be appreciated. Thanks in Advance.
September 24th, 2010 5:02am

Set the backup model to simple. Back the database up and the log should truncate. Hope that helps. SharePointNinja
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2010 7:46am

Hi Rebel537, I suggest that you read this white paper "Database maintenance for Office SharePoint Server 2007 (white paper)". It contains information and procedure to measure and reduce fragmentation and shrink Sharepoint database. Hope that helps you, MarioMon Blog/My Blog (in french) LinkedIn
September 24th, 2010 1:42pm

You can not automatically shrink the log files if the database is not in simple recovery mode. so what you would need to do to keep the log file from growing is write a script or console app to change the database recovery model to simple, backup the database and shrink the log file.
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2010 4:56pm

Hi, I think you can shrink the log file when database is offline. Probably your database are set to full recovery model and you're not taking transactionlog backups. If you transaction logs (the LDF files) are getting large that means one thing. Your recoery mode is set to Full. You can change your database recoery mode to "Simple" and transaction logs won't get so large. For the most part, I never, ever recommend shrinking database files or transaction logs. Give them space to grow. That's what databases do, they get more data and they get larger, Every time you make SQL expand a database or transaction log you impact performance. I wish you every success in your important work. Best regards, David Hu
September 28th, 2010 4:39am

Thank you Dave !! I was succesful in doing that the lat time and now i again have the same problem I restricted the file growth to 200 GB the last time and now it is 180 GB. I think i need to follow the same procedure again and see how it goes this time. Thank you so much for your help.
Free Windows Admin Tool Kit Click here and download it now
February 24th, 2011 1:04pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics