SQL Server Performance

How come the version of the cube changes?

Discussion in 'SQL Server 2008 Analysis Services' started by Andrey.Vegger, May 12, 2010.

  1. Andrey.Vegger New Member

    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
  2. Andrey.Vegger New Member

    Just FYI : I am using SSAS 2008 SP1 CU6 Build 10.0.2757
  3. Andrey.Vegger New Member

    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"

Share This Page