Backup Strategy - sanity check needed

  • I'm trying to figure out a backup strategy for SQL 2005. I need to have a recovery routine that minimises downtime, so I figured I'd go with a daily full backup, 4 hourly differentials and translog backups every 30 minutes.

    I'm concerned about the backup files getting oversized and having to fish through multiple backup sets looking for the right files to recover in the right order so I need to decide when to INIT the backup devices, and if indeed, it is a good idea to have 3 backup devices (one for full, one for the diffs and one for the translog backups). I came up with the idea of running the following steps in my daily backup job:

    STEP 1 - backup database to fullbackup_device WITH INIT

    STEP 2 - do differential backup to diffbackup_device WITH INIT

    STEP 3 - do translog backup to translogbackup_device WITH INIT

    In the 2 hourly differential backup job just do a diff backup to diffbackup_device WITH NOINIT.

    In the translog backup job do a translog backup to translogbackup_device WITH NOINIT.

    I need a sanity check. Is this a sensible plan or I'm I missing the blindingly obvious?

  • julia.nicholas (3/11/2008)


    I'm trying to figure out a backup strategy for SQL 2005. I need to have a recovery routine that minimises downtime, so I figured I'd go with a daily full backup, 4 hourly differentials and translog backups every 30 minutes.

    I'm concerned about the backup files getting oversized and having to fish through multiple backup sets looking for the right files to recover in the right order so I need to decide when to INIT the backup devices, and if indeed, it is a good idea to have 3 backup devices (one for full, one for the diffs and one for the translog backups). I came up with the idea of running the following steps in my daily backup job:

    STEP 1 - backup database to fullbackup_device WITH INIT

    STEP 2 - do differential backup to diffbackup_device WITH INIT

    STEP 3 - do translog backup to translogbackup_device WITH INIT

    In the 2 hourly differential backup job just do a diff backup to diffbackup_device WITH NOINIT.

    In the translog backup job do a translog backup to translogbackup_device WITH NOINIT.

    I need a sanity check. Is this a sensible plan or I'm I missing the blindingly obvious?

    Hi,

    First thing, you need to ask the business, what are our Recovery Time and Recovery Point Objectives, as these thresholds will drive your backup strategy. Otherwise, you risk letting technology drive your backup plan, which is not a good way. Once you have both of these values, you will need to devise a plan to meet or better exceed the RTO and RPO expectation for the business.

    So, as an example, the business provide you with a RTO of 1hr (back in business) and a RPO of 30min (what we can afford to loose in data terms). Now you have something to work with and you decide to do following:

    1. Full backup - Daily 20:00

    2. Differential backup - Every 4 hours

    3. Transaction log backup - 30min

    So this means, in event of a failure, you get back within 30min from point of failure, maybe more if you can backup tail of transaction log. Now, achiving the 1hr RTO is going to depend on how fast you can restore your full backup, your latest differential and transaction log to point before failure. The only way to ensure you can achive this is to test, test and test again. Most importantly, you will need to ensure you allocate ample storage to support your strategy, so this is a key requirement to allow a smooth recovery process. The more log dumps you have, the more management you'll need to perform in terms of making sure the backup files are safe.

    Another way of achieving the RTO and ROP would be to look at other features of SQL Server, such as log shipping and database mirroing, which should be included in your DR strategy, as these methods are faster then playing backups.

    Finally, if file size and storage utilization are major concerns, look at implementing tools such as Red-Gate or Quest Light Speed backup products, as they allow you to compress your backup files.

    Thanks,

    Phillip Cox

    MCITP - DBAdmin

  • Thanks for the reply Phillip. I had already based the plan around these factors and hence the daily, 4 hourly, 30 minute schedule. This is just one element of my overall DR plan.

    What I'm trying to ascertain is if the plan I have for clearing the diffs and translogs down once a day at the point of full backup has any draw backs. It appears to work and I can get point in time recovery I need and a restore within the time boundaries I've set for this exercise. My question is just a nuts and bolts technical one.

    Thanks

    J

  • The only thing I'm not sure I like about the plan you have is that you initialize the backup during each daily backup.

    That means, if something goes wrong with the current day's backup, you have zero ability to recover from it at all.

    Say, for example, that the database crashes and needs to be restored, and it happens while the nightly full backup is being done. Probability of such is low, but the whole point of backups is to make low-probability disasters less disastrous. In that case, if you don't have the prior day's full and differential backups available, your database is toast and probably can't be recovered.

    Or am I misreading something?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • This was the kind of scenario I was thinking my be an issue with INITing it every day.

    Thinking aloud...

    We tape backup the server shortly after the 20:00hrs full backup job, so, if this were to happen and the full backup failed, it wouldn't run the differential WITH INIT step in the Job nor the Translog backup WITH INIT. In theory that would leave the differentials and translogs in tact (wouldn't it?) and I should be able to pull back the full backup from the previous night's tape and then apply the diffs and translogs.

    Sanity check #2 please!

  • Differential backups are only useful if the prior full backup is good. So in the case we're discussing, where the full backup was lost, your differential backups would be useless.

    In that case, you'd be recovering from the prior day's full backup, and the most recent log backup. Have you tested that to see if it works and accomplishes what you need? (Backups are only as good as you've tested them.)

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Hey,

    Just adding to GSquared's points, you wouldn't want to initilize the same file everyday, as this zero outs last backup contents. I would recommend you consider using file backups per day with a date stamp (e.g. mybackup_1403200820000.bak).

    Thanks,

    Phillip Cox

    MCITP- DBAdmin

  • Make very sure that you have viable backups somewhere other than on the server itself. See here[/url] for why.

    There no point in doing a diff straight after a full DB backup. A diff backups up changes since the last full DB backup. If run straight after a full, it will backup nothing.

    Make sure you test your backups. The more frequently you test, the better. A backup you can't restore from is worse than useless.

    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
  • GSquared (3/13/2008)


    In that case, you'd be recovering from the prior day's full backup, and the most recent log backup.

    To do that, you'll need the previous day's full DB backup, and all the transaction log backups, in order, since that backup. Since the log backup right after the failing full is WITH INIT, the log backup chain is broken at that point.

    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
  • GilaMonster (3/14/2008)


    GSquared (3/13/2008)


    In that case, you'd be recovering from the prior day's full backup, and the most recent log backup.

    To do that, you'll need the previous day's full DB backup, and all the transaction log backups, in order, since that backup. Since the log backup right after the failing full is WITH INIT, the log backup chain is broken at that point.

    That was the point of my original reply on this. Of course, that's assuming the transaction log is being truncated by the backups. If not, then each transaction log backup is complete and could be used (I think). I've never done anything as odd as what's being proposed here, so I've never had reason to test it.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Full and diff backups don't truncate the log. Log backups do.

    If you have an full backup at midnight and hourly transaction log backups, the the log backups only contain the transactions for the hour preceding their run. (ie, the log backup at 4pm has the transactions from 3pm to 4pm). To restore to 4pm, you need the full DB backup and all of the hourly tran logs since then.

    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
  • As GilaMonster mentions, store your backup files - including txn-log backups - somewhere other than your local server box. One strategy would be to use something like Windows Flashcopy or a tool called syncback to copy the files across to a central repository in a "mirroring" fashion.

    Also, in SQL Server 2005 the RESTORE VERIFYONLY command has been improved relatively to previous versions to actually be a useful tool in backup validation:

    RESTORE VERIFYONLY FROM backup_device;

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • Thanks guys (and girls) for all the tips. I have the VERIFYONLY being run as part of the daily backup (now I know in 2005 this is actually worth doing!)

    Our db is in a managed environment so options for moving and storing files anywhere other than on the tape backup that runs nightly is limited. Also, I have to be cost-aware because we pay for backup by the GB. Keeping multiple days of full backups on the servers is something I need to weigh up in terms of pain (cost) vs gain (speed of recovery). As our db is already pretty large several days backup on disk is a pretty expensive option. File recovery from the tape library is fast but obviously in times of crisis every second counts. My only other thought is to run a script job that moves the previous day's files to folder which we exclude from the backup run after the nightly backup has run.

  • julia.nicholas (3/17/2008)


    Thanks guys (and girls) for all the tips. I have the VERIFYONLY being run as part of the daily backup (now I know in 2005 this is actually worth doing!)

    Our db is in a managed environment so options for moving and storing files anywhere other than on the tape backup that runs nightly is limited. Also, I have to be cost-aware because we pay for backup by the GB. Keeping multiple days of full backups on the servers is something I need to weigh up in terms of pain (cost) vs gain (speed of recovery). As our db is already pretty large several days backup on disk is a pretty expensive option. File recovery from the tape library is fast but obviously in times of crisis every second counts. My only other thought is to run a script job that moves the previous day's files to folder which we exclude from the backup run after the nightly backup has run.

    If the size of your backups (and backup times) is a problem, I would highly recommend IDERA SQLsafe. It's a great tool for backup compression and helps to greatly speed up your backups.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • Marios has a good point. If space is an issue, Idera has a nice product. I'd also look at Litespeed from Quest, Red Gate's SQL Backup (I work for Red Gate) and Hyperbac's product.

    All compress things well, though they work slightly different and I think they're for slightly different markets.

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

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