Windows任务调度程序有时不执行批处理文件 [英] Batch file is not executing sometime by windows task scheduler

查看:141
本文介绍了Windows任务调度程序有时不执行批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.bat文件,它负责执行SQL Server数据库备份,并且每天凌晨3点1分由Windows任务计划程序运行。过去7天它完全没问题,但今天它失败了。我从事件日志中获取以下信息。



它是Windows 2008 Server。它早在很久以前就开发了,现在我被分配给它进行故障排除。如何在不重新启动的情况下修复它。任何评论或想法都非常感谢!



日志名称:应用程序来源:Microsoft-Windows-IIS-W3SVC-PerfCounters日期:2016年10月6日3:01: 18 AM事件ID:2001任务类别:无级别:错误关键词:经典用户:N / A计算机:somename.example.com说明:刷新W3SVC计数器花了太长时间,而是使用过时的计数器。 br $>


日志名称:应用程序源:Microsoft-Windows-IIS-W3SVC-PerfCounters日期:10/6/2016 3:01:50 AM事件ID:2003任务类别:无级别:错误关键字:经典用户:不适用计算机:somename.example.com说明:刷新W3SVC计数器花了太长时间,而是使用过时的计数器。这是过去12:00:00(小时,分钟,秒)内的第二条消息。在时间限制到期之前,不会记录这个



客户端会话的陈旧计数器消息。有关此消息的其他信息,请访问位于以下位置的Microsoft在线支持网站:http://go.microsoft.com/fwlink?linkid = 538。



种类此致,

Shafik



我的尝试:



我查了



Evet ID:2001告诉系统错误,我无事可做:o



事件ID:2003,建议我重新启动W3SVC这是不可能的,因为那是在生产服务器中,我没有停机时间。

解决方案

< blockquote>您的错误与您的服务器上的批处理文件无关。



https://technet.microsoft.com/en-us/library/cc735059%28v=ws.10%29.aspx [< a href =https://technet.microsoft.com/en-us/library/cc735059%28v=ws.10%29.aspx\"target =_ blanktitle =New Window> ^ ]



如果你在文档上它甚至说


Quote:

事件日志消息是有关性能计数器状态的信息。该问题将由系统纠正;您不必采取任何行动。





该错误消息通常是由于您的服务器最大限度地利用了资源。所以似乎正在发生的事情是您的批处理脚本在服务器负载的同时运行。当服务器的速度变慢时,通常是它能够解决这个问题。



我看到你有以下选择



1)在您可以负担得起停机时间重新启动服务

2)不要重新启动服务并重新考虑批处理脚本是什么执行/何时运行并在不同的时间/以不同的介质/语言运行它。

3)增加服务器可用的资源以防止发生此错误。这还可能包括负载平衡您的服务器以适应额外的负载。



有一点需要注意,重新启动w3svc进程可能无法永久修复您的问题...它是可能只会在以后的路上推迟发生。这里真正的解决方法是评估您的硬件,查看服务器上的资源占用情况并从那里开始。


I have one .bat file which is responsible to take SQL Server database Backup and that is running by Windows Task Scheduler at 3.01 AM daily. Last 7 days it worked perfectly okay but today it failed. I got below information from Event Log.

It is Windows 2008 Server. It developed long back ago, now I am assigned to troubleshoot it. How can I fix it without restarting anything. Any comments or Idea is highly appreciated!

Log Name: Application Source: Microsoft-Windows-IIS-W3SVC-PerfCounters Date: 10/6/2016 3:01:18 AM Event ID: 2001 Task Category: None Level: Error Keywords: Classic User: N/A Computer: somename.example.com Description: It has taken too long to refresh the W3SVC counters, the stale counters are being used instead.

Log Name: Application Source: Microsoft-Windows-IIS-W3SVC-PerfCounters Date: 10/6/2016 3:01:50 AM Event ID: 2003 Task Category: None Level: Error Keywords: Classic User: N/A Computer: somename.example.com Description: It has taken too long to refresh the W3SVC counters, the stale counters are being used instead. This is the second message within the past 12:00:00 (hours, minutes, seconds). No more stale counter messages will be logged for this

client session until the time limit expires. For additional information specific to this message please visit the Microsoft Online Support site located at: http://go.microsoft.com/fwlink?linkid=538.

Kind Regards,
Shafik

What I have tried:

I checked

Evet ID: 2001 which is telling system error, I have nothing to do :o

Event ID : 2003 which is suggesting me to restart W3SVC which is not possible because that is in Production Server and I don't have downtime.

解决方案

Your error isn't with your batch file it is with your server.

https://technet.microsoft.com/en-us/library/cc735059%28v=ws.10%29.aspx[^]

If you look at the documentation it even says

Quote:

The event log message is informational regarding performance counter status. The issue will be corrected by the system; you do not have to take any action.



That error message is usually due to your server maxing out on resources. So what appears to be happening is that your batch script is running at the same time your server is under load. When things slow down for your server, it is usually when it is able to resolve this issue.

As I see it you have the following options

1) Restart the service at a time where you can afford down time
2) Don't restart the service and re-think what your batch script is doing/when it is running and run it at a different time/in a different medium/language.
3) Increase available resources that your server has in order to prevent this error from happening. This could also include load balancing your server to accommodate extra load.

One thing to note though, restarting the w3svc process may not permanently fix your problem...it is probably only going to put off only to happen again later on down the road. The true fix here is to evaluate your hardware, see what is hogging up resources on your server and go from there.


这篇关于Windows任务调度程序有时不执行批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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