Showing posts with label queries. Show all posts
Showing posts with label queries. Show all posts

Wednesday, March 28, 2012

scheduling jobs that query linked servers

I have some SQL Servers that are linked and have created
a stored procedure on my primary SQL Server that queries
the linked servers. I also created a new login ID for
this.
I can run the stored proc anytime and it works great.
However, when I attempt to execute the stored proc from a
scheduled job I get the message: "Remote access not
allowed for Windows NT user activated by SETUSER."
I don't see how to get around this and still use the job
scheduler. Do I really have to use isql and put it in
scheduler software running outside MSSQL?
Can I run this T-SQL inside the scheduler with a
configuration switch somewhere? Or is this a "feature"
of MSSQL?
thanksIf you go to step properties, there is a drop down
box "run as user", from that list select the login that
has access to the linked server, that login also need to
have some access privileges to the database from which the
step is run.
hth.
>--Original Message--
>I have some SQL Servers that are linked and have created
>a stored procedure on my primary SQL Server that queries
>the linked servers. I also created a new login ID for
>this.
>I can run the stored proc anytime and it works great.
>However, when I attempt to execute the stored proc from a
>scheduled job I get the message: "Remote access not
>allowed for Windows NT user activated by SETUSER."
>I don't see how to get around this and still use the job
>scheduler. Do I really have to use isql and put it in
>scheduler software running outside MSSQL?
>Can I run this T-SQL inside the scheduler with a
>configuration switch somewhere? Or is this a "feature"
>of MSSQL?
>thanks
>
>.
>|||I tried that before and it did not work. I have not been
able to run this via any user in that drop down.
I have a situation where I can login via isql (sql server
authentication - not Windows auth.) and I am able to
execute the stored proc just fine. The stored proc
queries linked servers and works fine.
However when I try to use the Job Scheduler, I get the
error: "Remote access not allowed for Windows NT user
activated by SETUSER." When I attempt to run the job as
[self] I get: "Login failed for user 'NT
AUTHORITY\ANONYMOUS LOGON'."
Unless there is a hidden config option somewhere it
appears that the job scheduler cannot be used for remote
access to linked servers unless via a windows auth. login.
Is that true? If this is supposed to be a "security
feature" then it is pointless as far as I can tell.
We're on 2000 sp 3a
Jeff
>--Original Message--
>If you go to step properties, there is a drop down
>box "run as user", from that list select the login that
>has access to the linked server, that login also need to
>have some access privileges to the database from which
the
>step is run.
>hth.
>>--Original Message--
>>I have some SQL Servers that are linked and have
created
>>a stored procedure on my primary SQL Server that
queries
>>the linked servers. I also created a new login ID for
>>this.
>>I can run the stored proc anytime and it works great.
>>However, when I attempt to execute the stored proc from
a
>>scheduled job I get the message: "Remote access not
>>allowed for Windows NT user activated by SETUSER."
>>I don't see how to get around this and still use the
job
>>scheduler. Do I really have to use isql and put it in
>>scheduler software running outside MSSQL?
>>Can I run this T-SQL inside the scheduler with a
>>configuration switch somewhere? Or is this a "feature"
>>of MSSQL?
>>thanks
>>
>>.
>.
>|||I tried it myself and came to same conclusion as you for
now that you have to use windows auth. to access linked
servers via a jobschedule.
And looks like the problem is with the setuser command,
because when using nt auth. sqlagent is not using setuser
command, and if you use sql auth. then sqlagent is using
the setuser command. I tried this in QA also using setuser
for an nt auth. user who has sysadmin rights on both
servers and came back with the same error message "emote
access not allowed for Windows NT user activated by
SETUSER."
I will post more if I find something.
>--Original Message--
>I tried that before and it did not work. I have not been
>able to run this via any user in that drop down.
>I have a situation where I can login via isql (sql server
>authentication - not Windows auth.) and I am able to
>execute the stored proc just fine. The stored proc
>queries linked servers and works fine.
>However when I try to use the Job Scheduler, I get the
>error: "Remote access not allowed for Windows NT user
>activated by SETUSER." When I attempt to run the job as
>[self] I get: "Login failed for user 'NT
>AUTHORITY\ANONYMOUS LOGON'."
>Unless there is a hidden config option somewhere it
>appears that the job scheduler cannot be used for remote
>access to linked servers unless via a windows auth. login.
>Is that true? If this is supposed to be a "security
>feature" then it is pointless as far as I can tell.
>We're on 2000 sp 3a
>Jeff
>>--Original Message--
>>If you go to step properties, there is a drop down
>>box "run as user", from that list select the login that
>>has access to the linked server, that login also need to
>>have some access privileges to the database from which
>the
>>step is run.
>>hth.
>>--Original Message--
>>I have some SQL Servers that are linked and have
>created
>>a stored procedure on my primary SQL Server that
>queries
>>the linked servers. I also created a new login ID for
>>this.
>>I can run the stored proc anytime and it works great.
>>However, when I attempt to execute the stored proc from
>a
>>scheduled job I get the message: "Remote access not
>>allowed for Windows NT user activated by SETUSER."
>>I don't see how to get around this and still use the
>job
>>scheduler. Do I really have to use isql and put it in
>>scheduler software running outside MSSQL?
>>Can I run this T-SQL inside the scheduler with a
>>configuration switch somewhere? Or is this a "feature"
>>of MSSQL?
>>thanks
>>
>>.
>>.
>.
>|||This just gets stranger and stranger. On a hunch I set
up execution of my stored proc by a DTS package. I
schedule it and voila! it works!!?! It's not my
preferred way of doing this but if this is the kludge I
need to use to employ our of these inconsistent
behaviors, I'm going to use it.
Jeff
>--Original Message--
>I tried it myself and came to same conclusion as you for
>now that you have to use windows auth. to access linked
>servers via a jobschedule.
>And looks like the problem is with the setuser command,
>because when using nt auth. sqlagent is not using
setuser
>command, and if you use sql auth. then sqlagent is using
>the setuser command. I tried this in QA also using
setuser
>for an nt auth. user who has sysadmin rights on both
>servers and came back with the same error
message "emote
>access not allowed for Windows NT user activated by
>SETUSER."
>I will post more if I find something.
>
>>--Original Message--
>>I tried that before and it did not work. I have not
been
>>able to run this via any user in that drop down.
>>I have a situation where I can login via isql (sql
server
>>authentication - not Windows auth.) and I am able to
>>execute the stored proc just fine. The stored proc
>>queries linked servers and works fine.
>>However when I try to use the Job Scheduler, I get the
>>error: "Remote access not allowed for Windows NT user
>>activated by SETUSER." When I attempt to run the job
as
>>[self] I get: "Login failed for user 'NT
>>AUTHORITY\ANONYMOUS LOGON'."
>>Unless there is a hidden config option somewhere it
>>appears that the job scheduler cannot be used for
remote
>>access to linked servers unless via a windows auth.
login.
>>Is that true? If this is supposed to be a "security
>>feature" then it is pointless as far as I can tell.
>>We're on 2000 sp 3a
>>Jeff
>>--Original Message--
>>If you go to step properties, there is a drop down
>>box "run as user", from that list select the login
that
>>has access to the linked server, that login also need
to
>>have some access privileges to the database from which
>>the
>>step is run.
>>hth.
>>--Original Message--
>>I have some SQL Servers that are linked and have
>>created
>>a stored procedure on my primary SQL Server that
>>queries
>>the linked servers. I also created a new login ID
for
>>this.
>>I can run the stored proc anytime and it works
great.
>>However, when I attempt to execute the stored proc
from
>>a
>>scheduled job I get the message: "Remote access not
>>allowed for Windows NT user activated by SETUSER."
>>I don't see how to get around this and still use the
>>job
>>scheduler. Do I really have to use isql and put it
in
>>scheduler software running outside MSSQL?
>>Can I run this T-SQL inside the scheduler with a
>>configuration switch somewhere? Or is this
a "feature"
>>of MSSQL?
>>thanks
>>
>>.
>>.
>>.
>.
>

