Tsm server v5.1.6.2 on solaris 2.8.  Have a magstar 3494 with approximately
1500 slots.
I would like to be able to count how many tapes we are using in onsite
pools, offsite pools, db backups, and scratches.

Got the on and offsite count easily enough.  I also have a script for
counting scratches.
Is there a way in SQL to save the output of selects, then some them to reach
a final value?

>> Only via arithmetic in the SQL, if you are running a straight TSM script
and not a host script.

This works for me; you will have to doctor it a little to match your own
class names:

select -
    count(distinct a.volume_name) + count(distinct b.volume_name) +
count(distinct c.volume_name) -
    as "Tapes in Use "  -
    from volumes a, libvolumes b , volhistory c -
    where a.devclass_name <> 'DISK' and -
    b.status='Scratch' and -
    c.type in ('BACKUPFULL','DBSNAPSHOT','BACKUPINCR','EXPORT') and -
    c.devclass = 'LTOTAPE'

Wanda Prather
Johns Hopkins University Applied Physics Laboratory
443-778-8769

"Intelligence has much less practical application than you'd think" -
Dilbert/Scott Adams

Reply via email to