码迷,mamicode.com
首页 > 其他好文 > 详细

使用Event Message 对 Package 进行Troubleshoot

时间:2016-08-19 22:04:26      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:

发现一个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.

参考文档:

sp_stop_job (Transact-SQL)

 

使用Event Message 对 Package 进行Troubleshoot

标签:

原文地址:http://www.cnblogs.com/ljhdo/p/5788798.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!