To obtain a list (in order of the amount of space used) of those databases currently using more than 80% of their permanent space allocation, enter:
SELECT DatabaseName, SUM(CurrentPerm) FROM DBC.DiskSpaceV GROUP BY DatabaseName HAVING (SUM(CurrentPerm)/NULLIFZERO(SUM(MaxPerm))) >.8 ORDER BY SUM(CurrentPerm) DESC;
You can also use the AMPUsage and DiskSpace views to compile and maintain usage statistics that can later be selected and analyzed as described in the following sections.