Database Reference
In-Depth Information
Generating partitions in Integration Services
The technique we are going to use to build partitions in Integration Services requires
the creation of a script task and some .NET code that uses Analysis Management
Objects ( AMO ) to connect to the cube and create or delete partitions. AMO is a
.NET class library that contains the objects necessary to perform administrative
tasks on an Analysis Services database. Since script tasks do not by default contain
a reference to the AMO library, the first thing we need to do after creating our script
task is right-click on the References node in the Project Explorer in the Script Editor
window, and add a reference to the Analysis Management Objects component. Full
documentation for AMO can be found in books online, so we won't go into any
detail on what each object does.
Here is an outline of what happens within the script task:
1. First, we retrieve information on what partitions exist in our fact table from
the relational database. This will tell us what partitions need to be present in
our measure group.
2. Then, we connect to Analysis Services and our measure group and find out
what partitions currently exist there.
3.
Next, we work out what Analysis Services partitions should be present in the
measure group based on what relational partitions are currently present in
the fact table.
4.
The last and most complex step is to compare the list of Analysis Services
partitions that should be present with the list of partitions that currently
exist, and apply any changes that are necessary. This will include deleting
old partitions, merging existing partitions, and creating new partitions. When
creating new partitions, we simply take the template partition and call the
Clone method on it to create a new, identical partition.
Each new Analysis Services partition is bound to a dynamically generated
SQL query that will return all of the data from the relational partitions it
covers, and other properties such as Slice are also set appropriately.
Once this has happened, we will need to process any new partitions, which we'll see
how to do in the next section in this chapter.
 
Search WWH ::




Custom Search