Good morning everyone. Have a kind of interesting question: I have a few cubes sharing the same SSAS service. Each cube has it’s own location separated into 4 Tier-1 volumes plus a datadir – metadata holder. If I create any empty cube from the script from scratch it acquiring “version 0†something like H:MRCAVK_DataDirAS_MRCAVK.0.db As soon as I am restoring the previously backuped database WITH OVERWRITE option – it increases the version to H:MRCAVK_DataDirAS_MRCAVK.1.db How to keep that under control? P.S. Some databases in line have grown to version 24 and up: H:MRCAVK_DataDirAS_MRCAVK.24.db
The ObjectVersion is an internal to SSAS and cannot be updated. The reason why we needed it - we are using SQL Agent job to detach and attach the cube from the service. Ended up with the work around: Windows PowerShell + SQL Server AMO: the script to detach database: #Objective: To detach database to the given Analysis Server #Created by: AVK #Create Date: 05/17/2010 param ([string] $ServerName, [string] $databasename, [string] $location)## Add the AMO namespace [Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") >$NULL $server = New-Object Microsoft.AnalysisServices.Server $server.connect($ServerName) if ($server.name -eq $null) { Write-Output ("Server '{0}' not found" -f $ServerName) break } else { $database=$server.Databases $database|select-object name $advdb=$database[$databasename] $advdb.detach() }And the script to attach database (the current version that is available) #Objective: To attach database to the given Analysis Server #Created by: AVK #Create Date: 05/17/2010 param ([string] $ServerName, [string] $databasename, [string] $location, [string] $readwrite) $filename=$databasename + ".*.db"## Add the AMO namespace [Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") >$NULL $server = New-Object Microsoft.AnalysisServices.Server $server.connect($ServerName) if ($server.name -eq $null) { Write-Output ("Server '{0}' not found" -f $ServerName) break } else { $dbstring=$server.Databases |select-object name| select-string -simplematch $databasename $server foreach ($file in Get-ChildItem $location -Filter $filename) {if ($file.extension -eq ".db") { "Attaching AS database... " + $file.fullname $server.attach($file.fullname, $readwrite) } } } Executed by passing parameters "Servername" "DatabaseName" "Location" "ReadWrite"