in case anyone is after the code to do this, have a little read of this.
In the Audit database, AUDIT_DETAIL and AUDIT_EVENT are the growing tables. All other tables stay static. You can purge these two tables based on the timestamp of records. I would also recommend you have a complete backup of the Auditing database before doing this.
There are no recommended strategies for purging the Audit database.
Customer Assurance does not support any purging of data from either the
CMS or Audit Databases.
There are six tables used by Auditor:
- APPLICATION_TYPE (initialized w/ 13 rows, does not “grow”)
- AUDIT_DETAIL (tracks activity at a granular level, grows)
- AUDIT_EVENT (tracks activity at a granular level, grows)
- DETAIL_TYPE (initialized w/ 28 rows, does not “grow”)
- EVENT_TYPE (initialized w/ 41 rows, does not “grow”)
- SERVER_PROCESS (initialized w/ 11 rows, does not “grow”)
If you simply want to remove all audit data and start over, then truncate AUDIT_EVENT and AUDIT_DETAIL.
If you want to only remove rows based on a period, then consider that the two tables, AUDIT_DETAIL and AUDIT_EVENT, are transactional in nature, however, AUDIT_DETAIL is a child to the parent table AUDIT_EVENT, thus
you will want to remove rows from AUDIT_DETAIL based on its link to AUDIT_EVENT before removing rows from AUDIT_EVENT first. Otherwise, rows in
AUDIT_DETAIL will get “orphaned” and never be of any use to you, and worse, you will not readily know how to ever delete these rows again.
Here are the SQL statements:
Code:
delete from AUDIT_DETAIL
where event_id =(select Event_ID from AUDIT_EVENT
where Start_Timestamp between ‘1/1/2006’ and ‘12/31/2006’)
go
delete from AUDIT_EVENT
where Start_Timestamp between ‘1/1/2006’ and ‘12/31/2006’
go
One word of caution is to down your BOE application before doing this maintenance work, otherwise there is a possibility that Auditor will be busy trying to bring new rows to your database while you’re busy deleting
rows and you might encounter an unwanted table lock, either on the work
you’re doing or the work that BOE is trying to perform.
Note: Please take back up of your Audit database before performing any activity.
I’m told that an enhancement is on the cards, but no date yet
Xavier
(BOB member since 2006-12-18)