标签:
发现一个Package Job运行异常,该Package从开始执行到结束,一直处于僵死状态。从 Job Activity Monitor中看到该Job一直处于运行状态,但是,DW中没有执行任何Query 操作。从Operation的Event Message看到 :Package_Path 是 \Package.EventHandlers[OnPreValidate]\Stop running Jobs
事件处理程序 OnPreValidate 的官方定义是:
OnPreValidate:The event handler for the OnPreValidate event. This event is raised by an executable when its validation starts.
正常运行的Package,其Package_Path 表示的是 Package 中 Executable的路径,而该Package在开始运行时就进入到EventHandlers中去执行OnPreValidate 事件处理程序,莫非在Event Handlers中定义了OnPreValidate 事件处理程序,打开SSIS Project,查看相应的Package,真的存在。
在Stop running jobs 这个Task中,调用 dbo.sp_stop_job 指示SQL Server Agent停掉某些Job。
Appendix:
引用《sp_stop_job》
Instructs SQL Server Agent to stop the execution of a job.
sp_stop_job [@job_name =] ‘job_name‘ | [@job_id =] job_id | [@originating_server =] ‘master_server‘ | [@server_name =] ‘target_server‘
When SQL Server Agent receives the stop notification, it waits for the job step that is currently running to finish before it processes the cancel request. Some long-running Transact-SQL statements such as BACKUP, RESTORE, and some DBCC commands can take a long time to finish. When these are running, it may take a while before the job is canceled. Stopping a job causes a "Job Canceled" entry to be recorded in the job history.
参考文档:
使用Event Message 对 Package 进行Troubleshoot
标签:
原文地址:http://www.cnblogs.com/ljhdo/p/5788798.html