Problem backing up to UNC drive

Aug 21, 2009 at 5:29 PM
Edited Aug 21, 2009 at 7:04 PM

Nevermind, got this figured out as per a similar issue in a post below.

Had to set the user running sql server service to the same user that has the network permissions.

-------------------------------------------------------------------------

Hi,

I get the following error when trying to backup to a unc drive:

[1] Database AdventureWorks: Backup starting at 2009/08/21 10:41:31 AM
    An exception occurred while executing a Transact-SQL statement or batch.
    Cannot open backup device '\\fs01\test\aplink\AdventureWorks\AdventureWorks_FullBackup_20090821_1041.bak'. Operating system error 5(Access is denied.).
BACKUP DATABASE is terminating abnormally.
    Backup failed for Server 'CGYD-24YZRH1\SQLEXPRESS'.
    An exception occurred while executing a Transact-SQL statement or batch.
    Cannot open backup device '\\fs01\aplink\AdventureWorks\AdventureWorks_FullBackup_20090821_1041.bak'. Operating system error 5(Access is denied.).
BACKUP DATABASE is terminating abnormally.

Thing is, the account being used for the backup has read/write access to the network directory.  Further, the backup folder ('AdventureWorks' in this case) does actually get created - so I can't see this being a rights thing.

Here is the command line:

expressmaint -S CGYD-24YZRH1\SQLEXPRESS -D AdventureWorks -T DB -R c:\test\reports -RU WEEKS -RV 1 -B \\fs01\aplink\ -BU DAYS -BV 1 -V -C

Backup to a local drive works fine.

Any thoughts?

Coordinator
Aug 21, 2009 at 10:02 PM

There are 2 accounts involved

1) The account used to run the expressmaint executable - this is used to connect to SQL and create folders/reports etc

2) The SQL Service account of the instance you are executing the backup against - SQL uses this account to write the backup file

In your case it would seem that the SQL Service account (2) does not have access to the share. Make sure that the SQL Service is running under a domain user account and that the account has modify permissions on the share