Encountering errors during database restoration in SQL Server can be a daunting experience, especially when the process halts with messages about disabled features you thought were properly configured. One such error involves the FILESTREAM feature:
Msg 5591, Level 16, State 4, Line 2
FILESTREAM feature is disabled.
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.
This error halts the restoration of databases that utilize the FILESTREAM feature for storing unstructured data such as documents, images, and videos. Let’s dive into what causes this error and how you can resolve it, ensuring a smooth restoration process.
Understanding the Error
The error messages indicate two key points:
- FILESTREAM feature is disabled: This implies that the operation you’re attempting requires the FILESTREAM feature, which is not currently enabled on your SQL Server instance.
- RESTORE DATABASE is terminating abnormally: Following the first message, this indicates that the restore operation cannot proceed due to the disabled FILESTREAM feature.
This situation typically arises when trying to restore a database that uses FILESTREAM data on a server where FILESTREAM is not enabled.
How to Resolve the Error
Resolving this error involves a two-fold approach: enabling FILESTREAM on your SQL Server and then proceeding with the database restoration. Here’s a step-by-step guide to navigate this process.
1. Enable FILESTREAM on SQL Server
First, you need to enable FILESTREAM at the server level:
- Open SQL Server Configuration Manager: Navigate to the SQL Server Services.
- Modify SQL Server Instance Properties: Right-click on your SQL Server instance > Properties > FILESTREAM tab.
- Enable FILESTREAM: Check the boxes to enable FILESTREAM for Transact-SQL access, for file I/O streaming access, and for remote clients as per your requirements.
- Restart SQL Server Service: Apply the changes and restart the service for the changes to take effect.
2. Enable FILESTREAM at the SQL Instance Level
After enabling FILESTREAM on the server, you must also enable it at the SQL instance level:
- Open SQL Server Management Studio (SSMS): Connect to your SQL Server instance.
- Run the SQL Script to Enable FILESTREAM: Execute the following commands:
EXEC sp_configure filestream_access_level, 2
RECONFIGURE
Here, setting filestream_access_level
to 2
enables FILESTREAM for both T-SQL and Win32 streaming access. Adjust this value based on your specific needs (0 = disabled, 1 = T-SQL access, 2 = T-SQL and Win32 access).
3. Restoring the Database
With FILESTREAM enabled both on the server and at the instance level, you’re now set to retry the database restore operation. This can be done through SSMS or by using the RESTORE DATABASE
T-SQL command.
Tips and Considerations
- Backup Strategy: Always have a robust backup strategy, especially for databases utilizing features like FILESTREAM.
- Compliance and Policies: Enable FILESTREAM in accordance with your organization’s data and security policies.
- Testing: Test the restore process in a non-production environment to ensure everything works as expected before making changes in a live environment.
Conclusion
Encountering the “FILESTREAM feature is disabled” error during database restoration can be frustrating, but it’s a manageable issue. By carefully enabling FILESTREAM on both the server and instance levels, you can overcome this hurdle. Always remember the importance of understanding SQL Server’s features and configurations to maintain smooth database operations.
Thank You,
Vivek Janakiraman
Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.