Tuesday, March 20, 2012

scheduled jobs are failing

I had about 30 schedule jobs that either import data or run sql queries.
They have worked wonderfully for months. All of a sudden they are failing.
I get the error message 203 ENVVAR_NOT_FOUND which translates to The system
could not find the environment option that was entered.
I don't understand what this means, nor how to fix it. I've spent almost 2
days searching for a solution. Even more complexing is why it all
changed...I haven't done anything different that I can think of.
Can someone please assist and point me in the right direction?
thanks in advance!!!Is it a specific type of step that is failing, or is your package not
starting at all? Have you enabled a package error log, to see if the log
file holds any further information?
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"tag" <tag@.discussions.microsoft.com> wrote in message
news:20709349-62D5-436C-A256-F15AEA8A4D1E@.microsoft.com...
I had about 30 schedule jobs that either import data or run sql queries.
They have worked wonderfully for months. All of a sudden they are failing.
I get the error message 203 ENVVAR_NOT_FOUND which translates to The system
could not find the environment option that was entered.
I don't understand what this means, nor how to fix it. I've spent almost 2
days searching for a solution. Even more complexing is why it all
changed...I haven't done anything different that I can think of.
Can someone please assist and point me in the right direction?
thanks in advance!!!|||is sql agent running
Jose de Jesus Jr. Mcp,Mcdba
Data Architect
Sykes Asia (Manila philippines)
MCP #2324787
"tag" wrote:

