如何设置 SQL Server 2005 作业 CmdExec 超时 [英] How to set SQL Server 2005 Job CmdExec Timeout

查看:37
本文介绍了如何设置 SQL Server 2005 作业 CmdExec 超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SQL Server 2005 中有一个作业设置,其中有一个操作系统 (CmdExec) 步骤.

I have a job setup in SQL Server 2005 which has an Operating System (CmdExec) step.

该步骤调用可能需要很长时间才能运行的程序.我看到如果程序的响应时间超过 1 分 40 秒,则该步骤将失败并显示错误消息操作已超时".程序实际上会继续运行并生成所需的结果.

The step calls a program which can take a long time to run. I see that if the program takes longer than 1 minute 40 seconds to respond the step fails with an error message "The operation has timed out". The program actually continues to run and generates the desired results.

如何设置此作业中步骤的超时期限.或者,如果有一种方法可以为整个作业设置超时,这将同样有用,因为这是作业中的唯一步骤.如果所有其他方法都失败了,我愿意更改整个服务器的超时时间,尽管这显然是最后的手段.

How can I set the timeout period for the step in this job. Alternatively if there is a way to set the timeout for the entire job that would be just as useful since this is the only step in the job. If all else fails I would be willing to change the timeout for the entire server although obviously this would be a last resort.

我已尝试查看步骤、作业和 SQL Server 代理的属性,但没有找到设置此选项的任何地方.

I have tried looking into the properties for the step, job, and SQL Server Agent but have not managed to find anywhere to set this option.

推荐答案

SQL 作业没有超时 -- 您无法将它们配置为在运行时间过长或到达特定时间点时自行停止.(如果可以的话,Woulda 为我节省了很多开发时间!)您可以配置步骤来检查时间或持续时间,并且可以对步骤内采取的操作进行编码以检查时间,但在作业或步骤级别,没有.

SQL jobs don't have timeouts -- you can't configure them to stop on their own if they run too long, or reach a particular point in time. (Woulda saved me a lot of development time if you could!) You can configure steps to check for times or durations, and can code the actions taken within steps to check for times, but at the job or the step level, no.

这是一个有趣的问题.你为什么会超时?根据您所说的,我猜 SQL 代理无法判断操作系统已收到您通过 cmdexec 步骤发送的执行此操作"命令.在发送和等待之后,它认为该作业从未开始并相应地报告(并且存在您隐藏的系统超时).这是怎么回事?您可以投资安全配置或文件访问权限,但我会首先检查您正在启动的任何例程 - 我觉得它有些可疑.

Which is what makes this an interesting question. Why are you getting a timeout? Based on what you've said, I'd guess that SQL Agent is unable to tell that the OS has received the "do this" command you're sending via the cmdexec step. After sending and waiting, it thinks the job never started and reports accordingly (and there's your hidden system timeout). How is this happening? You could investingate security configurations or file access rights, but I'd start by reviewing whatever routine it is that you're starting up -- something about it smells fishy to me.

这篇关于如何设置 SQL Server 2005 作业 CmdExec 超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