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> DatabasesOnce again, no <strong>FILESTREAM</strong>-specific additional steps or commands are needed to taketransaction log backups <strong>of</strong> <strong>FILESTREAM</strong> databases. Listing 8-3 inserts a third row into theNorthPole database, then captures a transaction log backup.-- Insert another row into the tableUSE NorthPoleGOINSERT INTO Items (ItemID, ItemNumber, ItemDescription, ItemImage)SELECTNEWID(), 'MS1003', 'Micros<strong>of</strong>t Mouse 3',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 log backupUSE masterGOBACKUP LOG NorthPoleTO DISK = 'C:\<strong>Art</strong>OfFS\Demos\Chapter8\bak\NorthPole_Log.trn'GOListing 8-4:Capturing a log backup.Finally, to set the scene for our various restore examples, we're going to add a fourth rowto the table, note the current time (we'll need this later), and then simulate a disaster inthe form <strong>of</strong> someone accidentally deleting the contents <strong>of</strong> the Items table. Finally, wetake a second log backup.-- Insert another row into the tableUSE NorthPoleGOINSERT INTO Items (ItemID, ItemNumber, ItemDescription, ItemImage)SELECTNEWID(), 'MS1004', 'Micros<strong>of</strong>t Mouse 4',CAST(bulkcolumn AS VARBINARY(MAX))317

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

Saved successfully!

Ooh no, something went wrong!