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 1: Basics of <strong>Backup</strong> <strong>and</strong> <strong>Restore</strong><br />

If that size of potential loss is unacceptable, then you'll need to either take more<br />

frequent full backups (often not logistically viable, especially for large databases) or<br />

take transaction log backups <strong>and</strong>, optionally, some differential database backups, in order<br />

to minimize the risk of data loss. A full database backup serves as the base for any subsequent<br />

differential database backup.<br />

Copy-only full backups<br />

There is a special type of full backup, known as a copy-only full backup, which exists independently of<br />

the sequence of backup files required to restore a database, <strong>and</strong> cannot act as the base for differential<br />

database backups. This topic is discussed in more detail in Chapter 3, Full Database <strong>Backup</strong>s.<br />

Differential database backups<br />

The differential backup is very similar to the full backup, in that it contains a record of<br />

the objects <strong>and</strong> data contained within the data file or files, but the differential backup file<br />

will contain only the data that has been changed since the last full backup was taken.<br />

This means that a full database backup must be taken before a differential database<br />

backup can be performed, otherwise the system will not have a way of knowing what data<br />

has been modified. This full backup is known as the base of the differential.<br />

If you're interested to know how <strong>SQL</strong> <strong>Server</strong> knows which data has changed, it works<br />

like this: for all of the data extents in the database the server will keep a bitmap page that<br />

contains a bit for each separate extent (an extent is simply a collection of consecutive<br />

pages stored in your database file; eight of them, to be exact). If the bit is set to 1, it means<br />

that the data in one or more of the pages in the extent has been modified since the base<br />

backup, <strong>and</strong> those eight pages will be included in the differential backup. If the bit for a<br />

given extent is still 0, the system knows that it doesn't need to include that set of data in<br />

the differential backup file.<br />

31

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

Saved successfully!

Ooh no, something went wrong!