30.06.2013 Views

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2: Planning, Storage <strong>and</strong> Documentation<br />

The scheduling of differential backups will vary widely, depending on their role in the<br />

backup strategy. For a VLDB, we may be taking differential backups every night, except<br />

for on the night of the weekly full backup. At other times, we may run differential<br />

backups at r<strong>and</strong>om times during the day, for example as a way to safeguard data before<br />

performing a large modification or update.<br />

Transaction log backups are, in general, much less CPU- <strong>and</strong> I/O-intensive operations<br />

<strong>and</strong> can be safely run during the day, alongside the normal database workload. In fact,<br />

there isn't much point having a transactional backup of your database if no one is actually<br />

performing any transactions! The scheduling of log backups may be entirely dictated by<br />

the agreed SLA; if no more than five minutes of data can be lost, then take log backups<br />

every five minutes! If there is some flexibility, then try to schedule consecutive backups<br />

close enough so that the log file does not grow too much between backups, but far<br />

enough apart that it does not put undue stress on the server <strong>and</strong> hardware.<br />

As a general rule, don't take log backup much more frequently than is necessary to satisfy<br />

the SLA. Remember, the more log backups you take, the more chance there is that one<br />

will fail <strong>and</strong> possibly break your log chain. However, what happens when you have two<br />

databases on a server that both require log backups to be taken, but at different intervals?<br />

For example, Database A requires a 30-minute schedule, <strong>and</strong> Database B, a 60-minute<br />

schedule. You have two choices:<br />

1. create two separate log backup jobs, one for DB_A running every 30 minutes <strong>and</strong> one<br />

for DB_B, every 60 minutes; this means multiple <strong>SQL</strong> Agent / scheduled jobs <strong>and</strong><br />

each job brings with it a little more maintenance <strong>and</strong> management workload<br />

2. take log backups of both databases using a single job that runs every 30 minutes;<br />

you'll have fewer jobs to schedule <strong>and</strong> run, but more log backup files to manage,<br />

heightening the risk of a file being lost or corrupted.<br />

My advice in this case would be to create one log backup job, taking log backups every<br />

30 minutes; it satisfies the SLA for both databases <strong>and</strong> is simpler to manage. The slight<br />

downside is that the time between log backups for databases other than the first one in<br />

74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!