0

I have two separate Active Directory domains (FOO and BAA)

A dedicated backup server with S.O Windows exists in the FOO domain.

A SQL Server instance in the BAA domain needs to store backups on this.

The BAA SQL Server accesses the NAS via a dedicated network interface (192.168.137.1). (cross cable)

The NAS has a shared folder: '\192.168.137.1\Backup'

From Windows Explorer on the BAA SQL Server, I can create and delete files in this share.

However, when I run the following backup script in SQL Server Agent:

DECLARE @DATA CHAR(255) SELECT @DATA = N'\\192.168.137.1\db_backup_test.bak' BACKUP DATABASE [test_database] TO DISK = @DATA WITH NOFORMAT, INIT, NAME = N'FULL BACKUP', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO 

I get an error:

Executed as user: {I tried many users here}. Cannot open backup device '\192.168.137.1\backup\Acesso.bak'. Operating system error 5 (Access is denied.). 

I tried to enable access for users on the backup server (both in sharing and security), but since they are not from the same domain, the users do not appear.

Since the administrator user of the machine with SQL Server can create and delete files through Windows Explorer, I tried changing the logon of the user in the SQL Agent service to this user.

I also tried assigning a drive letter to the path using net use z: \192.168.137.1\backup (both with and without setting users), but the SQL Agent cannot find the Z: drive.

is there a way?

1 Answer 1

2

All system operations ultimately execute as the account of which the SQL Server service for the instance is running as. This is regardless of which Login is used to authenticate with the instance and execute the code itself.

Whichever account your SQL Server service is running under needs permissions provisioned to the backup share (\\192.168.137.1\).


Also, as mentioned by Charlieface, best to use the DNS name not IP address otherwise Kerberos won't work.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.