dbTalk Databases Forums  

Programatic creation of cube partitions

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Programatic creation of cube partitions in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
K. Brooks
 
Posts: n/a

Default Programatic creation of cube partitions - 12-28-2005 , 03:14 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



Reply With Quote
  #2  
Old   
Rich
 
Posts: n/a

Default RE: Programatic creation of cube partitions - 12-28-2005 , 07:33 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_ErrHandler

'--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_ErrHandler:
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:

Quote:
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




Reply With Quote
  #3  
Old   
James Ma
 
Posts: n/a

Default RE: Programatic creation of cube partitions - 12-29-2005 , 12:01 PM



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

"Rich" wrote:

Quote:
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_ErrHandler

'--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_ErrHandler:
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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.