Wednesday, March 21, 2012

Job not running as owner

Here's a weird one.
I've got a job on one server, owner 'sa'. It runs fine. I created the
same job on another server, still with owner 'sa', and it fails. When I
view the history, it fails because it's running as a different user,
one without the necessary rights. On the server that it works on, the
job is being run as the correct user, 'sa'.
In the step, under advanced, 'Run as user:' is set to '(self)', just as
it is in the server that works.
Help! I cannot see any difference between the jobs on the 2 servers,
and I can't think of any reason why it's trying to execute the job as a
user other than the owner.
Hi,
Have a look into the SQL Agent startup account. See if it have necessary
rights.
Thanks
Hari
SQL Server MVP
<ben.bawden@.btopenworld.com> wrote in message
news:1129111265.698508.242580@.g43g2000cwa.googlegr oups.com...
> Here's a weird one.
> I've got a job on one server, owner 'sa'. It runs fine. I created the
> same job on another server, still with owner 'sa', and it fails. When I
> view the history, it fails because it's running as a different user,
> one without the necessary rights. On the server that it works on, the
> job is being run as the correct user, 'sa'.
> In the step, under advanced, 'Run as user:' is set to '(self)', just as
> it is in the server that works.
> Help! I cannot see any difference between the jobs on the 2 servers,
> and I can't think of any reason why it's trying to execute the job as a
> user other than the owner.
>
|||Check *both* the job as a whole and each jobstep. Job should be owned by "sa" and job step should be
<self>. Double and triple check.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<ben.bawden@.btopenworld.com> wrote in message
news:1129111265.698508.242580@.g43g2000cwa.googlegr oups.com...
> Here's a weird one.
> I've got a job on one server, owner 'sa'. It runs fine. I created the
> same job on another server, still with owner 'sa', and it fails. When I
> view the history, it fails because it's running as a different user,
> one without the necessary rights. On the server that it works on, the
> job is being run as the correct user, 'sa'.
> In the step, under advanced, 'Run as user:' is set to '(self)', just as
> it is in the server that works.
> Help! I cannot see any difference between the jobs on the 2 servers,
> and I can't think of any reason why it's trying to execute the job as a
> user other than the owner.
>
|||Hi. The SQL Server Agent startup account is the same on both servers.
However server1 is running the job as sa, and server2 is running the
job as the SQL Server Agent startup account. Strange.
I've double, triple, quadruple checked that the job in question is set
to owner sa and the step is set to self.
Other jobs on the server are also running as the non-sa account, but
this one is the only one that's failing, because it's running through a
linked server. As a work around I've built a DTS package that runs the
task, and then scheduled that DTS package, but I'd really like to
understand why this server is running jobs under the non-sa account.
|||I'm not sure whether you are talking about TSQL or CmdExec job step. However, two things to check:
1 EM, Agent, right-click, properties, right-most tab. Check how agent log on to SQL Server.
2 Security mode for each SQL Server (Windows only or mixed).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<ben.bawden@.btopenworld.com> wrote in message
news:1129115237.379149.269800@.g43g2000cwa.googlegr oups.com...
> Hi. The SQL Server Agent startup account is the same on both servers.
> However server1 is running the job as sa, and server2 is running the
> job as the SQL Server Agent startup account. Strange.
> I've double, triple, quadruple checked that the job in question is set
> to owner sa and the step is set to self.
> Other jobs on the server are also running as the non-sa account, but
> this one is the only one that's failing, because it's running through a
> linked server. As a work around I've built a DTS package that runs the
> task, and then scheduled that DTS package, but I'd really like to
> understand why this server is running jobs under the non-sa account.
>
sql

No comments:

Post a Comment