SQL Server Service Users – Understanding Roles for Backups and Network Shares

sql server

To backup / restore to or from a network share, either the SQLServer or SQLAgent user needs access to that share.

Which is it? SQL itself or the agent?

And then how?

(I wanted to create the SQLServer user on a remote system, but did not know the pw for the SQLServer user on the db server itself… so I went to set the pw on the db server SQLServer user… and was not allowed to, even though I am a member of administrators…)

What am I missing here?

Scenario:

  • I have OLD-DB and NEW-DB servers.
  • I wanted to do a backup on OLD-DB to \new-db\incoming-logs\
  • I set up the SQLAgent user on new-db, with
    same pw as that user on old-db… but it failed, with error that
    cannot access that share.

So now I have a backup in \old-db\backups\ and would like to restore directly from there (rather than copying)…. AND I need to set up log shipping between these two systems.

NOTE: Active Directory / domain users are NOT available. This is plain jane, two stand alone servers.

Thank you for the missing piece. I know I am close!

Best Answer

The Service Account for SQL Server needs to be granted access to the network share in question.

This indicates a need for you to configure SQL Server to start with a Windows Active Directory account. If you don't have access to a domain account, you will need to create an account on the SQL Server machine with a matching account name and password on the target network machine.

Use SQL Server Configuration Manager to modify the startup config of the SQL Server Service.

enter image description here

The only way to allow a service on one machine to access a network share is to provide network access with a username and password. Make sure the SQL Server service can access the network share before restarting SQL Server by logging onto the SQL Server machine using the same username and password, and confirm you can see the network folder.

You also need to ensure you aren't trying to restore from a "mapped" network drive, since the "mapping" won't necessarily be there for the SQL Server service to "see". Instead of using a mapped drive letter for the restore, use a UNC name, such as \\server\share\folder\backup.bak