Recently I worked on a scenario where the requirement was to host more than 25 SQL server instances on a cluster. SQL supports 50 instances on a failover cluster if SMB file shares are used to host the databases. In this blog, I have shared the steps to implement the SMB file share as a storage option in the SQL Server.
By default, SQL Server doesn’t allow creation of SQL databases on a network path. This isn’t true from SQL 2012 onwards though. The screenshots below demonstrate the error in SQL 2008 R2 for your reference.
The Trace flag 1807 bypasses the check and allows you to configure SQL Server with network-based database files. But this is not recommended practice.
Starting SQL 2012, the databases (including system databases) can be installed on a Server Message block (SMB) file server. This is applicable to both the stand alone and cluster instances. With SMB implementation SQL Server supports 50 instances on a failover cluster if you choose SMB file shares as the storage option for your cluster installation.
Note: Filestream is not supported on an SMB file share.
To demonstrate the SMB file share solution with SQL Server, I created two Windows 2012 R2 clusters: one to host SQL resources and the other to host file share resources. This walkthrough provides an example of how to use SMB file share location to host SQL databases. The names and numbers of servers used are for example purposes only.
Windows virtual cluster name: SQLCluster:
Node 1: SQLNode1
Node 2: SQLNode2
Windows virtual cluster name: SMBCluster:
Node 1: SMBNode1
Node 2: SMBNode2
File share resources: Fileshare1 and Fileshare2
Figure 3: SQL cluster
Figure 5: File share resources
Figure 6: File share location: \\Fileshare1\Share1
Figure 7: File share location: \\Fileshare2\Share2
How to check if the file share resources are configured correctly? If you access the file share UNC path from the SQL cluster nodes, they should be accessible.
Now during the time of the SQL Cluster installation, specify the location of the file share which is already configured.
Figure 8: Database Engine Configuration Window.
SQL Setup displays the below warning message when file share location is chosen:
“You have specified a file server as the data directory \\Fileshare1\Share1. To avoid possible failures in the installation process, you must verify that the SQL Server service account has full control share permissions on the specified file server before continuing.”
Figure 9: Warning Message
Figure 10: SQL setup configuration
Figure 11: Successful installation of SQL.
Successfully installed SQL cluster. Using the SQL Add node operation, added the node SQLNode2 as a part of the existing SQL cluster.
To confirm the user database default location is set to file share location:
Created a database “SMBDB” at the file share location successfully:
Figure 14: Database location
Alright, now the databases are hosted on file shares. What about database reliability and performance? This blog has addressed these: http://blogs.msdn.com/b/sqlserverstorageengine/archive/2011/10/18/sql-databases-on-file-shares-it-s-time-to-reconsider-the-scenario.aspx
I hope the guidelines in the blog helps.
Install SQL Server with SMB file share as a storage option:
Description of support for network database files in SQL Server
Create a SQL Server Database on a network shared drive
How to create file shares on a cluster
SQL over SMB2 – One of the top 10 hidden gems in SQL Server 2008 R2
Please share your feedback, questions and/or suggestions.
Don Castelino | SQL Server Support Team | CSS – Microsoft
Disclaimer: All posts are provided AS IS with no warranties and confer no rights. Additionally, views expressed here are my own and not those of my employer, Microsoft.