Quantcast
Channel: Randy Riness @ SPSCC aggregator
Viewing all articles
Browse latest Browse all 3015

MSDN Blogs: SCOM 2012 - Large Event.Parameter Table(s)

$
0
0

Last year, an issue with the SCOM DW event grooming was detected which was addressed in SCOM 2012 R2 UR7:

Dependent tables are not groomed (Event.EventParameter_GUID table)

The following issues are fixed:

• In a database, the grooming of certain MT$X$Y tables were missed because of the filtering logic. Therefore, the tables were never groomed. There were scenarios in which lots of unwanted data was stored in these tables. This issue is now fixed, and data is groomed data from these table. This results in performance gains because there is less data from which to query.

• In Data Warehouse, the grooming of certain tables was missed occasionally because current logic expects the rows to be returned in a certain order. This issue is now fixed, and the grooming of these tables will not be missed. In some scenarios, millions of rows were stored in these tables. This issue is now fixed. Data is now groomed from these tables. This results in performance gains because there is less data from which to query.

 

However, this fix simply prevented the issue from continuing but didn't delete any already orphaned data in the EventParameters tables.  If you are seeing large EventParameter table(s), apply UR7+ and read on....

Am I Seeing This?

A query of the DW will identify if you have this issue.  Running the following shows if an MG is affected; if you only get the event and eventdetail tables back you ARE effected.  Healthy MGs will return 4 items (event, eventrule, eventparameter, and eventdetail).

DECLARE
  @MainTableName sysname,
  @TableName sysname,@StandardDatasetAggregationStorageRowId int,
  @DatasetId   uniqueidentifier = (select DatasetId from StandardDataset where SchemaName = 'Event'),
  @AggregationTypeId tinyint = 0,@TableGuid uniqueidentifier

Set @TableGuid = (select TableGuid from StandardDatasetTableMap where DatasetId = @datasetID)
SET @StandardDatasetAggregationStorageRowId = 0

SELECT @MainTableName = BaseTableName + '_' + REPLACE(CAST(@TableGuid AS varchar(50)), '-', '')
  FROM StandardDatasetAggregationStorage
  WHERE (DatasetId = @DatasetId)
    AND (AggregationTypeId = @AggregationTypeId)
    AND (DependentTableInd = 0)

select @MainTableName

WHILE EXISTS (
SELECT * FROM StandardDatasetAggregationStorage
   WHERE (DatasetId = @DatasetId)
     AND (AggregationTypeId = @AggregationTypeId)
     AND (DependentTableInd = 1)
     AND (StandardDatasetAggregationStorageRowId > @StandardDatasetAggregationStorageRowId)
                 )
 BEGIN
   SELECT TOP 1
     @StandardDatasetAggregationStorageRowId = StandardDatasetAggregationStorageRowId,
  @TableName = BaseTableName + '_' + REPLACE(CAST(@TableGuid AS varchar(50)), '-', '')
   FROM StandardDatasetAggregationStorage
   WHERE (DatasetId = @DatasetId)
     AND (AggregationTypeId = @AggregationTypeId)
     AND (DependentTableInd = 1)
     AND (StandardDatasetAggregationStorageRowId > @StandardDatasetAggregationStorageRowId)
 
  select @TableName

END

 

How to Remove the Orphaned Data

If you have applied UR7+ and are still seeing only two entries returned by the query above, you need to clean up the orphaned entries by running the following (Note: this will delete data so ensure you have a good backup first).

 DECLARE @i int
,@MaxRowsToGroom as int
,@RowsDeleted as int
,@CurrentCount as int

SET @MaxRowsToGroom = 100000
SET @CurrentCount = 0
SET @i=0

WHILE(@i<=500)
BEGIN
  EXEC @rowsdeleted = cleanorphanedeventdata @Maxrowstogroom, @RowsDeleted OUTPUT
  SET @i=@i+1
  SET @CurrentCount = @CurrentCount + @RowsDeleted
  Waitfor Delay '00:00:01'
END

SELECT @CurrentCount As 'Number of rows processed'

  

A special thanks to Pete Mancini and Dan Rawlings!


Viewing all articles
Browse latest Browse all 3015

Trending Articles