Solved

SQL Server permissions issue

Posted on 2014-11-03
11
273 Views
Last Modified: 2014-11-17
I have a server running SQL Server 2008 R2 that runs a monthly job to import data into an existing database.
The backup to be imported is located on another share.
When the job runs, it fails with the following error:
Executing the query "RESTORE DATABASE [DB_00] FROM  DISK = N'\\SERVER..." failed with the following error: "Cannot open backup device '\\SERVER\DB_00.bak'. Operating system error 1326(Logon failure: unknown user name or bad password.).  RESTORE DATABASE is terminating abnormally."

For troubleshooting purposes, I set the SQL agent to run as domain administrator and it shows in the log:
Executed as user: DOMAIN\Administrator

I copied the path from the error message and pasted it into a window and the directory opens fine.

Does anyone see what I'm missing here?
0
Comment
Question by:scarpenter104
  • 5
  • 5
11 Comments
 
LVL 69

Expert Comment

by:ScottPletcher
Comment Utility
Does the login running the job have sysadmin authority?

Do you have a proxy account set up for jobs?
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
Which user is running the job? That user must have read permissions on the share.
0
 
LVL 1

Author Comment

by:scarpenter104
Comment Utility
Since it says
Executed as user: DOMAIN\Administrator
I assume that is who is running the job.

ScottPletcher, It also says that it can't open the backup device, so I'm assuming the share permission to be the  issue, not database permissions, or is this just a confusing error message?
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
The DOMAIN\Administrator has read permission on the share?
0
 
LVL 1

Author Comment

by:scarpenter104
Comment Utility
Of course. And in my test I opened the path as Administrator. I also added read permission for Everyone to the share.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
I'm sorry for the questions but just wanted to confirm that you checked everything.
The SQL Server service account's also a domain user?
0
 
LVL 1

Author Comment

by:scarpenter104
Comment Utility
I don't believe so.
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
Comment Utility
Ok. Maybe that's the issue. When accessing a network share it uses the SQL Server service account and not the SQL Agent account.
0
 
LVL 1

Author Comment

by:scarpenter104
Comment Utility
When I can get access to it today I'll test that theory.
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
You need to set a new account to the SQL Server service. Maybe you can use the SQL Agent account for testing (DOMAIN\Administrator). Don't forget you need to restart SQL Server after changing the service account.
0
 
LVL 1

Author Closing Comment

by:scarpenter104
Comment Utility
I changed the SQL services to a domain account and that resolved the issue. Leave it to Microsoft to tell me in their log that the job was being executed by a domain account when in truth it was not.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now