简体   繁体   English

SQL 服务器代理作业崩溃

[英]SQL Server Agent Jobs Crashing

Running a Windows 2003 with SQL Server 2005 on, with around ~85-90 jobs which run once per hour (at different times), generating new sitemaps for each website hosted on the server, along with un-publishing pages.在 SQL Server 2005 上运行 Windows 2003,大约每小时运行一次(在不同时间)约 85-90 个作业,为服务器上托管的每个网站生成新站点地图,以及未发布的页面。

The issue which I'm having with the server is that, the server seems to be running in three stages, the jobs run between 8am - 6pm each day, and the server is restarted around 2-3am every morning.我在服务器上遇到的问题是,服务器似乎分三个阶段运行,作业在每天上午 8 点到下午 6 点之间运行,服务器每天早上 2 点到 3 点左右重新启动。

Once the jobs start in the morning, they will run successfully for around 90 minutes (9.30am), taking around 3-5 seconds to complete the job.一旦作业在早上开始,它们将成功运行大约 90 分钟(上午 9 点 30 分),大约需要 3-5 秒才能完成作业。

After 9.30, the jobs will start correctly, then, get stuck on executing (using 100% CPU). 9.30 之后,作业将正常启动,然后卡在执行中(使用 100% CPU)。

If I manually stop the job, the server goes back to normal, but then the jobs will fail to execute at all, throwing the error below.如果我手动停止作业,服务器会恢复正常,但作业将完全无法执行,并抛出以下错误。 (They were changed to run every 60 minutes, not every 15 a few months ago, but the names were never changed) (他们改为每 60 分钟运行一次,几个月前不是每 15 分钟运行一次,但名称从未更改过)

Step ID     1
Server      [Server Name]
Job Name        Execute Replicate File For [website] web
Step Name       Vbscript for Replicate File  every 15Minutes
Duration        00:00:00
Sql Severity        0
Sql Message ID      0
Operator Emailed        
Operator Net sent       
Operator Paged      
Retries Attempted       0

Message
Executed as user: [Domain]\[User]. The step did not generate any output. 
The step failed.

Information about the script that is running: It is a VBScript有关正在运行的脚本的信息:它是一个 VBScript

Dim IEObj 
Set IEObj=CreateObject("InternetExplorer.Application")
IEObj.Navigate "[weblink]/ReplicateFile.asp"
IEObj.visible=false
do Until IEObj.ReadyState=4
loop
IEObj.quit
Set IEObj=Nothing

@mellamokb - The script is down in the general settings as an ActiveX Script, not a T-SQL one, so I am unable to specify an output file for the errors. @mellamokb - 该脚本在常规设置中作为 ActiveX 脚本而不是 T-SQL 脚本关闭,因此我无法为错误指定 output 文件。

Note: I didn't setup anything on this server or the CMS which it is replicating, and my knowledge of databases is fairly low.注意:我没有在此服务器或它正在复制的 CMS 上设置任何东西,而且我对数据库的了解相当低。

My guess is that the page you are displaying in the browser, [weblink]/ReplicateFile.asp, is erroring out on at least one of sessions.我的猜测是您在浏览器中显示的页面 [weblink]/ReplicateFile.asp 至少在一个会话中出错。

The code代码

do Until IEObj.ReadyState=4
loop

will cause significant CPU usage while it is running.运行时会导致大量的 CPU 使用率。 And, more importantly, if the browser never gets to ReadyState 4, this code will continue to run forever.而且,更重要的是,如果浏览器永远不会进入 ReadyState 4,这段代码将永远运行下去。 Have two of three of these stuck, and you will see 100% CPU usage on your server.如果其中三个中的两个卡住,您将看到服务器上的 CPU 使用率为 100%。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM