Technical Article

SSRS Execution Log Queries

,

We recently had an issue relating to SSRS and in particular a bottleneck around a period of the day and we had to debug what was going on, not really know more than I needed to for SSRS at the time I was able to find an article online which gave information out about execution log views which are stored in the ReportServer database (dbo.ExecutionLog & dbo.ExecutionLog2) on any given SSRS installation. After having a brief play around with these views I was able to manipulate the data down to a time frame and then identify a certain user who was running 1000 reports in an hour at a given point in the day, impressive!

Once this was identified I created a few Reports of my own on the Reports fired which were aimed at giving our team a bit more insight into what goes on on our SSRS box during the day as summarised below.

"Q1 What's been run today which isn't Successful? " - Found this quite handy for narrowing down failures of reports to a certain time period, ours was around lunch oddly enough however more investigation showed heavy load on the SAN around that period caused latency to affect the execution of reports.

"Q2 What User has been running a fair few reports today?" - Knocked this together quickly to highlight heavy executions of reports by users for a day.

"Q3 What report has been executed the most today?" - Very similar to the previous query however this just points out the reports which have been used the most, in our environment we have once which is opened each time a client’s screen is loaded so usually hits 13-15K per day!

Hope it's been useful,

Rik

/* Assume you're using a standard setup: ReportServer*/
USE ReportServer
GO
/* Q1
What's been run today which isn't Succesful?
*/
SELECT    C.Path AS ReportPath
        ,C.Name AS ReportName
        ,A.Status
        ,A.UserName
        ,A.Parameters
        ,A.TimeStart
        ,A.TimeEnd
        ,A.TimeDataRetrieval
        ,A.TimeProcessing
        ,A.ByteCount
        ,A.[RowCount]
FROM    dbo.ExecutionLog AS A WITH(NOLOCK) 
        INNER JOIN dbo.Catalog AS C WITH(NOLOCK) 
ON        A.ReportID = C.ItemID
WHERE    CAST(TimeStart AS DATE) = CAST(GETDATE() AS DATE)
        AND [Status] NOT IN ('rsSuccess')

/* Q2
What User has been running a fair few reports today?
*/
SELECT    UserName
        ,COUNT(*) AS FullSum
FROM    dbo.ExecutionLog AS A WITH(NOLOCK) 
        INNER JOIN dbo.Catalog AS C WITH(NOLOCK) 
ON        A.ReportID = C.ItemID
WHERE    CAST(TimeStart AS DATE) = CAST(GETDATE() AS DATE)
GROUP BY
    UserName
ORDER BY 2 DESC

/* Q3
What report has been executed the most today?
*/
SELECT    C.Path+'/'+C.Name AS Path
        ,COUNT(*) AS FullSum
FROM    dbo.ExecutionLog AS A WITH(NOLOCK) 
        INNER JOIN dbo.Catalog AS C WITH(NOLOCK) 
ON        A.ReportID = C.ItemID
WHERE    CAST(TimeStart AS DATE) = CAST(GETDATE() AS DATE)
GROUP BY
    C.Path+'/'+C.Name
ORDER BY 2 DESC

Rate

3 (4)

You rated this post out of 5. Change rating

Share

Share

Rate

3 (4)

You rated this post out of 5. Change rating