| |
 |
During
my days as a DBA, I frequently received backup files from my
manager, with instructions to restore the contents. Here's what I
usually do to get a handle on things:
|
|
·
|
Run
RESTORE
LABELONLY on the
file
|
|
|
The
information provided tells me if the backup file is the only one in
a backup set, or if the backup file is part of a backup set. The
FamilyCount
and
FamilySequenceNumber
columns
provide this information. Recall that a backup may be spread across
multiple files. In such situations, you would need all the files in
order to restore the database successfully.
|
|
|
·
|
Run
RESTORE
HEADERONLY on the
file
|
|
|
·
|
the
number of backups that are contained in the file. A backup file may
contain multiple backup sets.
|
|
|
·
|
the
backup type, whether if it's a full database backup, differential,
log etc.
|
|
|
·
|
the
name of the database that was backed up.
|
|
|
·
|
Run
RESTORE
FILELISTONLY on the
file
|
|
|
I
would only run this on a full database backup. Running this tells
me the number of files that makes up the database, and the size of
each file. This allows me to know quickly if I have enough disk
space to restore the database.
|
|
|
Can't
we tell the size of the database from the backup file size? No, if:
|
|
|
·
|
the
backup file contains multiple backup sets
|
|
|
·
|
the
database's tranaction log file contains mostly truncated data
|
In
summary, there is a wealth of information you can retrieve from a
backup file, using the RESTORE
LABELONLY,
RESTORE
HEADERONLY and
RESTORE
FILELISTONLY commands.
See the Books Online documentation for these commands for more
details.
Discuss or comment on this article on our Facebook group.
Document history
| 6/27/2008 | Initial release. |
|