Do you really need the log file

  • We have a 70 GB mdf w/ a 29GB ldf. After doing full backup, can I truncate the log via the following plan:

    <Break mirroring>

    alter database xxx set recovery simple

    < right click - properties - files - set size to 5GB >

    alter database xxx set recovery full

    <Reset mirroring>

    What do I lose by truncating the log after a full backup?

    Thanks,

    Mike

  • One, the ability to do point in time recovery of the database if it is needed. Having a mirror database is good for high availability but it doesn't replace the need for a good set of backups from which to recover if necessary.

    Second, breaking and re-establishing the mirror is not really the best thing you can do.

    Why do you want to truncate the log, or is shrinking the log what you are actually talking about. They are two entirely different things.

  • We are running out of space on our mirror server. I though that if I could reduce the log, it would give us some breathing room while we figure out a solution.

    We do daily backups at 11pm, a diff backup at 6am and hourly transaction logs from 7 am - 6 pm - plus the mirroring.

    I don't think the shrink would work. It hasn't in the past when I restore a backup to my local machine.

    Mike

  • You can't switch to simple recovery with active database mirroring. You'll need to completely drop the database mirroring setup, then you can change recovery models. Recreating the mirror will require copying over and restoring a full or diff backup. That's a fair bit of work and you'll be completely without the mirror while that's done.

    We do daily backups at 11pm, a diff backup at 6am and hourly transaction logs from 7 am - 6 pm - plus the mirroring.

    That's probably part of the cause of the large log, the lack of log backups for 13 hours a day. I suggest log backups on the hour, every hour.

    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
  • We do hourly transaction log backups during the work day.

    Mike

  • Between 6pm and 7am you dont do transaction log backups, during that time the log cannot be marked as re-usable so that is why you have a huge transaction log as you have 13 hours worth of transactions waiting to be backed up.

    Do your transaction logs every hour on the hour all day, not just during the working day.

  • A full backup doesn't set the log to re-usable?

  • mike 57299 (2/6/2013)


    A full backup doesn't set the log to re-usable?

    No.

    Please read through this - Managing Transaction Logs[/url]

    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 8 posts - 1 through 7 (of 7 total)

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