ADSM-L

Re: [ADSM-L] Help with tsm script

2011-06-07 11:36:40
Subject: Re: [ADSM-L] Help with tsm script
From: "Schneider, Jim" <jschneider AT USSCO DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 7 Jun 2011 10:30:37 -0500
I have a script that lists reclaimable space by volume for a given
storage pool.  I've added line numbers so I can see how many tapes would
be reclaimed at a given percentage.  It runs on Unix from a command
prompt.

===================================================================
#!/usr/bin/ksh
#
# This script checks reclaimable space in a tape storage pool
# The list is displayed with line numbers and is sorted by
# reclaimable space in descending order.


# Check that a parameter is passed
if [[ $# != 1 ]]
then
   echo Usage: cr \<storage_pool_name\>
   exit 4
fi

dsmadmc -id=<user id> -pass=<password> -displ=list "q vol stg=$1 f=d" |
grep Reclaimable | sort -n -r -k 4 > $1.usage
cat -n $1.usage | more
rm $1.usage
===================================================================
Sample output:
ch2uptsm1 $ ./cr ch2win_offsite
     1          Pct. Reclaimable Space: 99.3
     2          Pct. Reclaimable Space: 98.7
     3          Pct. Reclaimable Space: 98.1
     4          Pct. Reclaimable Space: 97.9
     5          Pct. Reclaimable Space: 97.5
     6          Pct. Reclaimable Space: 97.4
     7          Pct. Reclaimable Space: 96.8
     8          Pct. Reclaimable Space: 93.1
     9          Pct. Reclaimable Space: 88.9
    10          Pct. Reclaimable Space: 87.8
    11          Pct. Reclaimable Space: 86.9
    12          Pct. Reclaimable Space: 86.3
    13          Pct. Reclaimable Space: 86.0
    14          Pct. Reclaimable Space: 84.6
    15          Pct. Reclaimable Space: 83.9
    16          Pct. Reclaimable Space: 80.9
    17          Pct. Reclaimable Space: 79.0
    18          Pct. Reclaimable Space: 77.9
    19          Pct. Reclaimable Space: 77.1
    20          Pct. Reclaimable Space: 76.0

Hope this helps,
Jim Schneider

-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT vm.marist DOT edu] On Behalf Of
Lee, Gary D.
Sent: Tuesday, June 07, 2011 9:24 AM
To: ADSM-L AT vm.marist DOT edu
Subject: [ADSM-L] Help with tsm script

I have a script which under tsm 5.5.4 server gives a report of

The storage pool name, count ov reclaimable volumes, and reclaimable
space for the specified percentage.
You execute as follows:

Run reclaim-check 55

Under tsm 6.2.2, I get an arithmetic exception sqlstate 22003.
I don't see the problem.

Script follows:

 SELECT distinct stgpool_name as "Pool", - 
    count(volume_name) as "No. Volumes", - 
    cast(sum(cast((est_capacity_mb / 1024 *  - 
    (pct_utilized / 100)) - 
    as decimal(9,3))) as decimal(9,3)) - 
    as "GB Reclaimable" - 
 FROM   volumes - 
 WHERE  pct_reclaim>$1 - 
 GROUP BY stgpool_name 


Any ideas?
The error message gives no help as to what part of the expression gives
the exception.
Thanks for any help you can give.


Gary Lee
Senior System Programmer
Ball State University
phone: 765-285-1310

 

<Prev in Thread] Current Thread [Next in Thread>