简体   繁体   English

SSAS处理多维数据集-无法在Powershell中工作,但在Visual Studio中工作

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

I'm attempting to process cubes and dimensions in powershell. 我正在尝试在Powershell中处理多维数据集和维度。 It has been working for awhile but all of a sudden it stops. 它已经工作了一段时间,但突然间它停止了。 I can process the dimensions and cubes in visual studio but processing them with a powershell script in the same order gives me a duplicate attribute key error. 我可以在Visual Studio中处理维度和多维数据集,但是使用Powershell脚本以相同顺序进行处理会给我带来重复的属性键错误。

Powershell Script: 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")}

You need to ignore the key errors like this: 您需要忽略以下关键错误:

## 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

and then process with this error config parameter: 然后使用以下错误配置参数进行处理:

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

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

Thanks for the response. 感谢您的回复。 I was actually able to get around this by using SSDT and Integration Services to process Dimensions and Cubes. 实际上,我可以通过使用SSDT和Integration Services处理维度和多维数据集来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM