March 7, 2012 at 2:27 am
Hi All,
I am trying to restore database from an backup file which is located on development server.
Steps I followed.
1.Created share path and gave full access in development server.
2.Map the share path of development to drive in my local server with name Z.
3.Then I executed this statement to make SQL server access the mapped drive
exec xp_cmdshell 'net use Z: \\servername\Share password/user:domain\username'
and the error was System error 85 has occurred.The local device name is already in use.
Astonishing thing is that when i issued dir Z:\*.bak in command line prompt,it listed all the bakup files
but same thing queried in sql server using xp_cmdshell (exec xp_cmdshell 'dir Z:\*.sql')it returned
The system cannot find the path specified.
Why this discrepancy anything I missed out please suggest.
March 7, 2012 at 2:54 am
Don't use a mapped drive, use the UNC path instead.
Give the sql server user the appropriate permissions on that path and run the restore command.
-- Gianluca Sartori
March 7, 2012 at 3:00 am
Thanks,Could you please guide me with an example,it will be grateful to me.
March 7, 2012 at 3:12 am
RESTORE DATABASE yourDatabaseName FROM DISK = '\\UNCPATH\yourackupFile.bak' WITH RECOVERY;
-- Gianluca Sartori
March 7, 2012 at 3:27 am
How to create UNC Path?
March 7, 2012 at 3:34 am
Give the full path ie \\servername\c$\folder\backup.bak
March 7, 2012 at 3:35 am
the UNC path is the path to the shared folder,
so in the example you provided it will be
restore database ######### from disk = '\\servername\Share\##.bak'
March 7, 2012 at 3:44 am
Yes I tried,and it doesn't worked for me as the domain of the development server differs.
March 7, 2012 at 3:50 am
Two options:
1) set up domain trust
2) download the file locally with FTP or SMB and then restore from local disk
-- Gianluca Sartori
March 7, 2012 at 6:06 am
along with trusts in place, try using the FQDN so \\server.domain.com\share
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply