November 9, 2015 at 8:21 am
I am running Server 2014 and SSMS does not see my SYNOLOGY NAS drive. File Explorer sees it and I can access any file thru it. How do I configure SSMS to see it?
November 9, 2015 at 10:23 am
is your server clustered?
In that case, SQL can only see shared clustered drives.
if it's a plain old vanilla server, are you using a mapped drive? could the drive mapping be unique to just your login?
Lowell
November 9, 2015 at 11:17 am
I don't know if its clustered. I downloaded the Northwind database to a folder on the NAS called Databases. File Explorer sees it as my mapped Z drive, but when I go to Attach it in SSMS it lists my C & D drives but not my mapped Z drive. Z is the NAS drive.
November 9, 2015 at 11:28 am
since it's not physically attached, you have to jump through some hoops.
if you search for "map network drive for all users" you'll see the issue: shared drives ar eper user, and SQL is probably running under either system or a specific account.
if this is just for a short term thing, you can do it via xp_cmdshell;
exec master.dbo.xp_cmshell 'NET USE G: \\UNCPath\d$ /user:domain\user password'
GO
Restore Database DBName FROM Disk = 'G:\Path to bak'
GO
EXEC master.dbo.xp_cmdshell 'NET USE G: /DELETE'
NET USE path password /USER:domainname\username password
--working example
exec master.dbo.xp_cmdshell 'NET USE J: \\DEV223\c$\DataFiles /user:disney\lizaguirre MySecretPassword /persistent:yes'
if you want it to be permanent, it's a bit tougher.
if you are running as a domain user, there's some links saying add a login script under all users;
if you are running under system, you can use psexec to run a s the system account, according to this stack overflow, then it should be available?
Lowell
November 9, 2015 at 12:58 pm
I tried the psexec and it said it mapped to my Z drive successfully, but SSMS still doesn't see it. I am going to reboot to see if that makes any difference. Thanks for your help.
November 9, 2015 at 1:33 pm
Have you tried using powershell to map the drive ?
here is the general syntax, this will Map drive with name "S" to the path \\server1\share
New-PSDrive –Name “S” –PSProvider FileSystem –Root “\\server1\share” –Persist
For restoring database, if it is a repetitive thing I would create powershell script to map the drive and do the restore then schedule the script to run from sql job.
November 9, 2015 at 1:34 pm
Reboot did not make a difference.
November 9, 2015 at 1:58 pm
The response to that is "The local device name is already in use".
Should I Delete it using psexec? And then try it again? Shouldn't make a difference. Correct?
November 9, 2015 at 3:59 pm
you can remove the mapped drive using Remove-PSDrive, example below removes mapped drive "S"
Remove-PSDrive -name S
November 9, 2015 at 4:45 pm
I wouldn't remove it. It's saying the drive is already mapped. The question is, why it would appear otherwise.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 10, 2015 at 11:59 am
I tried the PowerShell command with no quotes an quotes around FileSystem and got this:
PS C:\WINDOWS\system32> New-PSDrive –Name “S” –PSProvider "FileSystem" –Root “\\isicsflws02\isicsflws02” –Persist
New-PSDrive : The network resource type is not correct
At line:1 char:1
+ New-PSDrive –Name “S” –PSProvider "FileSystem" –Root “\\isicsflws02\i ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (S:PSDriveInfo) [New-PSDrive], Win32Exception
+ FullyQualifiedErrorId : CouldNotMapNetworkDrive,Microsoft.PowerShell.Commands.NewPSDriveCommand
November 11, 2015 at 10:52 am
I think this question needs clarification. SSMS can "see" your Z: drive, can't it? Use File | Open file and check if you can't browse your Z: drive. You should be able to do this.
I think what you're having trouble with is ATTACHing a database file that resides on a network drive. I've never done this but have read about it, believe this is possible. Formerly TF 1807 was used for this. Now with SQL 2014 I am not sure if this TF still works or not. I did find , which appears specific to SQL 2014 but appears to apply only at setup!
You'd face the same problem if you tried to create a new DB with files on the Z: drive. I think this topic would get more search hits, maybe even more answers here.
November 12, 2015 at 7:34 am
If you have a clustered environment then you will need to add the drives as dependancies of the SQL Server resource in failover cluster manager
_________________________________________________________________
"The problem with internet quotes is that you cant always depend on their accuracy" -Abraham Lincoln, 1864
November 12, 2015 at 8:37 am
In SSMS, I tried File->Open->File and clicked on my Z drive and I get the following message:
"An error occurred while reconnecting to Z: to \\ISICSFLSYN01\ISICSFLSYN01
Microsoft Windows Network: A special logon session does not exist. It may already have been terminated.
This connection has not been restored"
In File Explorer it sees everything on Z:
November 12, 2015 at 9:08 am
Guess I was wrong! Sorry. Well, I think that's a good test case anyway, takes any special ATTACH considerations out of the picture.
Weird error. Using SSMS (SQL 2012) I open files from mapped drives, subst'ed drives, \\UNC\Shares, etc. every day with no problems.
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply