Monday, January 25, 2010

How to shrink SharePoint_Config DB

Hi all,

I had one of my SharePoint Configuration database for one of my sharepoint sites reached 122 GB since i had a problem on having any operation from the FE server to the DB server.

My installation for the DB server is SQL 2008, the problem is the transaction log is too large and to minimize or shirnk the size, here is the steps:

1) Take a full backup from your database - Important.
2) Change the DB recovery model to Simple ( Right click on the SharePoint_Config and click on properties -> Options - > Recovery model : change it to simple.

3) Open a new query in the management studio and write this shrink command:

DBCC SHRINKFILE('Sharepoint_Config_Log',1)

4) Check the HD free space, your free space on the HD has been updated.

5) Don't forget to return back the recovery model to full for any future backups.

Check the transaction log file (ldf file of the sharepoint_config) it has been shrinked to the minimum size.

In my case the transaction log has been shrinked from 122GB to 2MB.

Hope this helps.

Regards,
Mostafa arafa

3 comments:

Anonymous said...

Will this prevent future over expansion of the log file?

Mostafa M. Arafa Elzoghbi said...

You can specify the max. size of the log file you can use this command alter database with MAXSIZE option.

here is the KB for this :
http://msdn.microsoft.com/en-us/library/ms365418.aspx

hope it helps.

Anonymous said...

hi guys so happy to be between you yayaay love the blog soo much ^^