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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9: File <strong>and</strong> Filegroup <strong>Backup</strong> <strong>and</strong> <strong>Restore</strong><br />

Hopefully, as discussed in the previous sections, this database has been architected such<br />

that the data is spread across multiple data files, in several filegroups, so that we can still<br />

back up the whole database bit by bit, by taking a series of file backups, scheduled on<br />

separate days. While this is the most common reason for file backups, there are other<br />

valid reasons too, as we have discussed; for example if one filegroup is read-only, or<br />

modified very rarely, while another holds big tables, subject to frequent modifications,<br />

then the latter may be on a different <strong>and</strong> more frequent backup schedule.<br />

A file backup is simply a backup of a single data file, subset of data files or an entire<br />

filegroup. Each of the file backups contains only the data from the files or filegroups that<br />

we have chosen to be included in that particular backup file. The combination of all of<br />

the file backups, along with all log backups taken over the same period of time, is the<br />

equivalent of a full database backup. Depending on the size of the database, the number<br />

of files, <strong>and</strong> the backup schedule, this can constitute quite a large number of backups.<br />

We can capture both full file backups, capturing the entire contents of the designated<br />

file or filegroup, <strong>and</strong> differential file backups, capturing only the pages in that file or<br />

filegroup that have been modified since the last full file backup (there are also partial <strong>and</strong><br />

partial differential file backups, but we'll get to those in Chapter 10).<br />

Is there a difference between file <strong>and</strong> filegroup backups?<br />

The short answer is no. When we take a filegroup backup we are simply specifying that the backup file<br />

should contain all of the data files in that filegroup. It is no different than if we took a file backup <strong>and</strong><br />

explicitly referenced each data file in that group. They are the exact same backup <strong>and</strong> have no differences.<br />

This is why you may hear the term file backup used instead of filegroup backup. We will use the term file<br />

backup for the rest of this chapter.<br />

Of course, the effectiveness of file backups depends on these large databases being<br />

designed so that there is, as best as can be achieved, a distribution of data across the data<br />

files <strong>and</strong> filegroups such that the file backups are manageable <strong>and</strong> can complete in the<br />

required time frame. For example, if we have a database of 900 GB, split across three<br />

304

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

Saved successfully!

Ooh no, something went wrong!