SSAS 处理多维数据集 - 不能在 powershell 中使用,但可以在 Visual Studio 中使用

SSAS Processing Cubes - Won't work in powershell but works in Visual Studio

我正在尝试在 PowerShell 中处理多维数据集和维度。它已经工作了一段时间,但突然停止了。我可以在 visual studio 中处理维度和多维数据集,但是使用 powershell 脚本以相同的顺序处理它们会给我一个重复的属性键错误。

Powershell 脚本:

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices")


$serverAS = New-Object Microsoft.AnalysisServices.Server

$serverAS.connect("SERVER")



$db = $serverAS.databases["ANALYSIS DB"]

$db.cubes | select name, storagemode, lastprocessed

$db.dimensions | select name, isparentchild, lastprocessed, storagemode

Foreach ($c in $db.dimensions)  {$c.process("ProcessFull")}

Foreach ($c in $db.cubes)  {$c.process("ProcessFull")}

您需要忽略如下关键错误:

## Set up the Error Configuration so that Key Errors are ignored
$errorConfig = New-Object `
    Microsoft.AnalysisServices.ErrorConfiguration("D:\ProcessLogs\")
$errorConfig.KeyNotFound = "ReportAndContinue"
$errorConfig.KeyErrorAction = "ConvertToUnknown"
$errorConfig.KeyErrorLimit = -1

然后使用此错误配置参数进行处理:

## Process the current database
$c.Process("ProcessFull", $errorConfig)

参考和示例: http://www.biadmin.com/2012/07/bi-admin-scripts-process-ssas-database.html

感谢您的回复。我实际上能够通过使用 SSDT 和集成服务来处理维度和多维数据集来解决这个问题。