Author Topic: Clearing the cache  (Read 2052 times)

Maciej Mieczakowski

  • Jr. Member
  • **
  • Posts: 37
    • View Profile
Clearing the cache
« on: May 31, 2016, 03:59:38 AM »
Hi,

I'd like to check with you if my approach for clearing the cache is a good one in scenario when you want to keep the systemlog information untouched.

We received a big batches of data with wrong segment date for dozens of applications (set for 2050 and later) that we did not noticed . It caused that we have really much separate directories in /arscache dir keeping that data. Due to our policy we will keep that data in Ondemand (TSM), but I want to get rid of it from cache. I know I could run arsmaint -c for certain applications with future date (param -t )but it takes really long to process every single application this way.

What I was thinking is to start with cache from scratch, but I'd also like to keep systemlog's daily log for last 2 years untouched. To do this I want to copy all links from /arscache/retr/SL and all data they points to. Copy it to another destination, and remove all data in /arscache dir. After all I would recover retr for SL and data for those links as well.

Is that a good approach or is there a better way to do this? Did I missed anything?

I'm looking for your comments  ;)

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2231
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Clearing the cache
« Reply #1 on: May 31, 2016, 06:25:00 AM »
Get the list of AGIDs that had the bad data:

Code: [Select]
db2 -x "select agid_name from arsag where name in ('AppGroup1','AppGroup2') >ListOfAGs.txt

Alternately, go into /arscache/cache1/retr and do this to clear out EVERYTHING, except the System Log:

Code: [Select]
ls -1 ??? >ListOfAGs.txt  That's Ell, Ess, Space, Dash, One, Space, Question, Question, Question, just for clarity's sake.

Once you have your list:

Code: [Select]
for i in `cat ListOfAGs.txt`
do
  rm -r /arscache/cache1/*/$i
  rm -r /arscache/cache2/*/$i
  # And so on...
done


That'll clear out (anything that has the bad data/everything), one AG at a time.

You use this code at your own risk!

IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

Maciej Mieczakowski

  • Jr. Member
  • **
  • Posts: 37
    • View Profile
Re: Clearing the cache
« Reply #2 on: June 01, 2016, 10:08:55 PM »
Thanks!  ;)
I know how to do this, I just wanted to make sure my approach is correct. Thanks for your explanation JBNC :)