2011-12-22 66 views

回答

1

看看這個:PowerSSAS

它沒有明確的加分支持,所以你可能必須製作一個XMLA片段做加法分區,然後使用PowerSSAS將其推到SSAS服務器。

+1

PowerSSAS可以做到這一點,而無需製作XMLA。您只需要獲取對度量值組的引用,然後調用分區集合的Add方法。 – 2012-01-05 03:48:03

6

這增加了分區探險工程DW 2008R2立方體(特別是在冒險互聯網客戶測量組作品立方體):

$server_name = "localhost" 
$catalog = "Adventure Works DW 2008R2" 
$cube = "Adventure Works" 
$measure_group = "Fact Internet Sales" 
$old_partition = "Customers_2004" 
$new_partition = "Customers_2009" 
$old_text = "'2008" 
$new_text = "'2009" 

[Reflection.Assembly]::LoadFile("C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.AnalysisServices.DLL") 
$srv = new-object Microsoft.AnalysisServices.Server 
$srv.Connect("Data Source=" + $server_name) 
$new_part = $srv.Databases[$catalog].Cubes[$cube].MeasureGroups[$measure_group].Partitions[$old_partition].Clone() 
$new_part.ID = $new_partition 
$new_part.Name = $new_partition 
$new_part.Source.QueryDefinition = $new_part.Source.QueryDefinition.Replace($old_text, $new_text) 
$srv.Databases[$catalog].Cubes[$cube].MeasureGroups[$measure_group].Partitions.Add($new_part) 
$srv.Databases[$catalog].Cubes[$cube].MeasureGroups[$measure_group].Partitions[$new_partition].Update() 
$srv.Databases[$catalog].Update() 
$srv.Disconnect() 

你必須改變的變量向上頂,並參考Microsoft.AnalysisServices.dll大會,但除此之外,這將工作桃色敏銳。

訣竅是調用Update()上的對象改變,然後在整個數據庫本身。

如果你想處理新的分區,以及,你可以做到這一點下面的行前$srv.Disconnect

$srv.Databases[$catalog].Cubes[$cube].MeasureGroups[$measure_group].Partitions[$new_partition].Process() 

您可以瞭解更多有關分析管理對象(AMO)here

-2

你可以使用:

Microsoft.AnalysisServices.Deployment [ASdatabasefile] 
{[/s[:logfile]] | [/a] | [[/o[:output_script_file]] [/d]]} 

部署您的多維數據集作爲使用PowerShell。

+0

不回答這個問題。 – 2015-02-16 03:12:35

相關問題