Stopzilla AVM

Tuesday, June 18, 2013

Shrink MS SQL Server log files

I have SharePoint farm running on my machine. Have memory and space limitations. In this situation most of the time receive alert running out of space. After investigation find that SharePoint Content database log files are taking lots of space in GBs.

So, you can reduce log files size through SQL server management studio. just need to follow some simple steps.

Navigate to physical location where SQL server files are stored. Path will be : C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA

You can recognise, files those have _log in the end are log files. And file type of these files are “SQL Server Database Transaction Log File”.  Here I’ve got one WSS_Content database file which I will find in SQL server management studio.

 

DatabaseLogFile

 

Now I open SQL server management studio and look for above file.

and here it is. Right click on database file navigate to Task > Shrink > Files.

 

ShringMenu

 

Click on Files.

Select File type : Log

 

LogFile

 

Click OK.

You will see the log file size is reduced in KBs.

 

Thanks