-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Blake Drumm
committed
Aug 12, 2021
1 parent
5274eb4
commit 0f19c9a
Showing
99 changed files
with
1,560 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
select ManagedEntityTypeSystemName, DiscoverySystemName, count(*) As 'Changes' | ||
from | ||
(select distinct | ||
MP.ManagementPackSystemName, | ||
MET.ManagedEntityTypeSystemName, | ||
PropertySystemName, | ||
D.DiscoverySystemName, D.DiscoveryDefaultName, | ||
MET1.ManagedEntityTypeSystemName As 'TargetTypeSystemName', MET1.ManagedEntityTypeDefaultName 'TargetTypeDefaultName', | ||
ME.Path, ME.Name, | ||
C.OldValue, C.NewValue, C.ChangeDateTime | ||
from dbo.vManagedEntityPropertyChange C | ||
inner join dbo.vManagedEntity ME on ME.ManagedEntityRowId=C.ManagedEntityRowId | ||
inner join dbo.vManagedEntityTypeProperty METP on METP.PropertyGuid=C.PropertyGuid | ||
inner join dbo.vManagedEntityType MET on MET.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId | ||
inner join dbo.vManagementPack MP on MP.ManagementPackRowId=MET.ManagementPackRowId | ||
inner join dbo.vManagementPackVersion MPV on MPV.ManagementPackRowId=MP.ManagementPackRowId | ||
left join dbo.vDiscoveryManagementPackVersion DMP on DMP.ManagementPackVersionRowId=MPV.ManagementPackVersionRowId | ||
AND CAST(DefinitionXml.query('data(/Discovery/DiscoveryTypes/DiscoveryClass/@TypeID)') AS nvarchar(max)) like '%'+MET.ManagedEntityTypeSystemName+'%' | ||
left join dbo.vManagedEntityType MET1 on MET1.ManagedEntityTypeRowId=DMP.TargetManagedEntityTypeRowId | ||
left join dbo.vDiscovery D on D.DiscoveryRowId=DMP.DiscoveryRowId | ||
where ChangeDateTime > dateadd(hh,-24,getutcdate()) | ||
) As #T | ||
group by ManagedEntityTypeSystemName, DiscoverySystemName | ||
order by count(*) DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
select distinct | ||
ME.Path, | ||
ME.Name, | ||
MET.ManagedEntityTypeSystemName, | ||
PropertySystemName, | ||
C.OldValue, | ||
C.NewValue, | ||
C.ChangeDateTime, | ||
MP.ManagementPackSystemName, | ||
D.DiscoverySystemName, | ||
D.DiscoveryDefaultName, | ||
MET1.ManagedEntityTypeSystemName As 'TargetTypeSystemName', | ||
MET1.ManagedEntityTypeDefaultName 'TargetTypeDefaultName' | ||
from dbo.vManagedEntityPropertyChange C | ||
inner join dbo.vManagedEntity ME on ME.ManagedEntityRowId=C.ManagedEntityRowId | ||
inner join dbo.vManagedEntityTypeProperty METP on METP.PropertyGuid=C.PropertyGuid | ||
inner join dbo.vManagedEntityType MET on MET.ManagedEntityTypeRowId=ME.ManagedEntityTypeRowId | ||
inner join dbo.vManagementPack MP on MP.ManagementPackRowId=MET.ManagementPackRowId | ||
inner join dbo.vManagementPackVersion MPV on MPV.ManagementPackRowId=MP.ManagementPackRowId | ||
left join dbo.vDiscoveryManagementPackVersion DMP on DMP.ManagementPackVersionRowId=MPV.ManagementPackVersionRowId | ||
AND CAST(DefinitionXml.query('data(/Discovery/DiscoveryTypes/DiscoveryClass/@TypeID)') AS nvarchar(max)) like '%'+MET.ManagedEntityTypeSystemName+'%' | ||
left join dbo.vManagedEntityType MET1 on MET1.ManagedEntityTypeRowId=DMP.TargetManagedEntityTypeRowId | ||
left join dbo.vDiscovery D on D.DiscoveryRowId=DMP.DiscoveryRowId | ||
where ChangeDateTime > dateadd(hh,-24,getutcdate()) | ||
ORDER BY ChangeDateTime DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SELECT ds.DatasetDefaultName, | ||
sdah.AggregationDateTime, | ||
sdah.AggregationTypeId, | ||
sdah.FirstAggregationStartDateTime, | ||
sdah.FirstAggregationDurationSeconds, | ||
sdah.LastAggregationStartDateTime, | ||
sdah.LastAggregationDurationSeconds, | ||
sdah.DirtyInd, | ||
sdah.DataLastReceivedDateTime, | ||
sdah.AggregationCount | ||
FROM StandardDatasetAggregationHistory sdah | ||
JOIN Dataset ds ON sdah.DatasetId = ds.DatasetId | ||
ORDER BY StandardDatasetAggregationHistoryRowId DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
WITH AggregationInfo AS ( | ||
SELECT | ||
AggregationType = CASE | ||
WHEN AggregationTypeId = 0 THEN 'Raw' | ||
WHEN AggregationTypeId = 20 THEN 'Hourly' | ||
WHEN AggregationTypeId = 30 THEN 'Daily' | ||
ELSE NULL | ||
END | ||
,AggregationTypeId | ||
,MIN(AggregationDateTime) as 'TimeUTC_NextToAggregate' | ||
,COUNT(AggregationDateTime) as 'Count_OutstandingAggregations' | ||
,DatasetId | ||
FROM StandardDatasetAggregationHistory | ||
WHERE LastAggregationDurationSeconds IS NULL | ||
GROUP BY DatasetId, AggregationTypeId | ||
) | ||
SELECT | ||
SDS.SchemaName | ||
,AI.AggregationType | ||
,AI.TimeUTC_NextToAggregate | ||
,Count_OutstandingAggregations | ||
,SDA.MaxDataAgeDays | ||
,SDA.LastGroomingDateTime | ||
,SDS.DebugLevel | ||
,AI.DataSetId | ||
FROM StandardDataSet AS SDS WITH(NOLOCK) | ||
JOIN AggregationInfo AS AI WITH(NOLOCK) ON SDS.DatasetId = AI.DatasetId | ||
JOIN dbo.StandardDatasetAggregation AS SDA WITH(NOLOCK) ON SDA.DatasetId = SDS.DatasetId AND SDA.AggregationTypeID = AI.AggregationTypeID | ||
ORDER BY SchemaName DESC |
Oops, something went wrong.