2013-05-13 91 views
0

我想知道使用SSRS的最慢的軟件包。我不知道在哪個表格中我可以找到每個包裹的持續時間。其實sysssislog存儲包組件的開始/結束時間,但我不知道如何處理它。你能幫我找到合適的表,甚至是sql查詢嗎?使用SSRS的SSIS性能監控

回答

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; 
+0

thanx很多!你像往常一樣幫助我解決問題 – unknown 2013-05-14 10:46:26