Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 High Availability (2005)
 Cant backup to network drive

Author  Topic 

Mondeo
Constraint Violating Yak Guru

287 Posts

Posted - 2007-11-19 : 05:29:23
I cant seem to back up to a network drive using this SP

BEGIN
DECLARE @path varchar(100)
SET @path = 'P:\backup\database\TRANSFER.BAK'
BACKUP DATABASE DbPubMatrix
TO DISK = @path
WITH INIT
END

Msg 3201, Level 16, State 1, Procedure sp_TransferMatrixDataToNHS, Line 17
Cannot open backup device 'P:\backup\database\TRANSFER.BAK'. Operating system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Procedure sp_TransferMatrixDataToNHS, Line 17
BACKUP DATABASE is terminating abnormally.

I read somewhere that this may be due to the account which SQL is running under not having network access - how do I check this and change the account?

Thanks

Zoroaster
Aged Yak Warrior

702 Posts

Posted - 2007-11-19 : 09:56:05
To check which account the SQL Server service is using you can use the SQL Configuration Manager or in Services under admin tools (services.msc). As far as the account access, you can check Local Security Policy under admin tools, and local users and groups in Computer Management or if it's AD you need to Domain tools.
What you really need to check is if the account has explicit access or access via being part of a group to that network share. Whatever P: represents, go and check the permissions on it and see if the service account has been granted access.




Future guru in the making.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-19 : 23:50:46
Should use unc name instead of mapped drive.
Go to Top of Page

Mondeo
Constraint Violating Yak Guru

287 Posts

Posted - 2007-11-20 : 05:06:19
The problem is that this share has a specific username and password which has been assigned to us by our ISP. I'm unable to set additional permissions on it and the credentials it uses are meaningless on the SQL server machine.

I've changed SQL to run under the local administrator account but it hasn't made any differece.

If I change it to UNC format, the error is different

Msg 3201, Level 16, State 1, Procedure sp_TransferMatrixDataToNHS, Line 17
Cannot open backup device '\\10.10.6.5\matrix$\backup\database\TRANSFER.BAK'. Operating system error 1326(Logon failure: unknown user name or bad password.).
Msg 3013, Level 16, State 1, Procedure sp_TransferMatrixDataToNHS, Line 17
BACKUP DATABASE is terminating abnormally.
Go to Top of Page

Zoroaster
Aged Yak Warrior

702 Posts

Posted - 2007-11-20 : 09:26:48
Do you have write access to this share when you log in with the account you were given (try creating a new file or copying a file to it)?



Future guru in the making.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-11-20 : 09:37:16
The problem is that the SQL Server service account does not have access to the share that you are trying to backup to.

You have to fix that if you want the backup to work.




CODO ERGO SUM
Go to Top of Page

Van
Constraint Violating Yak Guru

462 Posts

Posted - 2007-11-20 : 09:46:56
Correct. Whatever account SQL is running under has to have access to write to the path you want to backup to.

It's probably not a good idea to change the account sql is running as (maybe it's ok in your situation if no one else knows the name and password of the account that your ISP set up for that directory). You'll probably want to have them give your SQL account rights to that path. Otherwise you could backup locally and have an NT job come along later and copy that backup to the network path with the name and password the ISP gave you.
Go to Top of Page
   

- Advertisement -