How can we help you today? How can we help you today?
Dan B
Hi jchorlton, Thanks very much for your post in the Redgate forums. I have let the Product Manager know about this post to further its views within Redgate. / comments
Hi jchorlton, Thanks very much for your post in the Redgate forums. I have let the Product Manager know about this post to further its views within Redgate.
0 votes
RofL, Thanks for using the Redgate forums. I have attached a script which might get you some of what you want. You can add a line at the bottom WHERE Cluster_SqlServer_Error_Text LIKE '%objectname%' to filter only the lines containing the object name. The object names are held within the full message so it would require further manipulation to get what you need I think. Let me know if you need any further assistance. USE RedGateMonitor GO WITH CteDeadlockHeads AS (SELECT TOP 100000 IdCollectionDate , Cluster_SqlServer_Error_ProcessInfo , CollectionDate , Cluster_Name , Cluster_SqlServer_Name , Cluster_SqlServer_Error_LogDate FROM [data].[Cluster_SqlServer_Error_Instances_View] WHERE Cluster_SqlServer_Error_Text LIKE 'deadlock-list%' OR Cluster_SqlServer_Error_Text LIKE 'Deadlock encountered%') SELECT b.Id , b.IdCollectionDate , b.Cluster_SqlServer_Error_ProcessInfo , b.Cluster_SqlServer_Error_Text , b.CollectionDate , b.CollectionDate_DateTime , b.Cluster_Name , b.Cluster_SqlServer_Name , b.Cluster_SqlServer_Error_LogDate , b.Cluster_SqlServer_Error_LogDate_DateTime , b.Cluster_SqlServer_Error_SequenceNumber FROM CteDeadlockHeads a INNER JOIN [data].[Cluster_SqlServer_Error_Instances_View] b ON b.Cluster_Name = a.Cluster_Name AND b.Cluster_SqlServer_Error_LogDate = a.Cluster_SqlServer_Error_LogDate AND b.IdCollectionDate = a.IdCollectionDate AND b.Cluster_SqlServer_Error_ProcessInfo = a.Cluster_SqlServer_Error_ProcessInfo / comments
RofL, Thanks for using the Redgate forums. I have attached a script which might get you some of what you want. You can add a line at the bottom WHERE Cluster_SqlServer_Error_Text LIKE '%objectname%...
0 votes
wullsy, I believe what you require can be implemented using the below script. Please try it out and let me know if you need anything further. The uptime is based on SQL Monitor's ability to connect to the monitored entity, and also to collect data. The percentage and downtime measures are based on the times that SQL Monitor was attempting to connect, so the percentages and minutes will be accurate, but only cover the times SQL Monitor was instructed to monitor the server. Eg: You monitor an instance for an hour, and it is online throughout this hour. If you then ask: "What is the uptime for this instance for the last week?", this script will report 100%, with 0 minutes uptime, even if there has been downtime the day before. DECLARE @startDateUtc BIGINT; DECLARE @endDateUtc BIGINT; -- SET THESE THINGS -- SET @startDateUtc = utils.DateTimeToTicks('2014-01-06'); SET @endDateUtc = utils.DateTimeToTicks('2014-01-07'); -- END SET THESE THINGS -- ;WITH CteData AS ( SELECT 'Cluster' [Level] , ROW_NUMBER() OVER (PARTITION BY Id ORDER BY CollectionDate ASC) [row], [Id] , [Cluster_Name] [Cluster Name], '' [Node/SQL Server Instance Name], [Cluster_MonitoredEntityState] [MonitoredEntityState], [Cluster_MonitoringStatusCategory] [MonitoringStatusCategory] , [CollectionDate] FROM [data].[Cluster_StableSamples_View] UNION ALL SELECT 'Node' , ROW_NUMBER() OVER (PARTITION BY Id ORDER BY CollectionDate ASC) [row], Id , Cluster_Name , Cluster_Machine_Name , Cluster_Machine_MonitoredEntityState , Cluster_Machine_MonitoringStatusCategory , CollectionDate FROM [data].[Cluster_Machine_StableSamples_View] WHERE Cluster_Machine_Name <> '' UNION ALL SELECT 'SqlServer' , ROW_NUMBER() OVER (PARTITION BY Id ORDER BY CollectionDate ASC) [row], Id , Cluster_Name , Cluster_SqlServer_Name , Cluster_SqlServer_MonitoredEntityState , Cluster_SqlServer_MonitoringStatusCategory , CollectionDate FROM data.Cluster_SqlServer_StableSamples_View ), CteTicks AS ( SELECT aft.[Id] , aft.[Level] , aft.[Cluster Name] , aft.[Node/SQL Server Instance Name] , CASE WHEN aft.CollectionDate < @startDateUtc THEN 0 WHEN aft.CollectionDate < @endDateUtc AND bef.CollectionDate IS NULL THEN aft.CollectionDate - @startDateUtc WHEN aft.CollectionDate < @endDateUtc AND bef.CollectionDate < @startDateUtc THEN aft.CollectionDate - @startDateUtc WHEN aft.CollectionDate < @endDateUtc THEN aft.CollectionDate - bef.CollectionDate WHEN bef.CollectionDate IS NULL THEN @endDateUtc - @startDateUtc WHEN bef.CollectionDate < @startDateUtc THEN @endDateUtc - @startDateUtc WHEN bef.CollectionDate < @endDateUtc THEN @endDateUtc - bef.CollectionDate ELSE 0 END [ticks], aft.[MonitoredEntityState] , aft.[MonitoringStatusCategory] FROM CteData aft LEFT OUTER JOIN CteData bef ON aft.Id = bef.Id AND aft.row = bef.row + 1 ) SELECT [Level], [Cluster Name], [Node/SQL Server Instance Name] , 100.0 * SUM(CASE WHEN [MonitoringStatusCategory] IS NULL OR [MonitoringStatusCategory] < 300 THEN ticks ELSE 0 END)/SUM(ticks) [% Uptime], 1.0/600000000 * SUM(CASE WHEN [MonitoringStatusCategory] IS NOT NULL AND [MonitoringStatusCategory] >= 300 THEN ticks ELSE 0 END) [Monitored Downtime (minutes)] FROM CteTicks WHERE [MonitoredEntityState] = 3 GROUP BY Id, [Level], [Cluster Name], [Node/SQL Server Instance Name] HAVING SUM(ticks) > 0 ORDER BY [Cluster Name], [Level], [Node/SQL Server Instance Name] / comments
wullsy, I believe what you require can be implemented using the below script. Please try it out and let me know if you need anything further. The uptime is based on SQL Monitor's ability to connect...
0 votes
Hi RVO, I have passed on some troubleshooting steps via email. Please let me know if you don't receive this. / comments
Hi RVO, I have passed on some troubleshooting steps via email. Please let me know if you don't receive this.
0 votes
Hi mlukas, This issue has been resolved since version 3.1.2.765 which was released this week. This can be downloaded from the below link ftp://support.red-gate.com/patches/SQLD ... .2.765.zip / comments
Hi mlukas, This issue has been resolved since version 3.1.2.765 which was released this week. This can be downloaded from the below link ftp://support.red-gate.com/patches/SQLD ... .2.765.zip
0 votes