December 22, 2015 at 6:13 am
I have a backup on a server and I have a VM with SQL on it. Because my VM has limited space on it (99gb), my backup is 17gb expands to over 55gb.
I have instances where I want to restore single rows from tables with a backup (from say, 2 days ago).
I have a mapped drive S: where the backups are or I have a 192.168.xx.xx network address.
I dont have enough room to copy 17gb to the VM and restore it, so can I attach the backup from a network location and get the data I want????
Darryl Wilson
darrylw99@hotmail.com
December 22, 2015 at 6:19 am
Yes.
https://msdn.microsoft.com/en-us/library/hh759341.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 23, 2015 at 1:15 am
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'xp_cmdshell',1
GO
RECONFIGURE
GO
EXEC XP_CMDSHELL 'net use H: \\foldername1\foldername2\sharedfoldername3'
EXEC XP_CMDSHELL 'Dir H:'
EXEC XP_CMDSHELL 'net use H: /delete'
EXEC sp_configure 'xp_cmdshell',0
GO
RECONFIGURE
GO
December 23, 2015 at 1:48 am
sri2015 (12/23/2015)
EXEC XP_CMDSHELL 'net use H: \\foldername1\foldername2\sharedfoldername3'EXEC XP_CMDSHELL 'Dir H:'
EXEC XP_CMDSHELL 'net use H: /delete'
Nope!
SQL does not support mapped drives for database files, just the //server/share format, as per the article referenced above.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 23, 2015 at 6:27 pm
GilaMonster (12/23/2015)
sri2015 (12/23/2015)
EXEC XP_CMDSHELL 'net use H: \\foldername1\foldername2\sharedfoldername3'EXEC XP_CMDSHELL 'Dir H:'
EXEC XP_CMDSHELL 'net use H: /delete'
Nope!
SQL does not support mapped drives for database files, just the //server/share format, as per the article referenced above.
Actually, when created through SQL Server via xp_CmdShell, it does. Been doing it for years. It's just like any other user when you do it that way.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 24, 2015 at 8:37 am
Ack, didn't notice that the 'not supported' list is for system database locations.
But still, you don't need to go to the extra effort of mapping a drive that the SQL Server service account can see, the \\servername\share syntax for files works fine, without traceflag, from 2012 onwards
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply