Calculate occupancy of two stgpools in TSM

combato

ADSM.ORG Member
Joined
Mar 22, 2012
Messages
147
Reaction score
1
Points
0
Location
Sweden
PREDATAR Control23

Hi Pro's

Is it possible to calculate the occupancy from two stgpools in TSM and get the total amount? I Have two stgpools that I want to add and get a result?

SELECT stgpool_name,CAST(FLOAT(SUM(logical_mb))/1024/1024 AS DEC(8,2)) as TB FROM occupancy where stgpool_name='NDMPPOOL' GROUP BY stgpool_name
+
SELECT stgpool_name,CAST(FLOAT(SUM(logical_mb))/1024/1024 AS DEC(8,2)) as TB FROM occupancy where stgpool_name='FILERPOOL' GROUP BY stgpool_name

Regards,

/C
 
PREDATAR Control23

You are so close. Just need to change your where clause to be one pool or the other pool.
SQL:
... where stgpool_name='NDMPPOOL' or stgpool_name='FILERPOOL' GROUP...
 
PREDATAR Control23

Actually, that won't give you a grand total, just how much is in each pool. To get the sum of both pools, you would need:
SQL:
SELECT CAST(FLOAT(SUM(logical_mb))/1024/1024 AS DEC(8,2)) as TB -
FROM occupancy -
WHERE stgpool_name='NDMPPOOL' OR stgpool_name='FILERPOOL'
 
PREDATAR Control23

Actually, that won't give you a grand total, just how much is in each pool. To get the sum of both pools, you would need:
SQL:
SELECT CAST(FLOAT(SUM(logical_mb))/1024/1024 AS DEC(8,2)) as TB -
FROM occupancy -
WHERE stgpool_name='NDMPPOOL' OR stgpool_name='FILERPOOL'

Great!! Thank you @marclant

/C
 
Top