Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Audit table purge logic

 
Rahul Ba
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have task for Purging the data from database. This data is from Audit table, hence it does not have any relationship with the other tables. There are around 40 audit tables and it has timestamp. I want to derive best strategy to purge the data. I have idea as below, please let me know your opinion.

My Strategy:
1. I will write a Store procedure which will delete data from all 40 tables which are more than 1 months old.
2. I will write a java program to call SP and inturn Java program will be called by scheduler.
3. The Schedule will trigger at 15 of each month.

What is your opinion on the same, is my steps can be improved in tuns of performance.

Thank you !
 
Heena Agarwal
Ranch Hand
Posts: 262
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have 40 audit tables. Purging audit data may take a considerable amount of time. So you might want to have more than a single job that can run in parallel.

Is 15th of every month also the time when the database is not going to be very busy? That might also be a thing to consider.
 
Rahul Ba
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Heena, It make sense !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic