Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to backup a SQL Server database to another drive letter located on another network on another domain. The location has already been mapped to Z:\ and corresponds to \\10.98.76.6\Backups\. This is the code I have so far in an SQL Query:

BACKUP DATABASE [LabResultDb] TO  
    DISK = Z'\\LabResultDb_backup_12-09-2011.bak' 
    WITH NOFORMAT, NOINIT,  NAME = Z'LabResultDb-Full Database Backup', 
    SKIP, NOREWIND, NOUNLOAD,  STATS = 10

But I get an error message...

Error msg

Cannot open backup device '\10.98.76.6\Backups'. Operating system error 1326(failed to retrieve text for this error. Reason: 15105).

share|improve this question
    
What if you use `\\10.98.76.6\Backups` in your query? I guess the drive is only mapped when a user is logged in, so the backup won't happen when no one is logged in... –  duenni Sep 12 '11 at 16:14
    
The drive is mapped because I can see it in the file manager under computer. I have added an edit with the error message –  JFB Sep 12 '11 at 16:19
2  
Operating system error 1326 = ERROR_LOGON_FAILURE (Logon failure: unknown user name or bad password). By default, the Microsoft SQL Server Service is running under the LocalSystem (or NetworkService account). Such accounts are unable to access the network share in question, therefore the backup task to remote location will fail. –  Sergey Sep 12 '11 at 16:31

4 Answers 4

up vote 2 down vote accepted

Z'\LabResultDb_backup_12-09-2011.bak' - it's not a valid path anyway.

*BACKUP DATABASE [LabResultDb] TO
DISK = '\10.98.76.6\Backups\LabResultDb_backup_12-09-2011.bak'*

should work. Make sure SQL Server (SQL Server Agent) started with user account (not 'Local System') which have an access to \10.98.76.6\Backups\ share.

share|improve this answer

The reason for the error is because SQL Server runs under a less-privileged account that doesn't have access to your mapped network.

share|improve this answer

To what @Duenni said. I have a backup script that goes to \\path\location\ and it works just fine. Even so, if you want a drive letter try "N'Z:\" not "Z'\"

share|improve this answer

For these who still come across this type of issue.

Check if the account your server is running on has not changed the password in the meantime. The server will continue to work untill the next restart, but it will fail to authenticate on remote share.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.