Forum Discussion
Julien4
Dec 16, 2020Copper Contributor
MSSQL 2019 - SQL Server Agent - Jobs account
Hi everyone,
I have a question regarding the execution of jobs in MSSQL 2019.
I’m managing several MSSQL servers but I’m not a DBA so maybe my question will sound vapid.
On a SQL mono-instance server, I have a user who is member of “ SQLAgentUserRole” on the database “msdb”.
He created jobs and is owner of these jobs.
For what I read (and understood), jobs are executed with the service account running the service “SQL Server Agent” if and only if, the owner of this job is sysadmin (which is not the case for me).
Unfortunately, I cannot find MS documentation confirming that.
Could someone please explain me that (MS documentation would be ideal).
Now, let’s assume I understood well, and jobs are running with the account specified as the job owner. What would be the best practice to manage these jobs? Should the user change the owner when he creates a job?
Thank you for your answers.
- Julien4Copper ContributorAccording to this link https://docs.microsoft.com/en-us/sql/ssms/agent/manage-job-steps?view=sql-server-ver15#transact-sql-job-steps, for my understanding, it confirms how I was understanding that. So in my case, the user "Bob" who creates job is not sysadmin, so jobs are running with the account specified as being the owner. By default the owner is the user "Bob" who created the job. Now my goal is to avoid any service interruption the day we disable the account of the user "Bob" who created jobs. I could create another account "jobexec_acc", granting it just necessary permissions in order to execute jobs. In my case, the user "Bob" cannot change the owner of jobs he creates/created. Does it mean a DBA needs to do that? Once more, I'm not DBA so I don't know if it is the good way to go for managing SQL servers. Basically, my question is, do you have recommendation for best practices for managing jobs? Thank you
- frank2ACopper Contributor