Multiple choice technology databases

You discover that the msdb database on a SQL Server 2005 computer is corrupt and must be restored. Databases are backed up daily. The database backup files are written to a network share, but the file names do not clearly indicate which databases are in each file. You need to locate the correct backup file as quickly as possible. The first file in the list is named DB_Backup.bak. Which Transact-SQL statement should you use?

  1. RESTORE LABELONLYFROM DISK = N\Server1\Backup\DB_Backup.bak

  2. RESTORE HEADERONLYFROM DISK = N\Server1\Backup\DB_Backup.bak

  3. RESTORE VERIFYONLYFROM DISK = N\Server1\Backup\DB_Backup.bak

  4. RESTORE DATABASE MSDBFROM DISK = N\Server1\Backup\DB_Backup.bak

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

RESTORE HEADERONLY reads backup file metadata without restoring. It lists all database backups contained in a backup set, including database names - perfect for identifying which backup file contains msdb when filenames are unclear.