Checking SSAS object sizes programmatically
Most SSAS databases contain data for a finite time span instead of perpetually accumulating data. After a while, data becomes stale and irrelevant for frequent analysis and should be either purged or migrated to a historical database. Since the volumes of the data we work with tend to grow quickly, we need to have a way of quickly checking the available disk space as well as the size of each object.
How to do it...
Microsoft supplies a couple of handy commands you could execute directly from the SSMS MDX query window to obtain the free disk space amount on the data drive.
You can execute
SYSTEMGETLOGICALDrives
within SSMS or from the ASCMD utility. The command doesn't take any parameters, as shown in the following code snippet:SYSTEMGETLOGICALDRIVES
The following table shows the result:
Drive
Free Space
E:
5309
The output of the
SYSTEMGETLOGICALDRIVES
command depends on theAllowedBrowsingFolders
property value. Had I includedC:\
in theAllowedBrowsingFolders...