Does a full backup truncate the log?

  • rocky

    SSCrazy

    Points: 2118

    Situation: DB is in full recovery model for point in time recovery. Maintenance plan does not include taking any translog backups.

    If a full backup is ran (from the maintenance plan), does it truncate the log?

    If not, does the log just continue to grow until a truncate and a shrink of the log is issued?

  • Lynn Pettis

    SSC Guru

    Points: 442118

    No. Neither Full or Differential backups truncate the transaction log. During these backups enough of the log is backed up to provide a consistant backup. Transaction Log backups are the only backups that truncate the transaction log of commited transactions.

    If you have the database using the Full Recovery model to allow for point in time recovery, you also need to implement transaction log backups between your full and/or differential backups.

    😎

  • Chad Crawford

    SSChampion

    Points: 11605

    No - a full backup does not truncate the log. The log and database backups are somewhat independant. When you backup the log, it will contain all the log entries from the last log backup regardless of when the last full backup was taken. For example, if you backup your log at 8AM, then do a full backup at 9AM, and 10AM and do another log backup at noon, you can restore to 11AM by using either full backup and the noon log backup (the noon log backup contains all the log entries from 8AM to noon). In order to do a point-in-time recovery, you must be doing log backups as well as full backups. If you only do full backups and truncate/shrink your log, you WILL NOT BE ABLE TO RESTORE TO A POINT IN TIME except for the point in time where your full backup was taken. Doing truncate/shrink on your log file doesn't give you any benefit different from having the DB in Simple mode, you lose all the log information.

    Good luck - please post any additional questions you have as it appears your current setup will not allow you to restore as you had hoped.

    Chad

  • Gail Shaw

    SSC Guru

    Points: 1004424

    The log will continue to grow until a truncate is issued, at which point the space within the file will be available for reuse.

    You say the DB's in full recovery for point in time recovery, but if you don't have log backups, there's no way that you're going to be able to do a point-in-time recovery. Either switch to simple recovery or schedule log backups.

    See - http://sqlinthewild.co.za/index.php/2008/07/23/recovery-model-and-transaction-logs/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • rocky

    SSCrazy

    Points: 2118

    Thanks for everyone's help.

  • JATIN.MANIYAR

    SSC Veteran

    Points: 209

    Cant you use Backup Log for point in time recovery with your full backup?

  • Gail Shaw

    SSC Guru

    Points: 1004424

    Please note: 4 year old thread

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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