Differential Database Backups in SQL Server
Differential Database Backups in SQL Server
In this fast moving world, data is the heart & soul of any enterprise. As the business is
expanding many organizations around the world have adopted a 24x7 business model to
support and run their businesses. In a 24x7 business model data changes happen around the
clock, thereby increasing the demand for database backups. Taking full database backup is a
good practice however this consumes lot of system resources thereby slowing responses to
front end applications which are using the databases. Moreover a full database backup takes a
lot of time to complete especially for very large databases. In order to reduce the database
backup duration and also to safeguard the data, Database Administrators can take Differential
Recovery Model of the Database chosen by DBA. To know more about recovery models in SQL
Server you can refer to my previous article titled Database Recovery Models in SQL Server. The
different types of database backups in SQL Server are Full, Differential, Transactional Log, Full
File Backup etc. The method which the Database Administrator should choose to backup
databases depends on Recovery Model and how fast the database backup needs to be
completed.
since the last full backup. A differential backup usually takes lesser time to complete as it
contains only the changes (delta) which has happened to the database since the very last full
backup. It is much faster when compared to full database backups. When you have very large
databases then you should be using this backup strategy to reduce the work loss and it should
be scheduled at lesser time intervals when compared to full backups. In the event of a
disaster, a differential database backup alone will not help you to recover the database. You
need to have transactional database backups available to achieve the point in time recovery.
In this article we will see how to take differential database backups using SQL Server
Management Studio and how to take differential backups using TSQL code.
AdventureWorks database. However the initial backup of the database should always be a Full
Backup. In the Back up Database Dialog box you have the option to choose Full, Differential,
1. Once you are connected to the instance of SQL Server Database Engine, in the object
3. In this article we will be see the steps which you need to follow to take the differential
backup of AdventureWorks database. Using Differential Backup strategy you can even take the
database backup of system databases expect for Tempdb and Resource databases.
4. To take differential backup of AdventureWorks database you need to right click the
AdventureWorks database and point to Tasks and then click on Back Up…. as shown in the
below snippet.
5. Once you click on Back up… option in the popup window it will open up Back Up Database
dialog box.
6. In the database drop down list, verify that database name selected is AdventureWorks. Here
you can optionally change the name to a different database if you would like to perform the
differential backup of another database. Using differential backup strategy you can perform
differential backup for databases in any of the Recovery Models (Full, Bulk-Logged or Simple).
To know more about Recovery Models in SQL Server you can refer to my previous article titled
7. Next step will be to select Differential as the value for Backup type in the drop down list.
database.
9. Next you can provide values for Name & Description fields as appropriate.
10. As you could see in the above snippet that there is an option to provide the Backup set
expire days. You could see that the value provided for Backup set will expire is 0. This is
because we never want the backups to expire. However, you can provide any value between 0
11. Next step will be to choose differential database backup destination by selecting either of
the two options Disk or Tape. Click on Add… button to open up Select Backup Destination
dialog box and specify the location where you want the differential backups of AdventureWorks
existing media set & Back up to a new media set, and erase all existing backup sets. In this
14. Next under Reliability section there are three options available to choose namely Verify
backup when finished, Perform checksum before writing to media and Continue on error. Here
you need to select Verify backup when finished option as we want the backups to be verified
15. If you are performing transactional log backup then Transaction log section will be enabled
where you can choose one of the options available namely; Truncate the transaction log or
Back up the tail of the log, and leave the database in the restoring state.
16. Next under compression section, choose the appropriate backup compression settings. In
SQL Server 2008 Enterprise Edition and later backup compression feature is available. If you
want to take the database backup utilizing backup compression feature then you can select
the option from the drop down list. To know more about Data Compression Feature in SQL
Server 2008 you can refer to my previous article titled How to configure & use Database
17. Finally click OK to take the differential database backup of AdventureWorks database.
USE master
GO
Differential Backups usually compete in lesser time when compared to Full Backups.
The duration depends upon the number of extents which got changes since the last full
Storage space required for differential backups is comparatively less when compared
to the space required for full backups because in differential backup only changed
Restoration of database is much faster as DBA needs to first restore the full backup
using NORECOVERY and then they need to restore the latest differential backup with
NORECOVERY and then if you have any transactional logs then they need to be
restored in the same order of backup with NORECOVERY except for the last
Point in time recovery of the database may not be possible always if the differential
If there are lots of data changes happening then there could be scenarios when
differential backups are more or less of same size that of full backups.
Conclusion
Using differential backup strategy database administrators can take database backups quickly
without consuming lot of system resources especially when backing up very large databases.
However it is advised to use a combination of differential and transactional log backups for
larger databases to safeguard the database and this also helps database administrators to
perform database restores more quickly when they need to perform a disaster recovery
exercise.