Home > Archive > MS SQL Server OLAP > December 2005 > Programatic creation of cube partitions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Programatic creation of cube partitions
K. Brooks

2005-12-28, 8:24 pm

How can you programmatically create cube partitions? I have a cube that
is 3.2GB in fact data size and a year should contain about 35GB of fact
data. I would like to partition it into several slices, however I do not
want to create 50 partition through the GUI. Help me please. Thanks.

Kevin Brooks


Rich

2005-12-28, 8:24 pm

Hi Kevin,

I was able to create partions using the DSO object model in VB6 (or VB.Net).
Here is a subroutine that I used in VB6. It creates 2 distinct partitions.

Private Sub CreatePartition()

Dim dsoDatabase As DSO.MDStore
Dim dsoCube As DSO.MDStore
Dim dsoPartition As DSO.MDStore

On Error GoTo CreatePartition_ErrH
andler

'--Need to make reference to C:\Program Files\Common Files\Microsoft
Shared\DSO\msmddo.dll
'--this is the Microsoft Decision Support Objects library


Me.MousePointer = vbHourglass

'<><><><><><><><><><><><><><><><><><><><><><><><><>
' Connect to the server
'<><><><><><><><><><><><><><><><><><><><><><><><><>

MakeServerConnection
Me.txtServer.Text

'<><><><><><><><><><><><><><><><><><><><><><><><><>
' Set database and cube objects
'<><><><><><><><><><><><><><><><><><><><><><><><><>

Set dsoDatabase = mdsoServer.MDStores("FundAcctSample")
Set dsoCube = dsoDatabase.MDStores("Investments")

'<><><><><><><><><><><><><><><><><><><><><><><><><>
' Create a Partition
'<><><><><><><><><><><><><><><><><><><><><><><><><>

GoTo lbl1
Set dsoPartition = dsoCube.MDStores.AddNew("Connecticut")

dsoPartition.SourceTable = "Investments"
dsoPartition.SourceTableFilter = "Offices.business = 'Connecticut'"
dsoPartition.AggregationPrefix = " Investme_Connecticut
_"
dsoPartition.OlapMode = olapmodeRolap

lbl1:

Set dsoPartition = dsoCube.MDStores.AddNew("Vermont")

dsoPartition.SourceTable = "Investments"
dsoPartition.SourceTableFilter = "Offices.business = 'Vermont'"
dsoPartition.AggregationPrefix = "Investme_Vermont_"
dsoPartition.OlapMode = olapmodeRolap

dsoPartition.Update

Me.MousePointer = 0
Exit Sub

CreatePartition_ErrH
andler:
MsgBox Error, vbCritical, "Create Partition Error"
Me.MousePointer = 0
Exit Sub
End Sub

This code adds 2 partitions to the Investments Cube in Analysis server. It
worked fine for me.

HTH

Rich



"K. Brooks" wrote:

> How can you programmatically create cube partitions? I have a cube that
> is 3.2GB in fact data size and a year should contain about 35GB of fact
> data. I would like to partition it into several slices, however I do not
> want to create 50 partition through the GUI. Help me please. Thanks.
>
> Kevin Brooks
>
>
>

James Ma

2005-12-29, 1:23 pm

Also need to know that seems only works on Enterprise edition.

"Rich" wrote:
[color=darkred]
> Hi Kevin,
>
> I was able to create partions using the DSO object model in VB6 (or VB.Net).
> Here is a subroutine that I used in VB6. It creates 2 distinct partitions.
>
> Private Sub CreatePartition()
>
> Dim dsoDatabase As DSO.MDStore
> Dim dsoCube As DSO.MDStore
> Dim dsoPartition As DSO.MDStore
>
> On Error GoTo CreatePartition_ErrH
andler
>
> '--Need to make reference to C:\Program Files\Common Files\Microsoft
> Shared\DSO\msmddo.dll
> '--this is the Microsoft Decision Support Objects library
>
>
> Me.MousePointer = vbHourglass
>
> '<><><><><><><><><><><><><><><><><><><><><><><><><>
> ' Connect to the server
> '<><><><><><><><><><><><><><><><><><><><><><><><><>
>
> MakeServerConnection
Me.txtServer.Text
>
> '<><><><><><><><><><><><><><><><><><><><><><><><><>
> ' Set database and cube objects
> '<><><><><><><><><><><><><><><><><><><><><><><><><>
>
> Set dsoDatabase = mdsoServer.MDStores("FundAcctSample")
> Set dsoCube = dsoDatabase.MDStores("Investments")
>
> '<><><><><><><><><><><><><><><><><><><><><><><><><>
> ' Create a Partition
> '<><><><><><><><><><><><><><><><><><><><><><><><><>
>
> GoTo lbl1
> Set dsoPartition = dsoCube.MDStores.AddNew("Connecticut")
>
> dsoPartition.SourceTable = "Investments"
> dsoPartition.SourceTableFilter = "Offices.business = 'Connecticut'"
> dsoPartition.AggregationPrefix = " Investme_Connecticut
_"
> dsoPartition.OlapMode = olapmodeRolap
>
> lbl1:
>
> Set dsoPartition = dsoCube.MDStores.AddNew("Vermont")
>
> dsoPartition.SourceTable = "Investments"
> dsoPartition.SourceTableFilter = "Offices.business = 'Vermont'"
> dsoPartition.AggregationPrefix = "Investme_Vermont_"
> dsoPartition.OlapMode = olapmodeRolap
>
> dsoPartition.Update
>
> Me.MousePointer = 0
> Exit Sub
>
> CreatePartition_ErrH
andler:
> MsgBox Error, vbCritical, "Create Partition Error"
> Me.MousePointer = 0
> Exit Sub
> End Sub
>
> This code adds 2 partitions to the Investments Cube in Analysis server. It
> worked fine for me.
>
> HTH
>
> Rich
>
>
>
> "K. Brooks" wrote:
>
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com