SQL Server 计划作业 - 表示其运行没有错误,但什么也不做
我有一个 SQL Server 计划作业,每天晚上都会运行大约 6 个月。
然而,它已经停止做它应该做的事情(将数据从一个数据库传输到下一个数据库)。没有错误,当我手动运行它时,一切都很好。
我很难理解为什么它会手动运行而不是按计划运行。
有什么想法吗?
I have a SQL Server scheduled job which has been running for about 6 months every night.
However, it has stopped doing what it should (transfering data from one database to the next). There are no errors and when I run it manually it is fine.
I'm struggling to see why it would run manually and not on a schedule.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
检查日志是否有错误。可能是运行作业的用户没有对一个或两个数据库的权限(老用户在退出公司后被删除了他的权利??)
尝试将自己作为作业所有者,因为它正在运行你手动运行它
Check the log for errors. It might be the user under which the job runs does not have rights to one or both of the database (old user that got his right removed after he quittes your company??)
Try to put yourself as the job owner since it is running when you run it manually
最近服务器重启了吗?它可能是在手动启动模式下运行的 SQL Server 代理服务。您尝试过重新启动吗?
Recently got server restarted? It may be SQL Server Agent service running in Manual Startup Mode. Have you tried to restart?
作业是否正在运行但未执行任何操作,或者在计划时间内未能运行?如果 SQL 代理作业历史记录未记录任何错误,请检查 SQL Server 错误日志中是否有可疑条目。此外,对于后者,不仅要验证作业是否已启用,还要验证具体的计划。
Is the job running and not doing anything or is it failing to run during the scheduled time? If the SQL Agent job history isn't logging any errors, check the SQL Server error log for suspicious entries. Additionally, in the case of the latter, verify not only that the job is enabled, but also the specific schedule.
其他人(前三篇文章)所说的。如果您仍然无法弄清楚,请启动 SQL Profiler 并在作业(应该是)运行时运行它,以查看数据库服务器接收到哪些查询或登录(如果有)。
What everyone else (three preceding posts) said. If you still can't figure things out, fire up SQL Profiler and have it running while the job is (supposed to be) running to see what, if any, queries or logins are received by the database server.
我假设这是工作所有者/权限问题,因为我也遇到了同样的问题。发生这种情况时是否有任何原因不会给您警告或错误?我错过了什么吗?是否有一个设置可以更改以允许 sql server 报告此类错误?
I'm assuming this was a job owner/permissions issue, as I just had the same problem. Is there any reason why this won't give you a warning or error when this happens? Am I missing something? Is there a setting that you can change to allow sql server to report errors for things like this?