I figured out what I screwed up. Here's the actual cmd in a ksh script:
# get list of stgpools with count of reclaimable volumes /tsmdata/tsm_scripts/run_cmd_allservers.ksh " \ select stgpool_name, \ count(*) \ from volumes \ where pct_reclaim \> 64 \ and stgpool_name like '%TAPE%' \ group by stgpool_name " \ | sort -k2,2rn \ > $tmpfile1 Note the ' \> 64 '. But our reclamation threshold is 65. Why did I do >64???? Because I couldn't get ' >= 65' through the shell. I tried \>\= and \>=, but neither worked. So I punted and used ' \> 64'. BUT THE CONSEQUENCE of this was that it picked up fractions like 64.3 which the "reclaim stgpool . . . threshold=65" would not see, and there were a lot of those. I finally got the ksh to work. This works - you don't need to escape at all: ' >= 65'!!! Yup, if the equal sign is right after the gt sign then you don't need to escape the gt sign. Thanks! Rick From: Rhodes, Richard L. Sent: Tuesday, April 15, 2014 10:00 AM To: adsm-l mailing list (ADSM-L@VM.MARIST.EDU) Subject: reclaimable tapes in a stgpool Is there a way to determine the number of tapes in a stgpool that are eligible for reclamation? I tried the following sql on all our TSM instances: select stgpool_name, \ count(*) \ from volumes \ where pct_reclaim \> 64 \ and devclass_name like '%TAPE%' \ group by stgpool_name " It returned a list, but when I went and ran "reclaim stgpool <name> threshold=65" many of the pools returned that there were no volumes to be reclaimed. I think I need more qualifiers on the select. We currently have reclamation running automatically with a reclaim pct of 65% on the stgpool. I'm trying to move to manually running reclamation during a window. I don't want to just issue reclaim stgpool cmds all at once for all instances to prevent a tape drive storm. I want to start them gradually, with the stgpools with the most tapes to be reclaimed starting first. Thanks Rick ----------------------------------------- The information contained in this message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately, and delete the original message.