Reducing Log File Size

  • I have a db that is about 40GB in size and log file has grown to over 20GB some time ago, but I backup the logfile every day now and it never fills to more than 2-4 GB.

    Is there a way to reduce that log file to 4GB?

    Thanks.

  • You can run this command to shrink the actual log file back to the default:

    DBCC SHRINKFILE (N'your log file name')

    DBCC shrinkdatabase(N'you db name',  TRUNCATEONLY )

  • also backing up the log file more frequently would help to keep the log file size in check...

    -Krishnan

  • thanks, I know that now.

    At one point few months back, the automatic backup failed for few days and the file grew quite a bit and I couldn't find a way to bring it down.

  • shrink the log file and release the space to OS..You can find more info abt in BOL..

     

    -Krishnan

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply