Whitepaper - SQL Server Database Backup and Restore Planning
Whitepaper - SQL Server Database Backup and Restore Planning
By Bryan Oliver
www.appassure.com
WHITE PAPER
2
www.appassure.com
WHITE PAPER
CONTENTS
GENERAL ISSUES ....................................................................................................................................................5
Master ..............................................................................................................................................................9
MSDB ...............................................................................................................................................................9
Distribution .....................................................................................................................................................9
Model ...............................................................................................................................................................9
Backup Reports................................................................................................................................................ 10
3
www.appassure.com
WHITE PAPER
Server Restore.................................................................................................................................................. 14
4
www.appassure.com
WHITE PAPER
GENERAL ISSUES
What is a backup?
In simple terms a backup is a copy of the data contained within a system. For a DBA, a backup can consist of
either a single file or multiple files for one database to the entire server. These files can be classified into three
types: a full backup, a partial or differential backup, and finally, a transaction log backup. By utilizing all three
types of backups, the amount of data that needs to be backed up at specific times and the overhead placed
upon the hardware to complete the backups at critical times is reduced.
The problem with this Typical Backup Scenario is that restoring a database is a time consuming process. For
Example: To restore the database to the actual state it was at 16:00, you have to restore the Full Backup, the
Differential at 12:00, and the Log at 14:00 and 16:00.
Why backup?
Although people differ, computers do fail and they arent perfect yet. The main reason to backup is to protect
against the disruption of business from a variety of scenarios including disasters:
Companies with lost data incur extensive costs due to a combination of factors including loss of business, low
productivity, legal action, and the cost of recreating data. In 2002, a study from OnTrack, a company that
provides data recovery services, showed that the cost of recreating just 20 MB of data can be extensive:
5
www.appassure.com
WHITE PAPER
Critical data loss can result in business collapse. A Study from the National Archives and Records Administration
shave shown that 80% of companies without wellconceived data protection and recovery strategies go out of
business within two years of a major disaster.
With data that is highly valuable to a company, plans must include an increased backup frequency due to the
nature of the costs incurred while recapturing data in case of a to disaster. Recoverability plans must also
consider the availability requirements of this data.
With highly sensitive data, plans must include encryption of backups, especially when this data is stored offsite.
6
www.appassure.com
WHITE PAPER
Testing backups?
Test restores should occur on a regular basis, including the entire system as well as individual databases. The
only way to guarantee the integrity of a backup is to actually restore it followed by a DBCC check. There should
always bea last complete backup set onsite so that immediate restores can be undertaken.
7
www.appassure.com
WHITE PAPER
SERVER SPECIFICS
The operating system and applications on the server need to be backed up at scheduled intervals and after any
system changes. If you are applying service packs and updates regularly, than regular backups should be
occurring along with these changes. When making changes to the underlying system user accounts, policies and
installing third party products you should be undertaking at least an incremental backup so that these changes
can be restored easily in the event of the server needing to be restored.
Server Classification
Value of the Server to Operations Least 1 2 3 4 5 6 7 8 9 10 Highest
Daily incremental backups to capture file additions and updates that have occurred during the day. If
using hourly incremental backups consider differential backups to roll up all the changes that have
occurred during the day.
Weekly this will be either a full or differential backup depending on the number of changes occurring to
the non sql server database files.
Monthly and Yearly should always be a full backup of the entire system. Major Changes should always
be a full backup of the entire system.
8
www.appassure.com
WHITE PAPER
System Databases
All system databases, excluding tempdb and resource, should be backed up on a strict schedule. In addition, they
should be backed up after certain events to maintain the integrity of the server and enable recovery from a
disaster.
Master
The master database should be backed up every day, without fail, and after any event that alters the SQL Server.
These events include creating, altering or deleting a database, changing a data or log file of a user database,
creating, altering or deleting logins, altering configuration options, etc.
MSDB
If MSDB is used for monitoring and scheduling of SQL Jobs and maintenance plans, a daily full backup with 6hrly
differentials is recommended to minimize data loss from this database.
Distribution
For servers with replication, the distribution database needs to be backed up on a schedule based upon the
method of replication. Transactional replication requires frequent log backups with a daily full backup, while
snapshots require backups of either a log or differential after each snapshot is taken and either a daily or weekly
full backup.
Model
Model is often the forgotten database in backup scheduling due to minimal changes occurring to it after
installation. Still, a weekly full backup with adhoc full backups occurring after the database has any alterations or
additions to it is recommended.
User Databases
Selecting the correct recovery model of a database makes it possible to select the correct backup strategy for
that database. For instance, transaction log backups arent possible if the recovery model is in simple mode. It is
always safer to err on the side of caution and select full recovery model if you are unsure. For a data warehouse
where large amounts of bulk operations will occur, it is possible to look at a bulklogged recovery model to
increase performance and reduce log file growth, but it reduces your abilities in undertaking point in time
recovery operations.
Critical databases, including those where the data is costly to reenter, and those that are important to the
ongoing operations of the company, should be backed up on a very frequent schedule. In some instances,
backups of the transactions should occur at the subsecond level as frequently as every 10 seconds. Servers that
9
www.appassure.com
WHITE PAPER
contain mission critical databases need to have redundancy built into them in the form of clustering and log
shipping or mirroring of the actual database. In addition to undertaking frequent transactional backups, it is
important to do differential backups on a frequent basis to reduce the number of files required to restore a
database. Using software with next generation compression and deduplication technology can help address this
issue.
As the database becomes less critical, the number of transactional and the frequency of full backups can be
reduced to a minimum. The least critical databases should only require a weekly full backup and daily differential
backups for these databases. In these cases the recovery model should be set to simple so that the log file does
not grow beyond the available disk space.
Backup Reports
Reporting of all backup and restore operations, not only the notification of failed backups and restores, but
successful operations as well, should be part of your weekly schedule. From these reports it should be clear if
backup periods and data are increasing. This allows you to make future adjustments to backup and restore plans
before they become critical. It is also helpful for management to understand how long the restore operation will
take both the entire server and in particular for individual databases. A standard report from SQL Server on
Backup and Restore Events is a great start for reporting backups.
10
www.appassure.com
WHITE PAPER
Server Profile
Hardware Server Hardware
Server Make Model DELL SL2500
SAN EMC Clarion 123
Software Operating System, SQL Server, Other Applications
Server O/S Windows 2008 SP1
SQL Server Version SQL Server 2008 Build1600
Drives Where files are located
System C
Application D
SQL Data EFGH
SQL Log IJKL
SQL tempdb MNOP
Server Classification
Value of the Server to Operations Least 1 2 3 4 5 6 7 8 9 10 Highest
Cost to Business for Lost Time Least 1 2 3 4 5 6 7 8 9 10 Highest
Server Availability Least 1 2 3 4 5 6 7 8 9 10 Highest
Changes to OS Least 1 2 3 4 5 6 7 8 9 10 Highest
Changes to Applications Least 1 2 3 4 5 6 7 8 9 10 Highest
11
www.appassure.com
WHITE PAPER
12
www.appassure.com
WHITE PAPER
System Database
Database Full Backup Differential Transaction Log
master Daily N/A N/A
msdb Daily 6 Hourly N/A
model Weekly N/A N/A
distribution* Daily 6 Hourly Hourly
User Databases
Database Specific Database Name : <database name>
Sensitivity to Business of the DB Least 1 2 3 4 5 6 7 8 9 10 Highest
Value to Business of the DB Least 1 2 3 4 5 6 7 8 9 10 Highest
Ability to Rekey the data into DB Least 1 2 3 4 5 6 7 8 9 10 Highest
Cost to Rekey the data into DB Least 1 2 3 4 5 6 7 8 9 10 Highest
Frequency of changes to the DB Least 1 2 3 4 5 6 7 8 9 10 Highest
Amount of data changed per hr Least 1 2 3 4 5 6 7 8 9 10 Highest
Cost to Restore the Data Least 1 2 3 4 5 6 7 8 9 10 Highest
13
www.appassure.com
WHITE PAPER
Server Restore
Full Restore to Physical or Virtual Server Quarterly Yearly
Test Restore of Individual Files Weekly Monthly Yearly
Full Restore of Individual Drive Monthly Quarterly
14
www.appassure.com