• bwperrin (1/18/2013)


    I was hoping it would be a good idea to do the full backup, then immediately after set SINGLE USER, SIMPLE RECOVERY, rebuild indexes, update statistics, then back to MULTI_USER, FULL RECOVERY

    No. It's quite a bad idea. You're breaking the log chain, you won't be able to take log backups until you do another full or diff backup. You've removed the ability to restore across that time period using log backups.

    Let's say that the full backup you take after that is damaged upon write (but you don't notice that) and you need to restore to a point a couple hours after that backup. You go to restore that full, but it's damaged and the restore fails. You go to restore the previous one, that restores but because of the broken log chain you can't restore to the time you need, so you've lost a couple hours of data because of switching to simple recovery.

    (after all, why bother logging all that stuff?).

    It's still logged in simple recovery.

    If you want to minimise log usage, you can switch to bulk-logged recovery before the rebuilds and back afterwards, providing the risks of bulk-logged are acceptable. Otherwise, rebuild just what needs rebuilding and not everything.

    P.s. New questions in a new thread in future please.

    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