MAXPERM IS the MAX Permanant space that has been allocated. CURRENTPERM IS the Permanant space occupied currently. So use CURRENTPERM TO calculate space consumed.
Use SQL below to find TOP Databases by space occupied:
SELECT
DatabaseName
,MAX(CurrentPerm) * (HASHAMP()+1)/1024/1024 AS USEDSPACE_IN_MB
FROM DBC.DiskSpace
GROUP BY DatabaseName
ORDER BY USEDSPACE_IN_MB DESC; Use SQL below to find TOP Tables by space occupied:
SELECT
DATABASENAME
,TABLENAME
,SUM(CurrentPerm)/1024/1024 AS TABLESIZE_IN_MB
FROM DBC.TableSize
GROUP BY DATABASENAME,TABLENAME
ORDER BY TABLESIZE_IN_MB DESC;
↧