问题
I have a SQL Server installed on my PC (a terminal). I want to create a new database which its files (mdf & ldf) will be located on a network share.
From the files explorer I can easily see the share, but from the user interface of the SSMS - I don't.
Is it possible technically to do it? Is it possible to configure the instance to "see" remote drives?
回答1:
The reason for not being able to see network shares in SSMS is probably becuase of performance and reliability issues when placing database files on a network share. SSMS is trying to help you to avoid doing the wrong choice.
As you probably know remote storage in a database is typically attached/mounted as disks to the OS, e.g. SAN disks. And that is the typical way of storing data outside the restrictions of the local disks on the local machine.
There may of course be reasons for using a network share and I found this article which provides guideance on how to achieve this: http://blogs.msdn.com/b/varund/archive/2010/09/02/create-a-sql-server-database-on-a-network-shared-drive.aspx. The fix is to set trace flags which disable the check... It applies to SQL Server 2008 R2, if you are using SQL Server 2012 then let's hope that it still applies!
回答2:
Was looking for the exact same issue - now in the newer versions these are officially supported.
From SQL Server 2012, network shares are 'officially' supported for creating the database files
Source
Starting with SQL Server 2012, system databases (Master, Model, MSDB, and TempDB), and Database Engine user databases can be installed with Server Message Block (SMB) file server as a storage option.
So essentially, the data files could be in network shares.
Also, regarding the drives to be visible in SSMS, there following blog gives the details
Essentially, we need to do the following:
xp_cmdshell 'net use X: \\server name\share name'
Voila, the drive is now visible:
来源:https://stackoverflow.com/questions/12881455/sql-server-database-on-network-share