How can I get a count of all data points over n days old in the AppManager Repository? (NETIQKB54637)

  • 7754637
  • 02-Feb-2007
  • 27-Jan-2011

Environment

NetIQ AppManager 6.x
NetIQ AppManager 7.0.x

Situation

How can I get a count of all data points over X days old in the AppManager Repository?

Resolution

Use the following SQL statement in SQL Query Analyzer to collect a raw count of data points that are older than a specified number of days.  The default is 8, but to increase the increment change the assigned value for @Days in the statement below. 

--the following statement will report on the ArchiveData table

declare @Days int
Select @Days = 8
select count(*) from ArchiveData where time < (datediff(s,'1/1/1970',GETUTCDATE())-(@Days*86400))

-- the following statement will report on the Data table:

declare @Days int
Select @Days = 8
select count(*) from Data where time < (datediff(s,'1/1/1970',GETUTCDATE())-(@Days*86400))

Additional Information

Formerly known as NETIQKB54637

These query statements are helpful in troubleshooting problems with the PurgeData SQL job, which maintains the number of rows in the Data table, and the Aggregation of the ArchiveData table.