Showing posts with label partitions. Show all posts
Showing posts with label partitions. Show all posts

Wednesday, March 7, 2012

Programmatic way to replace partition DSV Table bindings with Query Bindings

I'm trying to programmatically replace all my partitions' DSV table bindings with query bindings.

In the partitions manager, when creating a new partition that's restricted via a query binding, the wizard manages to pull a default query from the DSV definition. Is there a way to do this programmatically? The closest thing I could find in the object model is the "Schema" property, but this isn't what I need.

I am pretty sure anything you can do in XMLA is possible to do through AMO.

The easiest way for you to figure out what classes and properties or methods to use is to use AMOBrowser sample application. It shows you the real hierachy of AMO objects.

For instance, using that application I was able to figure out that partition has a source object and then simple search for "partition.source" brought me to this aricle http://msdn2.microsoft.com/en-gb/library/ms345091.aspx

Where I discovered following code sample

static void CreateInternetSalesMeasureGroupPartitions(MeasureGroup mg)
{
Partition part;
part = mg.Partitions.FindByName("Internet_Sales_184");
if ( part != null)
part.Drop();
part = mg.Partitions.Add("Internet_Sales_184");
part.StorageMode = StorageMode.Molap;
part.Source = new QueryBinding(db.DataSources[0].ID, "SELECT * FROM [dbo].[FactInternetSales] WHERE OrderDateKey <= '184'");
part.Slice = "[Date].[Calendar Year].&[2001]";
part.Annotations.Add("LastOrderDateKey", "184");

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Thanks for the tip, Edward. I still haven't found the class that exposes the DSV's query binding (which I would use when generating a new partition's query binding), so I suppose I might have to do this manually.

The Annotations property looks pretty useful though, thanks!

Monday, February 20, 2012

Programatic cube partition creation?

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
If this is AS2K5, then you can use XMLA scripting. Just create one partition
using SSMS, then right-click on it and generate an XMLA script. Then you can
modify the script for the other 49 partitions and run the script through
SSMS to create them.
If using AS2K, then there is a similar, but unsupport utility called DSO/XML
that is available for download here:
http://www.microsoft.com/downloads/d...DisplayLang=en
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
This posting is provided "AS IS" with no warranties, and confers no rights.
"K. Brooks" <jeepnreb@.yahoo.com> wrote in message
news:O0YxWP$CGHA.3820@.TK2MSFTNGP12.phx.gbl...
> 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
>

Programatic cube partition creation?

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 BrooksIf this is AS2K5, then you can use XMLA scripting. Just create one partition
using SSMS, then right-click on it and generate an XMLA script. Then you can
modify the script for the other 49 partitions and run the script through
SSMS to create them.
If using AS2K, then there is a similar, but unsupport utility called DSO/XML
that is available for download here:
http://www.microsoft.com/downloads/...&DisplayLang=en
--
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"K. Brooks" <jeepnreb@.yahoo.com> wrote in message
news:O0YxWP$CGHA.3820@.TK2MSFTNGP12.phx.gbl...
> 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
>