[OCI DWH MySQL] Raw Capacity from dwh_inventory and dwh_capacity

For OCI licensing, these queries are useful.

SELECT

  dwh_inventory.storage.family as family,

  dwh_inventory.storage.name as array,

  dwh_inventory.storage.serialNumber as serial,

  sum(dwh_inventory.storage.rawCapacityMB)/1048576 as rawTB

FROM dwh_inventory.storage

WHERE lastAcquiredTime > DATE_SUB(NOW(),INTERVAL 3 MONTH)

GROUP BY array;


SELECT

  s.family,

  s.name AS array,

  s.serialNumber AS serial,

  SUM(rawCapacityMB) / 1048576 AS rawTB

FROM dwh_capacity.storage_and_storage_pool_capacity_fact f

JOIN dwh_capacity.storage_dimension s ON f.storageTk = s.tk

WHERE f.dateTk = (SELECT MAX(dateTk) FROM dwh_capacity.storage_and_storage_pool_capacity_fact)

GROUP BY array;




Comments