DB Partitioning & Compression
DB Partitioning & Compression
Applies to:
SAP BI 7 , SQL Server 2005. For more information, visit the Business Intelligence homepage.
Summary
The purpose of this document is to outline a strategy for DB partitioning and compression of data of
InfoCubes.
Author Bio
Venkata Devaraj P currently with Satyam Computer Services Ltd. is an astute & result oriented IT
professional with overall 11 years of experience of which 7.10 Years in SAP BW Implementation,
1.5 Years in SAP FI Roll Outs and 3.7 Years of domain expertise in Finance (Internal audits).
Table of Contents
1. Strategy....................................................................................................................................................3
1.1. Background .......................................................................................................................................3
1.2. Options ..............................................................................................................................................4
1.3. Recommendations ............................................................................................................................4
2. Design Implementations ..........................................................................................................................5
2.1. Partitioning of New Cube...................................................................................................................5
2.1.1. Setting Constant for Fiscal variant ....................................................................................................5
2.1.2. Definition for Partitioning ...................................................................................................................6
2.2. Repartitioning ....................................................................................................................................7
2.2.1. Setting Constant for Fiscal Variant....................................................................................................8
2.2.2. Complete Partitioning ........................................................................................................................8
2.2.3. Repartitioning Monitor .....................................................................................................................12
2.3. How to see the Partitions ................................................................................................................13
2.4. Steps and definition Compression ..................................................................................................14
2.4.1. Option1 ............................................................................................................................................15
2.4.2. Option2 ............................................................................................................................................15
2.4.3. With Zero Elimination ......................................................................................................................16
2.4.4. Automating Compression using Process chain...............................................................................16
3. Data Recovery Options..........................................................................................................................18
3.1.1. Before Compression of request ......................................................................................................18
3.1.1.1. Delete request from all the data targets......................................................................................18
3.1.1.2. Delete the Data Mart Status in DSO ...........................................................................................18
3.1.1.3. Delete the Data Mart Status in DSO ...........................................................................................19
3.1.2. After Compression of request..........................................................................................................19
3.1.2.1. Reverse posting ..........................................................................................................................19
3.1.2.2. Selective Full Upload ..................................................................................................................20
3.1.2.3. Re-Initialization............................................................................................................................20
4. Archived and Deleted Partitions ............................................................................................................21
4.1.1. Processing Option – Merging and Adding Partitions ......................................................................21
5. Appendix A.............................................................................................................................................22
5.1. Background information about Copying Data (refer oss note 1008833).........................................22
5.2. Background Information about Error Handling (refer oss note 1008833) .......................................22
5.3. Transport (refer oss note 1008833) ................................................................................................22
6. Appendix B.............................................................................................................................................23
6.1. Example for Maximum Number of Partitions...................................................................................23
Related Content................................................................................................................................................24
Disclaimer and Liability Notice..........................................................................................................................25
1. Strategy
1.1. Background
For Infocubes created after implementation of SP9 in BI, system creates default partitions for
every request that is loaded with data in the cube.
In SQL Server 2005, the maximum number of partitions permissible per Infocube is 1000.
Once this number is reached, the data load into that particular info cube would fail.
Most of the cubes are being loaded daily and if the source is only one, then before the end of
3 years the maximum number of partitions could be reached. And if the cube has multiple
sources, then the maximum number would be reached even earlier.
Due to the above scenario there is a need of have a strategy in place.
So far in SQL Server 2005 table partitioning is possible for BW PSA tables, F-Fact tables,
and E-Fact tables.
SAP supports SQL Server 2005 range partitioning on the following classes of tables in SAP
BW versions 3.5 and higher:
• Persistent Staging Area (PSA) table. This is the main table for the staging data coming
from the outside into SAP BW. Here the partition criteria is the ‘LoadID’. The LoadID is
an artificial partitioning key for PSA tables that correlates to the number of rows per
partition.
1.2. Options
The options that are available are given below:
1. Partition all the newly created Infocubes.
2. For existing cubes perform complete repartitioning based on Time characteristics.
3. Compress the request of all cubes on a timely basis. This will transfer the data from the F-
Fact table to the E-Fact table
1.3. Recommendations
1. Create Time DB partitions for all new Infocubes using time characteristics Calender Month
(0CALMONTH) or Fiscal Year / Period (0FISCPER)..
2. Repartition the infocubes using time characteristics Calender Month (0CALMONTH) or
Fiscal Year / Period (0FISCPER). (refer example in Appendix B for no of partitions)
3. Create Maximum of XXX partitions {(XX Years * YY Month or Z QTR ) +2}
4. Compress the requests that are older than XXX days.
5. Keep the PSA and Change Log retention period in sink with the compression strategy.
2. Design Implementations
You can only partition a dataset using one of the two partitioning criteria ‘calendar month’
(0CALMONTH) or ‘fiscal year/period (0FISCPER). At least one of the two InfoObjects must
be contained in the InfoProvider.
Choose the Time characteristic based on which you would like to partition and click on
continue
Enter the Time range and also enter the maximum number of partitions and click on
continue
2.2. Repartitioning
Repartitioning can be useful if you have already loaded data to your InfoCube, and:
9 You did not partition the InfoCube when you created it.
9 You loaded more data into your InfoCube than you had planned when you
partitioned it.
9 You did not choose a long enough period of time for partitioning.
9 Some partitions contain no data or little data due to data archiving over a period of
time.
SAP recommends a complete back up of the database before you execute this
function. This ensures that if an error occurs (for example, during a DB
catalogue operation), you can restore the system to its previous status.
In most of the cases there would be a daily back up that would be taken as a normal
practice. Therefore it is always easier to take a differential back-up of BI before starting the
repartitioning.
RSA1Æ Modeling Æ Infoprovider Æ Right Click on Cube Æ Additional Functions Æ
Repartitioning
You can only use complete repartitioning for InfoCubes. A heterogeneous state is possible.
For example, it is possible to have a partitioned InfoCube with non partitioned aggregates.
This does not have an adverse effect on functionality. You can automatically modify all of the
active aggregates by reactivating them.
After entering the technical name of the cube you want to repartition. Click on Initialize.
Choose the Time characteristic (Fiscal Year / Period or Calender Year / Month) based on
which you want to partition the cube. Click on continue
Enter the Range of Time that you want to partition and the maximum number of partitions.
Click on continue
You will get a message for rebuilding of aggregates after repartitioning. Click Yes if aggregates
exist on the infocube else choose No.
On clicking Yes, You will get the below message. Click on continue
You can now schedule the repartition immediately or at a particular date and time.
You will get the below message that the repartitioning has been scheduled
You can monitor the repartitioning requests using a monitor. The monitor shows you the
current status of the processing steps. When you double-click, the relevant logs appear. The
following functions are available in the context menu of the request or editing step:
9 Delete: You delete the repartitioning request; it no longer appears in the monitor, and
you cannot restart. All tables remain in their current state. The InfoCube may be
inconsistent.
9 Reset Request: You reset the repartitioning request. This deletes all the locks for the
InfoCube and all its shadow tables.
9 Reset Step: You reset the canceled editing steps so that they are reset to their original
state.
9 Restart: You restart the repartitioning request in the background. You cannot restart a
repartitioning request if it still has status Active (yellow) in the monitor. Check whether
the request is still active (transaction SM37) and, if necessary, reset the current editing
step before you restart.
Refer Appendix A for background information about copying data, error handling and
transport.
E Table
Similarly you can see the partitions created for the PSA table and the Change log table.
Go to Collapse tab
2.4.1. Option1
Request ID. - In this option you can compress the request up to the request id that you enter.
2.4.2. Option2
Calculated Request ID. - In this you can specify a threshold value. During the runtime it is
then determined if and to which calculated request ID the data of the request is compressed.
If you want to avoid entries that only contain zero values as key figures (for example reverse
posting) are contained in the InfoCube after compressing, you can execute a zero
elimination at the same time as compressing.
Zero elimination is only permitted for InfoCubes where key figures with the aggregation
behaviour 'SUM' exclusively occur. With non-cumulative values in particular you may not
execute a zero elimination.
Click on the data mart status of the request. You will get a screen as shown below. Click on
to reset the delta to the cube in the DSO. Below is the 3.X DSO screen shot.
In BI7 DSO,
Click on the the data mart status of the request. You will get a screen as shown below.
You can delete the request from all the data targets that the request has been loaded. And this
will reset the data mart status to the cube in the DSO.
It appears that the reverse posting can be done only up to version 3.X (Update
rules). The same does not appear active in BI7 (Transformation/DTP).
3.1.2.3. Re-Initialization
In some of the cases the only and last option available to do a re-initialization of the
delta.
When the data of a particular period in the cube has been archived or deleted, the partitions
that have been defined for that period would become empty. You can use the merge
partitions options of repartitioning to merger the partitions.
InfoCube partitions are either merged at the bottom end of the partitioning schema (merge),
or added at the top (split).
Ideally, this operation is only executed for the database catalog. This is the case if all the
partitions that you want to merge are empty and no data has been loaded outside of the time
period you initially defined. The runtime of the action is only a few minutes.
If there is still data in the partitions you want to merge, or if data has been loaded beyond the
time period you initially defined, the system saves the data in a shadow table and then
copies it back to the original table. The runtime depends on the amount of data to be copied.
With InfoCubes for non-cumulative, all markers are either in the bottom partition or top
partition of the E fact table. Whether mass data also has to be copied depends on the editing
options. For this reason, the partitions of non-cumulative InfoCubes cannot be merged if all
of the markers are in the bottom partition. If all of the markers are in the top partition, adding
partitions is not permitted. If this is the case, use the Complete Repartitioning editing option.
You can merge and add partitions for aggregates as well as for InfoCubes. Alternatively, you
can reactivate all of the aggregates after you have changed the InfoCube. Since this function
only changes the DB memory parameters of fact tables, you can continue to use the
available aggregates without having to modify them.
5. Appendix A
5.1. Background information about Copying Data (refer oss note 1008833)
By default, the system copies a maximum of six processes in parallel. The main process
splits dialog processes in the background. These dialog processes each copy small data
packages and finish with a COMMIT. If a timeout causes one of these dialog processes to
terminate, you can restart the affected copy operations, after you have altered the timeout
time. To do this, choose Restart Repartitioning Request.
6. Appendix B
Related Content
Repartitioning Help
Compressing Infocubes
How to Contribute
For more information, visit the Business Intelligence homepage.