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 7: <strong>FILESTREAM</strong> Database AdministrationChecking for database consistencyConsistency <strong>of</strong> the <strong>FILESTREAM</strong> data can be checked using DBCC CHECKDB for the entiredatabase, or DBCC CHECKTABLE to validate a single table. In Listing 7-15, we run DBCCCHECKTABLE to scan the table that we just corrupted by deleting the <strong>FILESTREAM</strong> datafile using Windows Explorer.DBCC CHECKTABLE('Items')/*DBCC results for 'sys.<strong>FILESTREAM</strong>_tombstone_2073058421'.<strong>The</strong>re are 0 rows in 1 pages for object"sys.<strong>FILESTREAM</strong>_tombstone_2073058421".DBCC results for 'Items'.Msg 7904, Level 16, State 2, Line 1Table error: Cannot find the <strong>FILESTREAM</strong> file"00000015-0000005e-0004" for column ID 4 (column directoryID 4d8cb114-f573-490e-adfa-e4583889b836) in object ID 2105058535,index ID 0, partition ID 72057594038779904, page ID (1:157),slot ID 0.<strong>The</strong>re are 2 rows in 1 pages for object "Items".CHECKTABLE found 0 allocation errors and 1 consistency errorsin table 'Items' (object ID 2105058535).repair_allow_data_loss is the minimum repair level for theerrors found by DBCC CHECKTABLE (NorthPole.dbo.Items).DBCC execution completed. If DBCC printed error messages, contactyour system administrator.*/Listing 7-15:Scanning the corrupted table.As expected, the DBCC CHECKTABLE command scanned the entire table and detected thata <strong>FILESTREAM</strong> data file is missing from the <strong>FILESTREAM</strong> data container.288

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

Saved successfully!

Ooh no, something went wrong!