> I had about 30 schedule jobs that either import data or run sql queries.
> They have worked wonderfully for months. All of a sudden they are failing
.
> I get the error message 203 ENVVAR_NOT_FOUND which translates to The syste
m
> could not find the environment option that was entered.
> I don't understand what this means, nor how to fix it. I've spent almost
2
> days searching for a solution. Even more complexing is why it all
> changed...I haven't done anything different that I can think of.
> Can someone please assist and point me in the right direction?
> thanks in advance!!!|||Yes, SQL server agent is running
"Jose G. de Jesus Jr MCP, MCDBA" wrote:
> is sql agent running
>
>
> --
>
> Jose de Jesus Jr. Mcp,Mcdba
> Data Architect
> Sykes Asia (Manila philippines)
> MCP #2324787
>
> "tag" wrote:
>|||are the jobs running when executed manually?
check for any virus activity
Jose de Jesus Jr. Mcp,Mcdba
Data Architect
Sykes Asia (Manila philippines)
MCP #2324787
"tag" wrote:
> Yes, SQL server agent is running
> "Jose G. de Jesus Jr MCP, MCDBA" wrote:
>|||No, it appears that they are trying to kick off.
When I review the jobs I see that the last run status is "Failed".
When I review the job history I get
"The job failed. The Job was invoked by User sa. The last step to run was
step 1 (Census1 Load Text). Executed as user: CLFDATA\SYSTEM. The process
could not be created for step 1 of job 0xC4F7C84FC07C4A439571C7C4BE326910
(reason: The system could not find the environment option that was entered)
.
The step failed."
I noticed that the package error logs were not enabled. I'm correcting that
oversight now.
"Narayana Vyas Kondreddi" wrote:

> Is it a specific type of step that is failing, or is your package not
> starting at all? Have you enabled a package error log, to see if the log
> file holds any further information?
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "tag" <tag@.discussions.microsoft.com> wrote in message
> news:20709349-62D5-436C-A256-F15AEA8A4D1E@.microsoft.com...
> I had about 30 schedule jobs that either import data or run sql queries.
> They have worked wonderfully for months. All of a sudden they are failing
.
> I get the error message 203 ENVVAR_NOT_FOUND which translates to The syste
m
> could not find the environment option that was entered.
> I don't understand what this means, nor how to fix it. I've spent almost
2
> days searching for a solution. Even more complexing is why it all
> changed...I haven't done anything different that I can think of.
> Can someone please assist and point me in the right direction?
> thanks in advance!!!
>
>|||No, when I right click on the job and click on
"start job", they fail. I'm running the virus scan now.
"Jose G. de Jesus Jr MCP, MCDBA" wrote:
> are the jobs running when executed manually?
> check for any virus activity
>
> --
>
> Jose de Jesus Jr. Mcp,Mcdba
> Data Architect
> Sykes Asia (Manila philippines)
> MCP #2324787
>
> "tag" wrote:
>|||try creating a new simple job then
try to run it manually
if it fails to run then
the box is in trouble
Jose de Jesus Jr. Mcp,Mcdba
Data Architect
Sykes Asia (Manila philippines)
MCP #2324787
"tag" wrote:
> No, when I right click on the job and click on
> "start job", they fail. I'm running the virus scan now.
> "Jose G. de Jesus Jr MCP, MCDBA" wrote:
>|||I've done that multiple times...and it fails.
why is the box in trouble?
"Jose G. de Jesus Jr MCP, MCDBA" wrote:
> try creating a new simple job then
> try to run it manually
> if it fails to run then
> the box is in trouble
> --
>
> Jose de Jesus Jr. Mcp,Mcdba
> Data Architect
> Sykes Asia (Manila philippines)
> MCP #2324787
>
> "tag" wrote:
>|||I found my solution. I was missing a ; in my path. Full details are locate
d
at Microsofts site: http://support.microsoft.com/?kbid=322746
Thanks to all who responded!