| Author |
Message |
The Boss Principal Member


Joined: 08 Feb 2008
  Posts: 110 Location: Chennai

|
Posted: Wed Apr 02, 2008 5:57 am Post subject: Cleaning Audit DB |
|
|
Hi, We have a requirement. We are running BOE XI R2.
We want to keep only the last 3 months data in the Audit database. We want to regularly cleanup the data which are more than 3 months old.
Could anybody shed some light on how to acheive this? Your help is much appreciated.
Thanks. |
|
| Back to top |
|
 |
haider Forum Groupie


Joined: 18 Jul 2005
     
 Posts: 8783 Location: Kuwait

|
Posted: Wed Apr 02, 2008 6:05 am Post subject: Re: Cleaning Audit DB |
|
|
Your DBA should be able to help you in this by looking at the tables structure for XIr2 auditing.
There might be a date column in one of the tables on which the data purge can be done.
. _________________ BO 6.x/ BO XIr2/XI 3.1, Oracle 9i/10g//11g, SQL Server, DB2, IIS .Net/Java (Tomcat) |
|
| Back to top |
|
 |
jsanzone Forum Associate


Joined: 12 Sep 2006
   Posts: 936 Location: No. Virginia

|
Posted: Wed Apr 02, 2008 10:47 am Post subject: Re: Cleaning Audit DB |
|
|
The best that I can determine, there is no official documentation from BusinessObjects regarding a method to "trim" the Auditor database. Being that you are on XI R2, then these notes apply in this case. Here is the scoop:
There are six tables used by Auditor:
1) APPLICATION_TYPE (initialized w/ 13 rows, does not "grow")
2) AUDIT_DETAIL (tracks activity at a granular level, grows)
3) AUDIT_EVENT (tracks activity at a granular level, grows)
4) DETAIL_TYPE (initialized w/ 28 rows, does not "grow")
5) EVENT_TYPE (initialized w/ 41 rows, does not "grow")
6) 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.
Good luck! |
|
| Back to top |
|
 |
Nick Daniels Forum Groupie


Joined: 15 Aug 2002
        Posts: 9439 Location: Yorkshire, England

|
Posted: Wed Apr 02, 2008 1:51 pm Post subject: Re: Cleaning Audit DB |
|
|
Is the audit database really taking up that much space? How much is 3 months worth? _________________ Available for contract work from September 2010 |
|
| Back to top |
|
 |
MarkDavisCraig Forum Member


Joined: 15 Feb 2006
    Posts: 21

|
Posted: Wed Sep 24, 2008 12:48 pm Post subject: Re: Cleaning Audit DB |
|
|
| Our Auditing database is getting enormous after 18 months of data have been captured. Has anybody established a regular process to purge old data from their audit tables? We were thinking about creating partitions so that we could still query all the data but only extracted the most recent changes. |
|
| Back to top |
|
 |
bernard timbal Forum Addict


Joined: 26 May 2003
       Posts: 3221 Location: Paris - FRANCE

|
|
| Back to top |
|
 |
jsanzone Forum Associate


Joined: 12 Sep 2006
   Posts: 936 Location: No. Virginia

|
Posted: Tue Oct 14, 2008 7:27 am Post subject: Re: Cleaning Audit DB |
|
|
Bernard,
| Quote: | | I think, it is a "in" instead of a "=" |
Yep, you're right, thank you for noting the needed correction.
Good to go.
John |
|
| Back to top |
|
 |
J029 Forum Member


Joined: 27 Sep 2005
    Posts: 9

|
Posted: Tue Dec 02, 2008 8:15 am Post subject: Re: Cleaning Audit DB |
|
|
I would like to delete some rows (for a time period) from the audit tables but for the BO 6.5 version. Could you please help me? I need the queries...
Thanks!!! |
|
| Back to top |
|
 |
bernard timbal Forum Addict


Joined: 26 May 2003
       Posts: 3221 Location: Paris - FRANCE

|
Posted: Wed Dec 03, 2008 12:38 pm Post subject: Re: Cleaning Audit DB |
|
|
| Code: |
DELETE FROM OBJ_A_EVENT_DETL DT WHERE DT.A_EVDET_N_ID IN (SELECT LG.A_EVLOG_N_ID FROM OBJ_A_EVENT_LOG LG WHERE LG.A_EVLOG_D_STARTIME < ADD_MONTHS(SYSDATE, -15));
DELETE FROM OBJ_A_EVENT_LOG LG WHERE LG.A_EVLOG_D_STARTIME < ADD_MONTHS(SYSDATE, -15);
DELETE FROM OBJ_A_SITE_LOG WHERE OBJ_A_SITE_LOG.A_STLOG_D_LOGTIME < ADD_MONTHS(SYSDATE, -15); |
Here the code we use in production to have a 15 rolling months period regarding the oracle sysdate
Regards _________________ Bernard TIMBAL DUCLAUX de MARTIN
BusinessObjects Platform Certified Consultant
Image link
BOBTI - BusinessObjects articles & tutorials
Co-author of a first book about SAP BusinessObjects XI3x Administration |
|
| Back to top |
|
 |
|