Question on transaction log growth

  • Hi all,

    I currently have a database with log shipping set up (every 15mins). My DB has a ~40GB transaction log, running DBCC SQLPERF(logspace) tells me only 0.3% of the transaction log space is used.

    My question is why this unused space hasn't been released and is there a way to release it without breaking log shipping (or changing the recovery model). Thank you.

  • When you are doing a log backup, the size of the log file doesn't change. The log backup operation just clears some of the data in the log and makes it possible for the server to reuse the part that is not needed any more. If you want to shrink the file, you can use dbcc shrinkfile command. This will not break the log backups chain. Notice that you should do it only if you know for sure that the log never gets to this size. There is a good chance that during normal activities the server won't be using all that space, but because of maintenance operation it does (for example when you rebuild your largest index) it does use this space. If this is the case, then there is no use of shrinking it, because it will get to this size again. If you do know that the log got so big because of a mistake or because of a special onetime operation, then it is logical to shrink it.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 2 posts - 1 through 1 (of 1 total)

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