本文可帮助你修复以下问题:审核收集服务 (ACS) 报表在 System Center Operations Manager 中返回的数据不超过 42 天。
原始产品版本: Microsoft System Center 2012 Operations Manager、System Center 2012 R2 Operations Manager
原始 KB 数: 2663919
现象
使用 System Center Operations Manager 时,审核数据库数据保留期设置为 100 天,但 ACS 报告返回的数据不超过 42 天。
原因
ACS 收集器服务用于 DbCreatePartition.sql
创建分区表,并使用 DbDeletePartition.sql
(C:\Windows\System32\Security\AdtServer
在收集器服务器上)基于保留期删除分区表。 它还创建视图 AdtServer.dvall
, AdtServer.dvall5
以及 AdtServer.dvheader
。 DbDeletePartition.sql
其中DbCreatePartition.sql
,dvall、dvall5 和 dvheader 视图仅使用前 42 个分区表的联合。
解决方法
若要解决此问题,请完成以下步骤:
首先根据要求创建 ACS 数据保留期。 若要更新数据保留期,请运行以下 SQL 查询:
USE OperationsManagerAC UPDATE dtConfig SET Value = <number of days to retain data + 1> WHERE Id = 6
例如,若要保留 7 天的数据,请将 Value = 8。 每个工作站每天累积大约 7.6 MB 的数据。
注意
Microsoft SQL Server 2005 有一个限制,它只允许视图中的 255 个分区表。 不要设置大于 255 的值。 值越高,提取报表中的数据所需的时间就越长,因此性能可能会受到影响。
在收集器服务器上,导航到
C:\Windows\System32\Security\AdtServer
。 在DbCreatePartition.sql
记事本中编辑存储过程。 通过将第五行AdtServer.dvall
AdtServer.dvall5
中的 42 天替换为 100(或按要求),如下所示AdtServer.dvheader
:/************************************************* * * Create or update dvAll, the view across all partition views * **************************************************/ declare @iIsFirst int declare @vchStmt nvarchar(max) declare @vchPartitionId nchar(36) declare cPartition cursor for select top 42 PartitionId from dtPartition order by PartitionCloseTime desc /*************************************************** * * Create or update dvAll5, the view across all partition views limited to the first 5 strings * ****************************************************/ declare @iIsFirst int declare @vchStmt nvarchar(max) declare @vchPartitionId nchar(36) declare cPartition cursor for select top 42 PartitionId from dtPartition order by PartitionCloseTime desc /**************************************************** * * Create or update dvHeader, the view across all partition views with no dtstring joins * *****************************************************/ declare @iIsFirst int declare @vchStmt nvarchar(max) declare @vchPartitionId nchar(36) declare cPartition cursor for select top 42 PartitionId from dtPartition order by PartitionCloseTime desc
在收集器服务器上,导航到
C:\Windows\System32\Security\AdtServer
。 在DbDeletePartition.sql
记事本中编辑存储过程。 通过将第五行AdtServer.dvall
AdtServer.dvall5
AdtServer.dvheader
中的 42 天替换为 100(或按要求),如下所示:/***************************************************** * * Create or update dvAll, the view across all partition views * ******************************************************/ declare @iIsFirst int declare @vchStmt nvarchar(max) declare @vchPartitionId nchar(36) declare cPartition cursor for select top 42 PartitionId from dtPartition order by PartitionCloseTime desc /****************************************************** * * Create or update dvAll5, the view across all partition views limited to the first 5 strings * *******************************************************/ declare @iIsFirst int declare @vchStmt nvarchar(max) declare @vchPartitionId nchar(36) declare cPartition cursor for select top 42 PartitionId from dtPartition order by PartitionCloseTime desc /****************************************************** * * Create or update dvHeader, the view across all partition views with no dtstring joins * *******************************************************/ declare @iIsFirst int declare @vchStmt nvarchar(max) declare @vchPartitionId nchar(36) declare cPartition cursor for select top 42 PartitionId from dtPartition order by PartitionCloseTime desc
在 收集器服务器上重启 Operations Manager 审核收集服务 。