Reduce size on logfile – MS SQL

30 Jul

Here’s a way to reduce the logfile when the it grows too big (remember to backup the logfile before reducing the size):

  • Check first the size of the files in the database
    1. use master
    2. DBCC SQLPERF (LOGSPACE)
  • Action to reduce the file:
    1. USE [DB_ID]
    2. ALTER DATABASE DB_ID SET RECOVERY SIMPLE;
    3. GO
    4. DBCC SHRINKFILE (DB_ID_log,10)
    5. GO
    6. ALTER DATABASE DB_ID SET RECOVERY FULL;
    7. GO

http://msdn.microsoft.com/en-us/library/ms189493.aspx

Advertisements

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: