0

Is it possible to set backup path to network disk in SQL Server 2012?

I'm doing it in Management Studio -> New Maintenance Plan...

enter image description here

When I start a job for this subplan it returns an error:

Executing the query "BACKUP DATABASE [my_new_db] TO DISK = N'\\anotherServer\b..." failed with the following error: "Cannot open backup device '\\anotherServer\backup\my_new_db_backup_2017_08_30_112257_7728044.bak'. Operating system error 5(Přístup byl odepřen.). BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

I've tried this another variants with same error:

  • Mapped drive
  • Shortcut folder to another server saved on original server disk

And yes, I HAVE permissions. It really is possible to write to anotherServer from origial server (tried in Windows explorer). And I ran a job by same account.

Maybe in older versions it was possible? https://www.sqlservercentral.com/Forums/Topic678215-357-1.aspx

jarlh
  • 42,561
  • 8
  • 45
  • 63

1 Answers1

0

In SQL Server 2008. It is possible but, the Server machine must have write permissions on that Shared location.

BACKUP DATABASE DB_Name
TO DISK = '\\192.16.1.9\SharedDBs\Sample.bak'

Server machine have Read/Write permission on \192.16.1.9\SharedDBs specified folder.

Shyam Vemula
  • 591
  • 2
  • 14
  • thank you. But even if I set rights Read/Write to everyone and use IP adress instead of computer name I get the same error in SQL Server 2012. :( – user3168487 Aug 30 '17 at 10:21
  • @user3168487 Can you try once through Query. – Shyam Vemula Aug 30 '17 at 10:33
  • I tried it throught Query on 2012. And I tried it on SQL Server 2008 too just the same way. And it returns the same error like on 2012. That's weird... then I have something bad in my setting. Could you please tell me how exactly you set Read/Write permission for server machine? – user3168487 Aug 30 '17 at 10:34
  • Right Click on the Folder, then Select Share With Option, then Select EveryOne in Dropdownlist then Add. then Edit the Permission to Read/Write. – Shyam Vemula Aug 30 '17 at 10:40
  • well, I found the answer: https://stackoverflow.com/questions/3960257/cannot-open-backup-device-operating-system-error-5 – user3168487 Aug 30 '17 at 10:52
  • Okay fine. Issue related which one either SQL Side Or File System.?. @user3168487 – Shyam Vemula Aug 30 '17 at 11:11
  • It's hard to say. I think it's issue related to privacy policy in Windows in general. – user3168487 Aug 30 '17 at 11:14