Here the task was to setup the sql server log shipping in sql server 2008 while configuring the log shipping we came across operating system error 5 as shown below.
Sql server log shipping Error 3041
Error: 3041, Severity: 16, State: 1.
BackupDiskFile::CreateMedia: Backup device ‘C:\Backup\Db.bak’ failed to create. Operating system error 5(Access is denied.)
Now as error suggests access denied means its related to permission on shared folders either on primary or secondary server. So we added administrator account in access list of shared folder then also it failed again.
We checked sql server services were running on different account (domain\service_account ) this is nothing but the service account which we use to configure sql services while setup of sql server.
we decided to give permission to sql server service account on shared folder, we followed below steps to add service account in the access list of the folder.
1. Open the service.msc, go to sql server service (MSSQLSERVER or Sql instance name)
2. Double click on sql server service
3. Check the LogOn tab
4. Copy the service account name (domain\service_acount)
5. Now go to secondary server and right click on share folder for sharing.
6. Select the second option from the drop down list (window server 2008) and click on add
7. It will give you small dialog box, here in location select entire directory and enter the service account name in below box, now click on check name option and ok.
8. Give full permission to this service account.
After adding service account and assigning full permission, we re-ran the setup and it completed successfully.
Try at your end, hope it will help you.