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 12: Planning, Configuration and Best PracticesConfiguring antivirus"Should I configure my antivirus s<strong>of</strong>tware to scan the <strong>FILESTREAM</strong> data?" is a very interestingquestion. <strong>The</strong> answer depends upon various factors specific to the environment,such as the source <strong>of</strong> data, or the way <strong>FILESTREAM</strong> files are processed. If you are storingdata that originated from untrusted sources (for example, end-user file uploads, perhapseven by users outside your own organization), you may want to enable virus scans.However, it is important to recognize that virus scanning s<strong>of</strong>tware may not be 100%effective because it will not be able to determine the file type <strong>of</strong> the stored data if thescanner uses the file extension for that purpose.If you decide to configure your antivirus s<strong>of</strong>tware to scan the <strong>FILESTREAM</strong> datacontainer, make sure you do not configure it to delete the infected files. If the antiviruss<strong>of</strong>tware deletes an infected file from the <strong>FILESTREAM</strong> data container, you will end upwith a corrupted database and it will be hard for you to figure out what went wrong andsubsequently recover the database.It is therefore recommended that you configure your antivirus s<strong>of</strong>tware to quarantinethe infected files rather than deleting them. If a <strong>FILESTREAM</strong> data file is infected andthe antivirus s<strong>of</strong>tware moves it to a quarantine folder, you can run DBCC CHECKDB toidentify the missing files in the <strong>FILESTREAM</strong> data container and match it with the filesin the quarantine folder. Chapter 7 included the options for recovering from missing<strong>FILESTREAM</strong> data files.You may also consider an alternative approach, in which the virus scanning is done atthe time <strong>of</strong> saving the <strong>FILESTREAM</strong> data. Many antivirus s<strong>of</strong>tware vendors provideSDKs, which expose API functions that you can use to scan a memory stream. Suchan API function can be called from your .NET or Win32 code just before writing the<strong>FILESTREAM</strong> data. This approach is most effective if your application writes dataexclusively using the streaming I/O APIs and not using T-<strong>SQL</strong> statements.446

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

Saved successfully!

Ooh no, something went wrong!