Friday, June 23, 2006

Checking the status of OLAP Cubes

Running a full process of a shared dimension will bring down all the cubes that use that shared dimension. I needed a mecanism to check the status of all my cubes in an Analysis Services 2000 installation.

So I came up with the following VBS script. It's quick and dirty but it works.

'CubeStatus.vbs
ServerName = "LocalHost"
'Delimiter = Chr(9) 'Tab
Delimiter = ";"

Set dsoServer = CreateObject("DSO.Server")

'Connect Analysis server
dsoServer.Connect ServerName

'Walk through OLAP DBs
For Each dsoDB In dsoServer.MDStores
'Walk through Cubes.
For Each dsoCube In dsoDB.MDStores
State = "Other"
If dsoCube.State = 0 Then
State = "OFFLINE"
ElseIf dsoCube.State = 4 Then
State = "Online"
End if
Wscript.Echo dsoDB.Name & Delimiter & dsoCube.Name & Delimiter & State
Next
Next


To run it use the command below:

cscript /NoLogo CubeStatus.vbs

And this could be the result

FoodMart;expenses;OFFLINE
FoodMart;Inventory;Online

No comments:

Post a Comment