May 12, 2010 at 8:03 am
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 metadata is acquiring “version 0” something like
H:\MRCAVK_DataDir\AS_MRCAVK.0.db
As soon as I am restoring the previously backuped database WITH OVERWRITE option – it increases the version to
H:\MRCAVK_DataDir\AS_MRCAVK.1.db
How to keep that under control?
P.S. Some databases in line have grown to version 24 and up:
H:\MRCAVK_DataDir\AS_MRCAVK.24.db:w00t:
May 12, 2010 at 9:20 am
Just FYI
I am using SSAS 2008 SP1 CU6 Build 10.0.2757
May 19, 2010 at 11:00 am
The ObjectVersion value of the cube is an internal numeric value that is used for isolation management and cannot be changed. We are using the hard coded version for attach cube command in SQL Agent job. Found the work around of how to manage any given version using Windows PowerShell and MS SQL Server AMO:
To detach the 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 then to attach it back:
#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)
}
}
}
The script is wrapped into SQL Agent task with the parameters:
./DetachDatabase.ps1 "MySSASServer" "AS_MRCAVK" "H:\MRCAVK_DataDir\"
and
./AttachDatabase.ps1 "MySSASServer" "AS_MRCAVK" " H:\MRCAVK_DataDir\" "ReadWrite"
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply