Applies to Symantec Management Platform 7.0.x
You can use a manual process to purge the unwanted data. The query shown below purges data from the Inv_Audit table. You can modify this query to suit your requirements, and then run it against the database to remove the appropriate data.
The example below removes all records that are older than a specified number of days (the current setting is 10 days). You can also modify this query to remove records based on resource type, or on the user ID of the user running the query.
-- Identify the resources which are going to have some data purged.
select distinct _ResourceGuid
into #resources
from Inv_Audit
where DateDiff(d, Inv_Audit.AuditDate, GETDATE()) > 10
declare @DataClassGuid uniqueidentifier
set @DataClassGuid = '57beb323-f925-4689-872f-1bf3aa3f7632'
declare @Guid uniqueidentifier
declare cur_Guid CURSOR FOR
select _ResourceGuid from #resources
-- Purge old data.
delete from Inv_Audit
where DateDiff(d, Inv_Audit.AuditDate, GETDATE()) > 10
and Inv_Audit._ResourceGuid in (select r._ResourceGuid from #resources r)
if(@@error = 0 AND @@rowcount > 0)
begin
-- Ensure resource update summary and history are correct after the fact.
open cur_Guid
fetch next from cur_Guid into @Guid
while @@FETCH_STATUS = 0
begin
exec spResourceUpdateSummary @Guid, null, @DataClassGuid
exec spResourceGenerateHistorySnapshot @Guid, @DataClassGuid
fetch next from cur_Guid into @Guid
end
close cur_Guid
deallocate cur_Guid
end
drop table #resources
Purging data by age
The above query is set up to purge data that is older than 10 days old from the Inv_Audit table. If you want to specify a different number of days, change both instances of the number 10 to the appropriate number.
Purging data by resource type
If you want to purge data based on its resource type, replace both DateDiff(d, Inv_Audit.AuditDate, GETDATE()) > 10 expressions with the following:
Inv_Audit._ResourceGuid in (select Guid from ItemResourceType where ResourceType = ’<resourceTypeGuidGoesHere>’)
Purging data by user ID
If you want to purge data based on the user who is performing the action (for example, to remove all entries where the user is the service account), replace both DateDiff(d, Inv_Audit.AuditDate, GETDATE()) > 10 expressions with the following:
Inv_Audit.UserId = ’<UserNameGoesHere>’
Applies to Symantec Management Platform 7.1.x
The Symantec Management Platform 7.1 Sp1 and above (includes 7.5) includes a purge for the Inv_Audit table.
Stop the "Altiris Support Service"
Stop Altiris Server service and make a backup before modifying this file.
On SMP 7.1.x, edit the C:\ProgramData\Symantec\SMP\Settings\CoreSettings.config file.
Search for the value in coreSettings.config called AuditPurgeMaxAge which is -1 at the moment . In order to enable this functionality, a positive value LIKE 15 (number of days) should be assigned to the parameter.
After editing,
Start the "Altiris Service"
Start the "Altiris Client Message Dispatcher"
Start the "Altiris File Receiver"
Start the "Altiris Support Service"
By default this functionality is disabled. In order to make it enabled, there is a value in coreSettings.config called AuditPurgeMaxAge which is -1 at the moment . In order to enable this functionality, a positive value like 15 (number of days) should be assigned to the parameter. This value is the Number of days used to delete records which have AuditDate less than or equal to current date minus maxAge.
Once the NS.Daily schedule runs, the old records in the Inv_Audit table will be purged.
Applies To
SMP 7.0 MR4
SMP 7.1
SMP 7.5
Thanks for your feedback. Let us know if you have additional comments below. (requires login)