&PH& clean up in IS 8.1

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

&PH& clean up in IS 8.1

Post by I_Server_Whale »

Does cleaning up of &PH& folder in the project still help in version 8.1? How exactly does cleaning up of &PH& help? I'm sorry if this is a repeat question. Search didn't help.

Appreciate your inputs!

Regards,
I_Server_Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

# Cleanup PH Directories

PH_PURGE_DAYS=-7
if [[ $(date +%I) -eq 9 ]];
then
find /d/Projects/*/'&PH&' -type f -mtime +$PH_PURGE_DAYS -exec rm -f {} \;
fi
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Well, I wish I would have known about that &PH& before doing the 8.1.2 Foundation Tools rollup patch. The patch process scans every single filename in each subdirectory in your projects path. ouch.

It's just a good practice to follow as you don't want that space being chewed up for nothing. We tend to clean it up during any product outage (patching) when we know there are no users and jobs on the system.

A safer way to do it would be to see if that project is currently active, if not create a new subdirectory (with the correct file permissions) and then quickly swap it with the &PH& one.

mkdir PH;
chmod ### PH;
mv "&PH&" PH.bak;
mv PH "&PH&";
rm -rf PH.bak;


Something like that...

Cheers.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, cleaning &PH& still helps in version 8.1 and 8.5. Job processes redirect stdout and stderr into a file in &PH&. (Some other files, like admin captures and stage trace files, are also captured into &PH&.)
When a job starts it has to scan past all the entries in &PH& in order to emplace its own file. So the fewer entries there are in &PH&, the less time the starting job has to spend finding it's file's slot in the directory. On operating systems that use hashed directories the effect is not so marked, but it's still beneficial not to keep the unneeded entries.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Ya, it would have been nice if they included an environment variable to have an auto purge of those files based on X amount of days of age.

Saves us all from writing CRON jobs to do it.
Post Reply