{"id":1156,"date":"2007-10-10T01:35:32","date_gmt":"2007-10-10T01:35:32","guid":{"rendered":"\/blogs\/paul\/post\/Search-Engine-QA-7-Restoring-from-a-backup-file-containing-multiple-database-backups.aspx"},"modified":"2017-04-13T09:52:06","modified_gmt":"2017-04-13T16:52:06","slug":"search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/","title":{"rendered":"Search Engine Q&#038;A #7: Restoring from a backup file containing multiple database backups"},"content":{"rendered":"<p><FONT size=2><br \/>\n<P>This is another question that came up on the <a href=\"https:\/\/social.msdn.microsoft.com:443\/forums\/en-US\/sqldisasterrecovery\/threads\/\">Disaster Recovery forum<\/a> on MSDN. Paraphrasing &#8211; &#8216; I have a backup file containing full backups for 45 databases. How can I restore them all using a script?&#8217;<\/P><br \/>\n<P>The answer is pretty straightforward. Let&#8217;s create the situation described, using 3 databases for clarity rather than 45:<\/P><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><FONT color=#0000ff size=2><FONT face=\"Courier New\"><FONT color=#0000ff size=2><br \/>\n<P>BACKUP<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DATABASE<\/FONT><FONT color=#000000 size=2> tinylogtest <\/FONT><FONT color=#0000ff size=2>TO<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DISK<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;c:\\sqlskills\\mixedbackups.bck&#8217;<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>WITH<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>NAME<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;tinylogtest 10\/09\/07&#8217;<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>INIT<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><FONT color=#0000ff size=2><br \/>\n<P>BACKUP<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DATABASE<\/FONT><FONT color=#000000 size=2> pagesplittest <\/FONT><FONT color=#0000ff size=2>TO<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DISK<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;c:\\sqlskills\\mixedbackups.bck&#8217;<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>WITH<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>NAME<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;pagesplittest 10\/09\/07&#8217;<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><FONT color=#0000ff size=2><br \/>\n<P>BACKUP<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DATABASE<\/FONT><FONT color=#000000 size=2> ghostrecordtest <\/FONT><FONT color=#0000ff size=2>TO<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DISK<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;c:\\sqlskills\\mixedbackups.bck&#8217;<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>WITH<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>NAME<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;ghostrecordtest 10\/09\/07&#8217;<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><FONT size=2><br \/>\n<P>GO<\/FONT><\/FONT><\/FONT><FONT face=\"Courier New\" size=2><\/P><\/BLOCKQUOTE><br \/>\n<P dir=ltr><FONT face=Verdana>You now can&#8217;t do a regular restore from that backup file for any database except the first one in the file:<\/FONT><\/P><FONT face=Verdana><FONT color=#0000ff size=2><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><FONT face=\"Courier New\">RESTORE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DATABASE<\/FONT><FONT color=#000000 size=2> pagesplittest <\/FONT><FONT color=#0000ff size=2>FROM<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DISK<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;c:\\sqlskills\\mixedbackups.bck&#8217; <\/FONT><FONT color=#0000ff size=2>WITH<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff00ff size=2>REPLACE<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<P><FONT face=\"Courier New\">GO<\/FONT><\/P><\/BLOCKQUOTE><\/FONT><\/FONT><FONT face=Verdana><FONT size=1><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>Msg 1834, Level 16, State 1, Line 1<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>The file &#8216;c:\\tinylogtest\\tinylogtest.mdf&#8217; cannot be overwritten. It is being used by database &#8216;tinylogtest&#8217;.<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>Msg 3156, Level 16, State 4, Line 1<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>File &#8216;fgt_mdf&#8217; cannot be restored to &#8216;c:\\tinylogtest\\tinylogtest.mdf&#8217;. Use WITH MOVE to identify a valid location for the file.<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>Msg 1834, Level 16, State 1, Line 1<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>The file &#8216;c:\\tinylogtest\\tinylogtest.ldf&#8217; cannot be overwritten. It is being used by database &#8216;tinylogtest&#8217;.<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>Msg 3156, Level 16, State 4, Line 1<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>File &#8216;fgt_log&#8217; cannot be restored to &#8216;c:\\tinylogtest\\tinylogtest.ldf&#8217;. Use WITH MOVE to identify a valid location for the file.<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>Msg 3119, Level 16, State 1, Line 1<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>Problems were identified while planning for the RESTORE statement. Previous messages provide details.<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>Msg 3013, Level 16, State 1, Line 1<\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000>RESTORE DATABASE is terminating abnormally.<\/FONT><\/P><\/BLOCKQUOTE><\/FONT><\/FONT><\/FONT><br \/>\n<P><FONT color=#000000>So how to restore the other databases apart from the first one? The answer is that you need to specify which of the backups within the file you&#8217;re after. You can find the positions using the <FONT face=\"Courier New\">RESTORE HEADERONLY<\/FONT> command:<\/FONT><\/P><FONT color=#000000><FONT color=#0000ff size=2><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><FONT face=\"Courier New\">RESTORE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT size=2> <\/FONT><FONT color=#0000ff size=2>HEADERONLY<\/FONT><FONT size=2> <\/FONT><FONT color=#0000ff size=2>FROM<\/FONT><FONT size=2> <\/FONT><FONT color=#0000ff size=2>DISK<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;c:\\sqlskills\\mixedbackups.bck&#8217;<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<P><FONT face=\"Courier New\">GO<\/FONT><\/P><\/BLOCKQUOTE><br \/>\n<P dir=ltr>This returns lots of information:<\/P><br \/>\n<P><\/FONT><\/FONT><IMG src=\"https:\/\/www.sqlskills.com\/blogs\/paul\/content\/binary\/restoreheader1.jpg\" border=0><\/P><br \/>\n<P>and then a whole bunch more columns and then ending with:<\/P><br \/>\n<P><IMG src=\"https:\/\/www.sqlskills.com\/blogs\/paul\/content\/binary\/restoreheader2.jpg\" border=0><\/P><br \/>\n<P>For our purposes, the&nbsp;interesting things to note are the <FONT face=\"Courier New\">Position<\/FONT>, <FONT face=\"Courier New\">DatabaseName<\/FONT>, and <FONT face=\"Courier New\">BackupTypeDescription<\/FONT>. In our simple example we have 3 full backups. To restore the pagesplittest database as we tried to do above, we have to specifiy the position within the file of the backup we want to restore &#8211; just the database name isn&#8217;t enough.<\/P><FONT color=#0000ff size=2><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><FONT face=\"Courier New\">RESTORE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DATABASE<\/FONT><FONT color=#000000 size=2> pagesplittest <\/FONT><FONT color=#0000ff size=2>FROM<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>DISK<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;c:\\sqlskills\\mixedbackups.bck&#8217; <\/FONT><FONT color=#0000ff size=2>WITH<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#ff00ff size=2>REPLACE<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>FILE<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT color=#000000 size=2> 2<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<P><FONT face=\"Courier New\">GO<\/FONT><\/P><\/BLOCKQUOTE><br \/>\n<P dir=ltr>And it works. So the question asked how to do this, plus how to do it in a script. Below is a script I&#8217;ve adapted from the example I wrote for the Books Online for <FONT face=\"Courier New\">DBCC SHOWCONTIG<\/FONT> back in 1999 when I rewrote <FONT face=\"Courier New\">DBCC SHOWCONTIG<\/FONT> for SQL Server 2000.<\/P><br \/>\n<P dir=ltr>Enjoy!<\/P><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><FONT color=#0000ff size=2><FONT face=\"Courier New\"><FONT color=#008000 size=2><br \/>\n<P>&#8212; Create a temporary table to hold the output from RESTORE HEADERONLY<\/P><br \/>\n<P><\/FONT>CREATE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>TABLE<\/FONT><FONT color=#000000 size=2> master<\/FONT><FONT color=#808080 size=2>.<\/FONT><FONT color=#000000 size=2>dbo<\/FONT><FONT color=#808080 size=2>.<\/FONT><FONT color=#000000 size=2>restoreheaderonly <\/FONT><FONT color=#808080 size=2>(<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><FONT face=\"Courier New\">BackupName <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>128<\/FONT><FONT color=#808080 size=2>),<\/FONT><FONT size=2> BackupDescription <\/FONT><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>255<\/FONT><FONT color=#808080 size=2>),<\/FONT><FONT size=2> BackupType <\/FONT><FONT color=#0000ff size=2>SMALLINT<\/FONT><FONT color=#808080 size=2>, <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">ExpirationDate <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>DATETIME<\/FONT><FONT color=#808080 size=2>,<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>Compressed <\/FONT><FONT color=#0000ff size=2>TINYINT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> Position <\/FONT><FONT color=#0000ff size=2>SMALLINT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> DeviceType <\/FONT><FONT color=#0000ff size=2>TINYINT<\/FONT><FONT color=#808080 size=2>, <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">UserName <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>128<\/FONT><FONT color=#808080 size=2>),<\/FONT><FONT size=2> ServerName <\/FONT><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>128<\/FONT><FONT color=#808080 size=2>),<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>DatabaseName <\/FONT><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>128<\/FONT><FONT color=#808080 size=2>),<\/FONT><FONT size=2> DatabaseVersion <\/FONT><FONT color=#0000ff size=2>INT<\/FONT><FONT color=#808080 size=2>, <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">DatabaseCreationDate <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>DATETIME<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> BackupSize <\/FONT><FONT color=#0000ff size=2>NUMERIC<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>20<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> 0<\/FONT><FONT color=#808080 size=2>),<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>FirstLSN <\/FONT><FONT color=#0000ff size=2>NUMERIC<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>25<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> 0<\/FONT><FONT color=#808080 size=2>), <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">LastLSN <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>NUMERIC<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>25<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2>0<\/FONT><FONT color=#808080 size=2>),<\/FONT><FONT size=2> CheckpointLSN <\/FONT><FONT color=#0000ff size=2>NUMERIC<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>25<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2>0<\/FONT><FONT color=#808080 size=2>),<\/FONT><FONT size=2> DatabaseBackupLSN <\/FONT><FONT color=#0000ff size=2>NUMERIC<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>25<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> 0<\/FONT><FONT color=#808080 size=2>),<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<P><FONT face=\"Courier New\">BackupStartDate <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>DATETIME<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> BackupFinishDate <\/FONT><FONT color=#0000ff size=2>DATETIME<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> SortOrder <\/FONT><FONT color=#0000ff size=2>SMALLINT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> <\/FONT><FONT color=#0000ff size=2>CodePage<\/FONT><FONT size=2> <\/FONT><FONT color=#0000ff size=2>SMALLINT<\/FONT><FONT color=#808080 size=2>, <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">UnicodeLocaleId <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>INT<\/FONT><FONT color=#808080 size=2>,<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>UnicodeComparisonStyle <\/FONT><FONT color=#0000ff size=2>INT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> CompatibilityLevel <\/FONT><FONT color=#0000ff size=2>TINYINT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> SoftwareVendorId <\/FONT><FONT color=#0000ff size=2>INT<\/FONT><FONT color=#808080 size=2>, <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">SoftwareVersionMajor <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>INT<\/FONT><FONT color=#808080 size=2>,<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>SoftwareVersionMinor <\/FONT><FONT color=#0000ff size=2>INT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> SoftwareVersionBuild <\/FONT><FONT color=#0000ff size=2>INT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> MachineName <\/FONT><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>128<\/FONT><FONT color=#808080 size=2>), <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">Flags <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>INT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> BindingID <\/FONT><FONT color=#0000ff size=2>UNIQUEIDENTIFIER<\/FONT><FONT color=#808080 size=2>,<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>RecoveryForkID <\/FONT><FONT color=#0000ff size=2>UNIQUEIDENTIFIER<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> Collation <\/FONT><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>128<\/FONT><FONT color=#808080 size=2>), <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">FamilyGUID <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>UNIQUEIDENTIFIER<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> HasBulkLoggedData <\/FONT><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>,<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>IsSnapshot <\/FONT><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> IsReadOnly <\/FONT><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> IsSingleUser <\/FONT><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>, <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">HasBackupChecksums <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> IsDamaged <\/FONT><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> BeginsLogChain <\/FONT><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>,<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>HasIncompleteMetaData <\/FONT><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> IsForceOffline <\/FONT><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>, <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">IsCopyOnly <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>BIT<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> FirstRecoveryForkID <\/FONT><FONT color=#0000ff size=2>UNIQUEIDENTIFIER<\/FONT><FONT color=#808080 size=2>,<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>ForkPointLSN <\/FONT><FONT color=#0000ff size=2>NUMERIC<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>25<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> 0<\/FONT><FONT color=#808080 size=2>)<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>NULL, <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">RecoveryModel <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>60<\/FONT><FONT color=#808080 size=2>),<\/FONT><FONT size=2> DifferentialBaseLSN <\/FONT><FONT color=#0000ff size=2>NUMERIC<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>25<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> 0<\/FONT><FONT color=#808080 size=2>)<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>NULL,<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT size=2>DifferentialBaseGUID <\/FONT><FONT color=#0000ff size=2>UNIQUEIDENTIFIER<\/FONT><FONT color=#808080 size=2>, <\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">BackupTypeDescription <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>60<\/FONT><FONT color=#808080 size=2>),<\/FONT><FONT size=2> BackupSetGUID <\/FONT><FONT color=#0000ff size=2>UNIQUEIDENTIFIER<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>NULL);<\/P><\/BLOCKQUOTE><\/FONT><\/FONT><FONT face=\"Courier New\" size=2><br \/>\n<P>GO<\/P><br \/>\n<P>&nbsp;<\/P><\/FONT><FONT color=#0000ff size=2><FONT face=\"Courier New\"><FONT color=#008000 size=2><br \/>\n<P>&#8212; Populate the table<\/P><br \/>\n<P><\/FONT>INSERT<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>INTO<\/FONT><FONT color=#000000 size=2> master<\/FONT><FONT color=#808080 size=2>.<\/FONT><FONT color=#000000 size=2>dbo<\/FONT><FONT color=#808080 size=2>.<\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\" color=#000000>restoreheaderonly <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>EXEC<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT color=#ff0000 size=2>&#8216;RESTORE HEADERONLY FROM DISK = &#8221;C:\\sqlskills\\mixedbackups.bck&#8221;&#8217;<\/FONT><FONT color=#808080 size=2>)<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><\/FONT><FONT face=\"Courier New\" size=2><br \/>\n<P>GO<\/P><br \/>\n<P>&nbsp;<\/P><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">DECLARE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> @Position <\/FONT><FONT color=#0000ff size=2>SMALLINT<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">DECLARE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> @DatabaseName <\/FONT><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT color=#000000 size=2>128<\/FONT><FONT color=#808080 size=2>);<\/P><\/FONT><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">DECLARE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> @ExecString <\/FONT><FONT color=#0000ff size=2>NVARCHAR<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT color=#000000 size=2>255<\/FONT><FONT color=#808080 size=2>);<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT color=#808080 size=2>&nbsp;<\/P><\/FONT><\/FONT><FONT color=#0000ff size=2><FONT face=\"Courier New\"><FONT color=#008000 size=2><br \/>\n<P>&#8212; Declare a cursor to iterate over the results<\/P><br \/>\n<P><\/FONT>DECLARE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> databases <\/FONT><FONT color=#0000ff size=2>CURSOR<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>FOR<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>SELECT<\/FONT><FONT size=2> Position<\/FONT><FONT color=#808080 size=2>,<\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\"> DatabaseName <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>FROM<\/FONT><FONT size=2> master<\/FONT><FONT color=#808080 size=2>.<\/FONT><FONT size=2>dbo<\/FONT><FONT color=#808080 size=2>.<\/FONT><\/FONT><FONT size=2><FONT face=\"Courier New\">restoreheaderonly <\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>WHERE<\/FONT><FONT size=2> BackupTypeDescription <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;Database&#8217;<\/FONT><FONT color=#808080 size=2>;<\/FONT><\/FONT><\/P><\/BLOCKQUOTE><br \/>\n<P dir=ltr><FONT face=\"Courier New\"><FONT color=#808080 size=2>&nbsp;<\/P><\/FONT><\/FONT><FONT face=\"Courier New\" color=#008000 size=2><br \/>\n<P>&#8212; Open the cursor.<\/P><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">OPEN<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> databases<\/FONT><FONT color=#808080 size=2>;<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT color=#808080 size=2>&nbsp;<\/P><\/FONT><\/FONT><FONT face=\"Courier New\" color=#008000 size=2><br \/>\n<P>&#8212; Loop through the databases.<\/P><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">FETCH<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>NEXT<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>FROM<\/FONT><FONT color=#000000 size=2> databases <\/FONT><FONT color=#0000ff size=2>INTO<\/FONT><FONT color=#000000 size=2> @Position<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT color=#000000 size=2> @DatabaseName<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">WHILE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> <\/FONT><FONT color=#ff00ff size=2>@@FETCH_STATUS<\/FONT><FONT color=#000000 size=2> <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT size=2><FONT color=#000000> 0<\/FONT><\/P><\/FONT><\/FONT><FONT face=\"Courier New\" color=#0000ff size=2><br \/>\n<P>BEGIN<\/P><\/FONT><FONT size=2><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>SELECT<\/FONT><FONT size=2> @ExecString <\/FONT><FONT color=#808080 size=2>=<\/FONT><FONT size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;RESTORE DATABASE &#8216;<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>+<\/FONT><FONT size=2> <\/FONT><FONT color=#ff00ff size=2>RTRIM<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>@DatabaseName<\/FONT><FONT color=#808080 size=2>)<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>+<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><\/FONT><FONT face=\"Courier New\"><FONT color=#ff0000 size=2>&#8216; FROM DISK = &#8221;C:\\sqlskills\\mixedbackups.bck&#8221;&#8217;<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>+<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<P><\/FONT><FONT face=\"Courier New\"><FONT color=#ff0000 size=2>&#8216; WITH REPLACE, FILE = &#8216;<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>+<\/FONT><FONT size=2> <\/FONT><FONT color=#ff00ff size=2>RTRIM<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT color=#ff00ff size=2>CONVERT<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT color=#0000ff size=2>VARCHAR<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>10<\/FONT><FONT color=#808080 size=2>),<\/FONT><FONT size=2> @Position<\/FONT><FONT color=#808080 size=2>));<\/P><\/BLOCKQUOTE><\/FONT><\/FONT><FONT size=2><br \/>\n<P><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>SELECT<\/FONT><FONT size=2> <\/FONT><FONT color=#ff0000 size=2>&#8216;Restoring database &#8216;<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>+<\/FONT><FONT size=2> <\/FONT><FONT color=#ff00ff size=2>RTRIM<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>@DatabaseName<\/FONT><FONT color=#808080 size=2>);<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<P><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>EXEC<\/FONT><FONT size=2> <\/FONT><FONT color=#808080 size=2>(<\/FONT><FONT size=2>@ExecString<\/FONT><FONT color=#808080 size=2>);<\/P><\/FONT><\/FONT><FONT size=2><br \/>\n<P><\/FONT><FONT face=\"Courier New\"><FONT color=#0000ff size=2>FETCH<\/FONT><FONT size=2> <\/FONT><FONT color=#0000ff size=2>NEXT<\/FONT><FONT size=2> <\/FONT><FONT color=#0000ff size=2>FROM<\/FONT><FONT size=2> databases <\/FONT><FONT color=#0000ff size=2>INTO<\/FONT><FONT size=2> @Position<\/FONT><FONT color=#808080 size=2>,<\/FONT><FONT size=2> @DatabaseName<\/FONT><FONT color=#808080 size=2>;<\/P><\/BLOCKQUOTE><\/FONT><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">END<\/FONT><\/FONT><FONT color=#808080 size=2><FONT face=\"Courier New\">;<\/FONT><\/FONT><\/P><br \/>\n<P><FONT color=#808080 size=2><FONT face=\"Courier New\"><\/FONT>&nbsp;<\/P><\/FONT><FONT face=\"Courier New\" color=#008000 size=2><br \/>\n<P>&#8212; Close and deallocate the cursor.<\/P><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">CLOSE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> databases<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">DEALLOCATE<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> databases<\/FONT><FONT color=#808080 size=2>;<\/FONT><\/FONT><\/P><br \/>\n<P><FONT face=\"Courier New\"><FONT color=#808080 size=2>&nbsp;<\/P><\/FONT><\/FONT><FONT face=\"Courier New\" color=#008000 size=2><br \/>\n<P>&#8212; Delete the temporary table.<\/P><\/FONT><FONT color=#0000ff size=2><br \/>\n<P><FONT face=\"Courier New\">DROP<\/FONT><\/FONT><FONT face=\"Courier New\"><FONT color=#000000 size=2> <\/FONT><FONT color=#0000ff size=2>TABLE<\/FONT><FONT color=#000000 size=2> master<\/FONT><FONT color=#808080 size=2>.<\/FONT><FONT color=#000000 size=2>dbo<\/FONT><FONT color=#808080 size=2>.<\/FONT><FONT color=#000000 size=2>restoreheaderonly<\/FONT><FONT color=#808080 size=2>;<\/P><\/FONT><\/FONT><FONT face=\"Courier New\" size=2><br \/>\n<P>GO<\/P><\/FONT><\/BLOCKQUOTE><\/FONT><\/FONT><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is another question that came up on the Disaster Recovery forum on MSDN. Paraphrasing &#8211; &#8216; I have a backup file containing full backups for 45 databases. How can I restore them all using a script?&#8217; The answer is pretty straightforward. Let&#8217;s create the situation described, using 3 databases for clarity rather than 45: [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,35,38,78],"tags":[],"class_list":["post-1156","post","type-post","status-publish","format-standard","hentry","category-backuprestore","category-disaster-recovery","category-example-scripts","category-search-engine-q-and-a"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Search Engine Q&amp;A #7: Restoring from a backup file containing multiple database backups - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Search Engine Q&amp;A #7: Restoring from a backup file containing multiple database backups - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"This is another question that came up on the Disaster Recovery forum on MSDN. Paraphrasing &#8211; &#8216; I have a backup file containing full backups for 45 databases. How can I restore them all using a script?&#8217; The answer is pretty straightforward. Let&#8217;s create the situation described, using 3 databases for clarity rather than 45: [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2007-10-10T01:35:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:52:06+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/\",\"name\":\"Search Engine Q&A #7: Restoring from a backup file containing multiple database backups - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2007-10-10T01:35:32+00:00\",\"dateModified\":\"2017-04-13T16:52:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Search Engine Q&#038;A #7: Restoring from a backup file containing multiple database backups\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Search Engine Q&A #7: Restoring from a backup file containing multiple database backups - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/","og_locale":"en_US","og_type":"article","og_title":"Search Engine Q&A #7: Restoring from a backup file containing multiple database backups - Paul S. Randal","og_description":"This is another question that came up on the Disaster Recovery forum on MSDN. Paraphrasing &#8211; &#8216; I have a backup file containing full backups for 45 databases. How can I restore them all using a script?&#8217; The answer is pretty straightforward. Let&#8217;s create the situation described, using 3 databases for clarity rather than 45: [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/","og_site_name":"Paul S. Randal","article_published_time":"2007-10-10T01:35:32+00:00","article_modified_time":"2017-04-13T16:52:06+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/","name":"Search Engine Q&A #7: Restoring from a backup file containing multiple database backups - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2007-10-10T01:35:32+00:00","dateModified":"2017-04-13T16:52:06+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-7-restoring-from-a-backup-file-containing-multiple-database-backups\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Search Engine Q&#038;A #7: Restoring from a backup file containing multiple database backups"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/1156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=1156"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/1156\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=1156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=1156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=1156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}