Advertisements

Reduce Size of Log File of your SQL Server Database

Your SQL Log File is basically your lifeline when it comes to recovering your database to a previous point in time. If Point in time recovery is not important to you; then you must set the Recovery Model to Simple.

To deal with the issue in hand; lets go through a series of simple steps to shrink your log file

  1. In the Query window, type;  backup log <databasename> with truncate_only
  2. dbcc shrinkfile (databasename_log)
  3. Once this is done; you will noticed your log file having shrinked considerably within your file directory

If Point in Time recovery is useful to you; I would recommened that you schedule the above activity periodically to keep the size of your log file in check.

Advertisements

About Sunil Padmanabhan

An Indian based out of Dubai who started traveling from 2011 and pretty much caught the travel bug. Every year presents itself as an opportunity to visit and explore a new place.

Posted on November 11, 2013, in SQL Server and tagged , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: