Log truncation

Question:
My database and log keep filling up and I can’t truncate the log. Any suggestions?

Answer:
There are two methods to empty the transaction log. One can regularly dump the transaction log to a file. This is the preferred option, because the dumps can then be used as part of backup plan. If you are in development and do not care to maintain transaction dumps you can set the database to “truncate log on checkpoint.” The Server will then automatically clear out all committed transactions from the log whenever a checkpoint occurs. If you are using one of the above methods and still find the log filling up, you should investigate whether you have a large enough log, are dumping often enough, or have a long running transaction that prevents the log from being dumped (DBCC OPENTRAN (database name)).

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: