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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8: Backup and Restore for <strong>FILESTREAM</strong> Databasesprocess for such databases will be a time- and resource-consuming process. A typicalbackup scheme might consist <strong>of</strong> weekly full backups interspersed with nightly differentialbackups (plus transaction log backups, as required).Again, the behavior <strong>of</strong> differential backups is the same with <strong>FILESTREAM</strong> as withnon-<strong>FILESTREAM</strong> databases. Listing 8-3 inserts a new row into the NorthPole databaseand then captures a differential backup.-- Insert another row into the tableUSE NorthPoleGOINSERT INTO Items (ItemID, ItemNumber, ItemDescription, ItemImage)SELECTNEWID(), 'MS1002', 'Micros<strong>of</strong>t Mouse 2',CAST(bulkcolumn AS VARBINARY(MAX))FROM OPENROWSET(BULK 'C:\<strong>Art</strong>OfFS\Demos\Images\Micros<strong>of</strong>tMouse.jpg', SINGLE_BLOB) AS x-- Take a differential backupUSE masterGOBACKUP DATABASE NorthPoleTO DISK = 'C:\<strong>Art</strong>OfFS\Demos\Chapter8\bak\NorthPole_Diff.bak'WITH DIFFERENTIALGOListing 8-3:Capturing a differential database backup.Transaction log backupsA transaction log backup captures every record in the log that has been generated sincethe last log backup. We can combine these log backups with full (and any differential)backups to restore a database to any point in time before the last log backup was taken,assuming we have an unbroken chain <strong>of</strong> log files, taken after the relevant full backup.316

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

Saved successfully!

Ooh no, something went wrong!