17.07.2015 Views

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

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 8: Backup and Restore for <strong>FILESTREAM</strong> DatabasesWhen the backup has been restored, go to the <strong>FILESTREAM</strong> data container and youwill see 101 files instead <strong>of</strong> just the 1 that you would normally expect to see. It is quitesurprising to see that all the garbage files came along with the backup, and they all gotrestored in the new location.<strong>The</strong> garbage files unnecessarily increase the backup time and size, and increase the diskspace requirements on the target location. My tests showed that a transaction log backupfollowed by a full backup on the target database clears the garbage files the next time thegarbage collector runs.SummaryWe have seen that taking a backup <strong>of</strong> a <strong>FILESTREAM</strong> database is no different frombacking up a non-<strong>FILESTREAM</strong> database. However, a restore operation may need a littlebit more attention when restoring to a different database because you have to specify thelocation to which the <strong>FILESTREAM</strong> data is to be restored. In addition, you need to makesure that the <strong>FILESTREAM</strong> feature is enabled on the target database. <strong>SQL</strong> <strong>Server</strong> supportspoint-in-time recovery <strong>of</strong> <strong>FILESTREAM</strong>-enabled databases and this chapter presented anexample to demonstrate this feature.<strong>SQL</strong> <strong>Server</strong> allows the creation <strong>of</strong> full file backups <strong>of</strong> <strong>FILESTREAM</strong> databases that do notinclude the <strong>FILESTREAM</strong> filegroups. When such a backup is restored, all the relationaldata will be accessible. If you attempt to access the <strong>FILESTREAM</strong> data, <strong>SQL</strong> <strong>Server</strong> willgenerate an error.<strong>The</strong> backup <strong>of</strong> a <strong>FILESTREAM</strong> database includes the garbage and orphaned files that arepresent in the <strong>FILESTREAM</strong> data container at the time <strong>of</strong> the backup. <strong>The</strong>se files will berestored on the target location when the database is restored.328

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

Saved successfully!

Ooh no, something went wrong!