使用SSRS进行SSIS性能监控

时间:2013-05-13 15:25:18

标签: ssis ssrs-2008 monitoring

我想知道使用SSRS的最慢的包。我不知道在哪个表中我可以找到每个包的持续时间。实际上sysssislog存储了包组件的开始/结束时间,但我不知道如何处理它。你能帮我找到合适的表甚至是sql查询吗?

1 个答案:

答案 0 :(得分:1)

如果您启用了SQL Server日志记录,则dbo.sysssislog将仅存储启动/停止时间。

如果你有,那么我会很懒,并从SSIS Performance Framework中构建的一些查询开始。它们是在2005年构建的,因此您需要将sysdtslog90中的引用更改为sysssislog。此外,如果您正在关注这些查询,您可能希望记录更多刚刚开始/停止的事件,但基本逻辑是合理的。

如果你只是想要简单明了,那么你就可以写一个像这样的查询来开始。

WITH STARTS AS
(
    -- Find the execution ids for all the start events
    SELECT
        S.executionid
    ,   S.starttime
    ,   S.source
    FROM
        dbo.sysssislog AS S
    WHERE
        S.event = 'PackageStart'
)
, STOPS AS
(
    -- Find the execution ids for all the start events
    SELECT
        S.executionid
    ,   S.starttime
    ,   S.source
    FROM
        dbo.sysssislog AS S
    WHERE
        S.event = 'PackageEnd'
)
SELECT
    A.source AS PackageName
,   A.starttime AS StartTime
,   COALESCE(B.starttime, CURRENT_TIMESTAMP) AS PackageEndTime
,   DATEDIFF(mi, a.starttime, COALESCE(B.starttime, CURRENT_TIMESTAMP)) AS PackageDuration_M
FROM
    STARTS A
    -- Lots of reasons there may not be an end time
    LEFT OUTER JOIN
    STOPS B
        ON A.executionid = B.executionid;
相关问题