ADSM-L

Storage Pool Occupancy for each node report

2004-06-21 05:58:33
Subject: Storage Pool Occupancy for each node report
From: Benhayoune Khalid <Benhayoune AT CIH.CO DOT MA>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Mon, 21 Jun 2004 10:05:37 -0000
Hi all,

I'm new in TSM SQL and I have a problem with the following statement :

select  stgpools.stgpool_name as "STORAGE POOL", -
           stgpools.est_capacity_mb, -
           occupancy.node_name, -
           sum(occupancy.Physical_Mb) as "OCCUPANCY (MB)", -
           cast(sum(occupancy.Physical_Mb)/stgpools.est_capacity_mb*100 as
decimal(3,2)) as "%OCCUPED" -
from stgpools,occupancy -
where stgpools.stgpool_name = occupancy.stgpool_name -
group by stgpools.stgpool_name,stgpools.est_capacity_mb,occupancy.node_name

which returns 0 (wrong result as you can see below) for the column
"%OCCUPED" for all rows.

   STORAGE POOL: ARCH2004
EST_CAPACITY_MB: 5722020.0
      NODE_NAME: MON1
 OCCUPANCY (MB): 324.34
       %OCCUPED: 0.00

   STORAGE POOL: ARCH2004
EST_CAPACITY_MB: 5722020.0
      NODE_NAME: PC-MARSAOUI
 OCCUPANCY (MB): 10108.61
       %OCCUPED: 0.00

   STORAGE POOL: ARCH2004
EST_CAPACITY_MB: 5722020.0
      NODE_NAME: PROD1
 OCCUPANCY (MB): 230535.52
       %OCCUPED: 0.00

   STORAGE POOL: ARCH2004
EST_CAPACITY_MB: 5722020.0
      NODE_NAME: RAVEN2
 OCCUPANCY (MB): 0.11
       %OCCUPED: 0.00
...

Should I rewrite the SQL ?

Any suggestion ?

Thank you very much.

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