Saturday 14 March 2015

How To Shrink Log File In SQL Server 2005

In SQL server you get two types of files, mdf and ldf. mdf are database files and ldf are logfiles.

Where I work, we sometimes get disk space alerts and need to scrabble to free up disk space.

One good way is to shrink SQL Server logfiles. This is completely safe to do. I'm told this is not the case for mdf database files.

First, open Microsoft SQL Server Management Studio.
Second, find the database then right-click, Tasks, Shrink, Files.

The word "Files" might not be there, instead you might get a confirmation page instead. Just make sure you are shrinking the log files and not the database itself. Sometimes you have to click a drop-down.

It will basically reclaim empty space and you can free up quite a lot this way.

This is a good video that helped me when I forgot and needed to remember again in a jam!



No comments:

Post a Comment

Popular Posts