Reduce Sharepoint services 3.0 log.ldf files…

I had the problem that Sharepoint_Config-ID-.log.ldf grow realy BIG (14GB) on a content database of 1 GB!

You can solve this problem by using “Shrink” command in the MS SQL Server Management Studio Express

First you need to connect to your Sharepoint 3.0 database called: \\.\pipe\mssql$microsoft##ssee\sql\query - just put this string in your “Server name” field:

\\.\pipe\mssql$microsoft##ssee\sql\query

 Create full backup of all databases before continuing!

After that we should change restore mode from “Full” (this the parameter that allows .log.ldf to grow that large as transaction logs are not purged) to “Simple”:

Expand Databases, right mouse click on Sharepoint_Config… Properties, Options, Recovery model: Simple and click OK

Shrink the database procedure:

Expand Databases, right mouse click on Sharepoint_Config… Tasks, Shrink, Files in File type select Log and click OK
Your log file will become radicaly smaller. :)

Be sure you backup your databases before this procedure and also on daily bases…

Good luck!

 Also check:
http://geekswithblogs.net/RogueCoder/archive/2008/06/03/122588.aspx
http://www.karaszi.com/SQLServer/info_dont_shrink.asp

Tags: , , ,

27 Responses to “Reduce Sharepoint services 3.0 log.ldf files…”

  1. Great, this was the information I was looking for. I knew how to shrink the database but has problems accessing the server. Thanx to your servername string I was able to connect. Thanx!

  2. Dannel says:

    Hey thanks so much for this, you are the man!

    Really helped me out of a hole cheers again!

  3. Jeff says:

    thanks for the server string

  4. Matt says:

    How would i connect to it if it was a remote server?

  5. Admir says:

    Hi Luka, thank you for this posting. I had a same problem …. Sorry not any more :) . The servser connection string is magic …

  6. mohit says:

    Thank you! you explained it in very simple words. It worked for me and saved us from potential downtime and few sleepless nights. — Regards

  7. Rodney says:

    Thanks Luke! you saved me 8Gig in 30 seconds and good timing as my drive was sitting at 200mb free space :)

    Also a mention to Google for finding the page for me…

    Awesome.

  8. MR says:

    THANK YOU VERY MUCH ! this solved my problem completely… Thank you again.

    best regards from MALAYSIA

  9. Marc says:

    cheers, you are a champ!

  10. Christian H. says:

    Sounds like a nice solution, but what if I get “Login Failed” – I am logged in to Windows with the only Windows Admin account. This is the standard SBS 2008 installation, can’t think of ever having set any Admin passwords for the WSS database.

  11. manojlovicl says:

    For those with problems on SBS 2008 check this link: http://support.microsoft.com/kb/2000544

  12. CIU says:

    Excellent solution! We had our logs on SharePoint_Config getting up to 17gigs and our WSS_Content up to 35gigs. Ran the shrink file on both databases and now logs nearly at 0. Also thanks for the correct database string path.

  13. Robi says:

    Sem srinkal na WSS content in Config. Mi je re?ilo prostorsko stisko.

    Hvala

  14. TX IT Guy says:

    Thank you, thank you, thank you!

    I have gone through dozens of websites that were longer and no help, this is exactly the information I needed!

  15. Rob says:

    This SAVED ME. HERO thanks

  16. Verret says:

    Wonderful. Saved my life ;)

    Thank’s a lot!

  17. Jsmith says:

    This worked on the ShareWebDB database but when i tried to go to the properties of the Sharepoint_Config database i get and SQL error that says:
    Property Owner is not available for Database ‘[SharePoint_Config_29c26fca-17b8-48c1-9704-b869932abcb6]‘. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Express.Smo)

    This appears to be the same error on other of servers.

  18. manojlovicl says:

    You shuld run SQL management as administrator / right click / run as administrator

  19. jsmith says:

    Same error running as administrator logged into server as administrator

  20. Hello!
    Here is the almost same way to shrink sharepoint database transaction log.
    Thanks!

  21. Mike says:

    Thanks! This really helped, I was down to 2GB of disk space.

  22. Steven says:

    Brilliant. Thanks!

  23. You are my hero – thanks for sharing your knowledge.

  24. Alan says:

    How do you “connect” to the SharePoint database? When I open SQL studio, the only db listed is my Antivirus one, and when I do File-> Connect, the only db’s I can browse to are other SQL instances installed by 3rd party apps, or SBS Monitoring: the SharePoint DB is not listed. Help! this is so frustrating! My C drive is almost out of pace due to 20GB ldf file, and I’ll need to forcefully remove SharePoint completely if I can’t get rid of the stupid ldf file.

  25. Dave says:

    By far the best thing to happen to my job! You just freed up over 20GB with just this. Thank you, thank you, thank you!

  26. Grant says:

    Thanks a lot for the \\.\pipe\mssql$microsoft##ssee\sql\query information! None of the other dozen or so articles I found mentioned this, and I had no idea how to access the database.

  27. Ernesto says:

    Fantastic! This was life saver. Thanks!

Leave a Reply