ORCHADMIN command - nitty gritty

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
TonyInFrance
Premium Member
Premium Member
Posts: 288
Joined: Tue May 27, 2008 3:42 am
Location: Luxembourg

ORCHADMIN command - nitty gritty

Post by TonyInFrance »

Hi all

By now I've understood why the orchadmin command should be used to delete datasets and why we shouldn't go for the kill with an rm command.

However I have a few follow up questions which I hope someone here can help me out with:

1) Is the orchadmin rm command only for datasets or filesets as well? Any other types other than these 2?
2) Can I use this command to delete datasets from all subdirectories of a certain directory - without removing the actual subdirectories as well?
3) Can I use this command to delete datasets from all subdirectories of a certain directory except a certain one (which I'd ideally filter out) - without removing the actual subdirectories as well?

My problem actually is - I have a LOT of unused datasets in around a 100 subdirectories mostly created by obsolete projects which i need to remove else my new interfaces are not working because of lack of disk space (as shown by a df -k command) and thus I need to free up space.

Thanks

Tony
Tony
BI Consultant - Datastage
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Did your company use naming standards for those datasets? Something like "filename.ds". Then it would be a simple find command which would feed your orchadmin command.
TonyInFrance
Premium Member
Premium Member
Posts: 288
Joined: Tue May 27, 2008 3:42 am
Location: Luxembourg

Post by TonyInFrance »

I think I can safely assume that all datasets end with a .ds and filesets with a .fs.
that said I tried the following:
find . -name \*.ds -type f -exec orchadmin rm -f {} \;

This however didn't seem to work since it went on forever and i thus had to stop it.
Tony
BI Consultant - Datastage
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

put an echo statement to debug instead of orchadmin.

Travel down the directory structure to a small branch with less files to see if the premise works.
cfuller
Premium Member
Premium Member
Posts: 70
Joined: Mon Mar 24, 2003 10:08 pm
Location: Australia

Post by cfuller »

I've used the find command to execute the orchadmin command in the past quite successfully..although all my datasets where in the one directory...but I see no reason why the code you wrote wouldn't work...have you tested it on a small subset to confirm , or as suggested used an echo command to confirm your command??
Regards
Chris Fuller

"Reality is what refuses to go away when you stop believing in it"
TonyInFrance
Premium Member
Premium Member
Posts: 288
Joined: Tue May 27, 2008 3:42 am
Location: Luxembourg

Post by TonyInFrance »

Actually I think there were so many datasets, i panicked something was going wrong when the screen scrolled indefinitely - I thus stopped the command prematurely thinking I was deleting everything...:-o

However with the echo command I managed to list out (in a file) the individual orchadmin commands which seemed to work (I tested a few) - I thus think I'm good.

Thanks one and all.
Tony
BI Consultant - Datastage
Post Reply