How come the version of the cube changes? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

How come the version of the cube changes?

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

Just FYI : I am using SSAS 2008 SP1 CU6 Build 10.0.2757

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"

]]>

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |