Logfile is too high

  • Hi

    At the time of backup database, transaction log is too high that is 5 GB but backup is only 400MB only. Is it possible to reduce the log file .

    by

    yasin

  • Yes. You need to truncate the log, then use the dbcc shrinkfile command to reduce the logfile size.

  • What 'Recovery Model' are you using ?

    If you are using 'Full', do you have a Maintenance Plan to backup the transaction log at a regular interval (somwhere in the neighborhood of every 10 to 60 minutes) ?

    If you are using any other 'Recovery Model' for this database then you may want to look into the application for poorly designed 'large volume' operations.

    Without checking these two issues out you may be in the same situation again sometime in the future.

     

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • Good point Rudy. You need to make sure to backup the transaction logs more often in order to keep the log file size down.

  • You will actually need to backup the log with no_log to clear the inactive part of the log without actually taking a backup, something like:

    backup log dbname with no_log

    And then go ahead and shrink it down to a respectable size.  Take a backup afterwords

    Also looks like your data file is around 400MB.  So depending on how transction orientated your db is, I would consider putting the DB in the Simple recovery mode, which will keep truncating your log on checkpoint.  If you want to leave it in FULL recovery then backup your trans logs often.

     

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

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