Professional Documents
Culture Documents
Version 1.0
Brigitte Bläser
IBM SAP DB2 for Linux, UNIX and Windows
Development, IBM Lab Böblingen
-1-
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Summary
Heterogeneous SAP system copies, i.e. migrations of SAP systems to other database
platforms or operating systems, are always a big effort for large databases. Migrations of
SAP NetWeaver Business Intelligence (BI) systems are usually the most complex. This is
because, to get a maximum of performance on each database platform, SAP NetWeaver
BI makes use of different database specific features that cannot be easily mapped to each
other and that are not explicitly represented in the SAP data dictionary. The SAP
migration procedure for SAP NetWeaver BI contains additional steps to cope with this
problem. This document describes the details of the SAP NetWeaver BI migration
procedure with focus on IBM® DB2® for Linux®, UNIX ®and Windows® as the target
database platform. The intended audiences are SAP migration consultants involved in
customer migration projects of SAP NetWeaver BI systems to IBM DB2 for Linux,
UNIX and Windows.
-2-
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Table of Contents
Summary ......................................................................................................................... 2
Table of Contents................................................................................................................ 3
List of Figures ..................................................................................................................... 5
1. Introduction............................................................................................................. 6
2. SAP BI information model ..................................................................................... 7
2.1 SAP BI information model elements .................................................................. 7
2.2 Mapping of information model elements to database tables .............................. 9
2.2.1 PSA ............................................................................................................. 9
2.2.2 DataStore Objects ....................................................................................... 9
2.2.3 InfoCubes and aggregates ......................................................................... 10
2.2.4 Other SAP BI database tables ................................................................... 12
3. SAP BI implementation on DB2 for Linux, UNIX and Windows ....................... 12
3.1 Support of DPF ................................................................................................. 12
3.2 Support of clustered indexes............................................................................. 14
3.3 Support of multi-dimensional clustering (MDC).............................................. 15
3.4 Support of DB2 9 row compression (deep compression) ................................. 16
3.5 Detailed SAP BI table layout on DB2 LUW .................................................... 17
3.5.1 PSA tables................................................................................................. 17
3.5.2 DataStore object tables ............................................................................. 17
3.5.3 InfoCube and aggregate tables.................................................................. 18
3.6 Differences to SAP BI implementations on other database platforms ............. 20
4. Issues of SAP BI system migrations..................................................................... 20
4.1 Issues related to size limits ............................................................................... 21
4.2 Issues related to database specific features and layout differences .................. 22
5. Steps of a heterogeneous SAP system copy ......................................................... 23
6. Steps of a heterogeneous SAP BI system copy .................................................... 25
6.1 Generation of the DDL for the target database ................................................. 27
6.1.1 DDL examples for migrations from Oracle to DB2 LUW ....................... 28
6.2 Exporting the source database .......................................................................... 45
6.2.1 Hints and Tips for the Export.................................................................... 46
6.3 Creation and import of the target database ....................................................... 47
6.3.1 SAP NetWeaver 2004s ............................................................................. 47
6.3.2 SAP NetWeaver ‘04.................................................................................. 51
6.3.3 SAP BW 3.0B and 3.1 Content................................................................. 56
6.3.4 Handling of database partition groups in multi-partition installations ..... 56
6.3.5 Modified R3load processing during target database import ..................... 58
6.3.6 Hints and tips to speed up the import........................................................ 63
6.4 SAP BI migration post processing.................................................................... 64
7. Tools for checking consistency of the DB2 LUW target database ....................... 66
7.1 Transaction DBACOCKPIT ............................................................................. 66
7.2 Checking the partitioning key of distributed SAP BI tables............................. 68
7.3 SAP BI transaction RSRV ................................................................................ 69
-3-
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
-4-
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
List of Figures
Figure 1: Data flow in SAP BI............................................................................................ 9
Figure 2: SAP BI extended star schema ........................................................................... 11
Figure 3: SAP BI database layout on DB2 LUW with one database partition ................. 13
Figure 4: SAP BI on DB2 LUW layout with multiple database partitions....................... 14
Figure 5: MDC table ......................................................................................................... 15
Figure 6: Steps of a heterogeneous SAP system copy...................................................... 24
Figure 7: SAP export directory structure for target DB platform DB2 LUW .................. 25
Figure 8: Steps of a heterogeneous SAP BI system copy................................................. 26
Figure 9: Report SMIGR_CREATE_DDL....................................................................... 27
Figure 10: Source Database Export with SAP NetWeaver '04 SAPinst........................... 45
Figure 11: Report SAP_DROP_TMPTABLES................................................................ 46
Figure 12: SAP NetWeaver 2004s - ABAP target system installation............................. 48
Figure 13: SAP NetWeaver 2004s - Exit for creating additional database partitions ...... 49
Figure 14: SAP NetWeaver 2004s - Creation of additional database partitions............... 50
Figure 15: SAP NetWeaver 2004s - Default mapping of database partition groups to
partitions ................................................................................................................... 51
Figure 16: SAP NetWeaver '04 – Target system installation ........................................... 52
Figure 17: SAP NetWeaver '04 – Database installation method ..................................... 53
Figure 18: SAP NetWeaver '04 – Adding database partitions......................................... 54
Figure 19: SAP NetWeaver '04 - Mapping of database partitions to servers ................... 55
Figure 20: SAP NetWeaver '04 – Exit for installing additional database partition servers
................................................................................................................................... 56
Figure 21: Tablespace information with database partition group in DBSIZE.XML ...... 57
Figure 22: Defining additional tablespaces and database partition group in DBSIZE.XML
................................................................................................................................... 58
Figure 23: Input files to R3load for importing the target database................................... 59
Figure 24: DB6COCKPIT: Missing tables and indexes before post migration ............... 67
Figure 25: DB6COCKPIT: Missing tables and indexes after post migration .................. 68
Figure 26: RSRV: Checking database indexes of an InfoCube and its aggregates .......... 69
Figure 27: RSRV: Checking database indexes of an InfoCube and its aggregates - Result
................................................................................................................................... 70
-5-
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
1. Introduction
Heterogeneous system copies of SAP BI systems (SAP Business Warehouse (BW) or
SAP NetWeaver Business Intelligence (BI)) or systems based on them, like SAP SEM
and SAP SCM, are more complicated than migrations of other SAP systems. This is
because these products make use of database platform specific features to get a maximum
of performance for data warehouse operations. The most prominent example for this is
partitioning. For several database platforms, for example Informix®, Oracle and DB2 for
zSeries®, SAP BI supports range partitioning in the slightly different implementations
available on these platforms. For DB2 for Linux, UNIX and Windows (DB2 LUW), SAP
BI support hash partitioning and multi-dimensional clustering (MDC). This results in
database specific properties of tables and indexes that are not available to the SAP
migration tool R3load because they are not contained in the information exported from
the SAP data dictionary of the source system. Additionally, there are a few differences in
the structure of tables and the number and structure of secondary indexes for SAP
NetWeaver BI objects on the different database platforms. R3load cannot handle this
either. When creating the tables and indexes in the target database it relies on the
structure information from the SAP data dictionary of the source database, and creates the
tables and indexes exactly as defined there. However, when migrating a SAP BI system
to another database platform, the specific features of that platform have to be
implemented and the tables and indexes have to be adapted to the layout required for the
target database platform. To handle this, additional processing steps have been defined on
the source and target system, and the R3load tool has been extended to deal with database
specific features and layout differences.
This document presents the details of the migration procedure for SAP BI system releases
greater or equal to SAP BW 3.0B, including SAP NetWeaver '04 BI and SAP NetWeaver
2004s BI, with focus on DB2 for Linux, UNIX and Windows as the target database
platform. Intended audiences are SAP migration consultants performing heterogeneous
system copies of SAP BI systems to DB2 LUW and performing non-Unicode to Unicode
migrations of SAP BI systems running on DB2 LUW. It starts with a brief introduction
into the SAP BI information model and the implementation of SAP BI on DB2 LUW. It
discusses the specific problems of SAP BI system migrations. It continues with an
overview of the steps required for a heterogeneous SAP system copy with R3load and
introduces the additional steps that have to be executed for SAP BI and Sap BI based
systems to handle database specific features and layouts. It explains the steps 'SQL
generation', export of the source database, installation and import of the target database,
and SAP BI migration post processing in detail, concentrating on aspects that are relevant
for DB2 LUW as target database platform. It provides general hints and tips for speeding
up database export and DB2 LUW specific recommendations for database import. It
shows transactions and reports for checking the consistency of the DB2 target database
after the migration.
The migration procedure described here is released for SAP BI releases greater or equal
to SAP BW 3.0B, including SAP NetWeaver '04 BI and SAP NetWeaver 2004s BI, and
-6-
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
to systems based on such releases, like SAP SCM and SAP SEM. It applies to all
migrations that require R3load. This includes migrations where the database platform
changes and migrations from a non-Unicode to a Unicode database on the same database
platform. Releases older than SAP BW 3.0B cannot be migrated with this method. The
latest information about required support packages and patches is contained in SAP note
777024 for SAP BW 3.0B and 3.1 Content, SAP note 771209 for SAP NetWeaver '04 BI,
and SAP note 888210 for SAP NetWeaver 2004s BI.
The following terminology is used in this document:
IBM DB2 for Linux, UNIX and Windows is referred to as DB2 LUW or DB2.
DB2 without reference to an operating system platform always refers to DB2
LUW.
SAP BI is used to refer to SAP NetWeaver BI and previous releases of SAP BW,
if the specific release is not relevant. Otherwise the official product name SAP
NetWeaver 2004s BI, SAP NetWeaver '04 BI, SAP BW 3.0B, SAP BW 3.1
Content, SAP BW 2.0B, or SAP BW 2.1C is used.
The term heterogeneous system copy refers to a copy of a SAP system to a
different operating system, a different database platform or both. Heterogeneous
system copies are also called migrations.
-7-
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
-8-
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
-9-
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
'A', the name of the DataStore object and '00', for example
“/BIC/AMYDSOBJ00” or “/BI0/AMYDSOBJ00”.
Activation queue: This table contains data that is new or modified since the last
activation. It is not yet available for reporting and delta update into data targets. It
has the columns of the active table, plus the three additional columns request ID,
data package and record number that form the primary key. The table name
consists of a prefix enclosed in '/' followed by the letter 'A', the name of the
DataStore object and '40' (for example “/BIC/AMYDSOBJ40” or
“/BI0/AMYDSOBJ40”).
Change log: This table is used for the delta update from the DataStore object into
other DataStore objects or InfoCubes. It records new data and changes to the
existing active data of the DataStore object. It has the columns of the active table,
plus the three additional columns request ID, data package and record number that
form the primary key. The table name is constructed like a PSA table name.
Up to and including SAP NetWeaver '04, SAP BI provides two types of DataStore
objects:
Standard DataStore objects consist of all three tables. When loading data into a
standard DataStore object it is first inserted into the activation queue. To make it
available for reporting and delta update it has to be activated.
DataStore objects for direct update consist of only the active table. Data loaded
into a DataStore object for direct update is directly available for reporting and
delta update into data targets.
With SAP NetWeaver 2004s a new Write-optimized DataStore object is introduced
that only consists of the active table with the three additional columns request ID, data
package and record identifier, i.e. the table has the structure of a change log. Write-
optimized DataStore objects are specifically designed for fast data load, without the
overhead of data activation and maintenance of a change log. Reporting only plays a
minor role.
- 10 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
SAPinst installation on DB2 LUW creates a system with one database partition.
Additional partitions can be created with the Add Database Partition function of SAPinst
(located in folder Database Specific Features). When performing a heterogeneous system
copy to DB2 LUW with SAPinst additional database partitions can be created directly.
The default installation of SAP BI on DB2 LUW is shown in Figure 3 and consists of
four database partition groups:
SAPNODEGRP_<SAPSID> for the standard SAP basis tablespaces on database
partition 0.
NGRP_DIM_<SAPSID> for the dimension tablespace, also residing on database
partition 0
NGRP_FACT_<SAPSID> for the tablespace containing fact tables of InfoCubes
and aggregates
NGRP_ODS_<SAPSID> for the tablespace containing PSA and DataStore object
tables
Figure 3: SAP BI database layout on DB2 LUW with one database partition
In multi-partition installations, for keeping database partition 0 small and releasing it
from operations executed on large InfoCubes, DataStore objects and PSA tables, it is
recommended not to place InfoCube and aggregate fact tables, DataStore object tables
and PSA tables on database partition 0. Database partition 0 not only contains the SAP
- 13 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Basis tables and SAP BI dimension and master data tables but also acts as the coordinator
partition.
A multi-partition database layout is shown in Figure 4. The database partition groups
NGRP_FACT_<SAPSID> and NGRP_ODS_<SAPSID> are distributed over database
partitions 1 to n while the database partition groups SAPNODEGRP_<SAPSID> and
NGRP_DIM_<SAPSID> reside on database partition 0.
- 14 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
dimension and can thus speed up queries that restrict on this dimension. For a clustering
index, DB2 tries to maintain the clustering order but this depends on the free space
available on the data pages and is not guaranteed.
In SAP BI on DB2 LUW, clustered indexes are created on InfoCube F and E fact tables,
if these tables do not use multi-dimensional clustering (MDC).
single data rows. Data roll-out operations profit from MDC fast delete. Whole data pages
are marked as deleted instead of every single data record. In Viper 2 (DB2 9.5),
asynchronous cleanup of additional row-based indexes will be provided. These speeds up
delete operations even more. You find detailed information about MDC, its support in
SAP BI and recommendations for using it in [6].
SAP NetWeaver 2004s BI and the SAP BI support packages listed below provide MDC
support for InfoCube and aggregate fact tables, DataStore objects tables and PSA tables:
• SAP BW 3.0B support package 32
• SAP BW 3.1 Content support package 26
• SAP NetWeaver ’04 BI support package 18
In SAP NetWeaver 2004s BI the information about MDC dimensions is stored in the
SAP BI metadata for InfoCubes and DataStore objects and can thus be transported within
a SAP BI system landscape. In the lower releases, the information about MDC
dimensions is not stored in the SAP BI metadata. Therefore it cannot be transported
between systems and may get lost when InfoCubes and DataStore objects are re-activated
in transaction RSA1.
- 16 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 19 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
or, for tables with more than 16 SID columns, the first 16 SID columns, and single
column indexes on the second, third, etc., SID column.
Row compression
Row compression for InfoCube and aggregate fact tables is controlled by RSADMIN
parameter DB6_ROW_COMPRESSION in the same way as for PSA tables and
DataStore object tables.
SAP BI systems tend to get very large and to contain very large tables (InfoCube
fact tables, PSA tables, DataStore active and change log tables). Therefore,
migrations have to be planned carefully to fit into the time window available for
them. Considerable effort might be necessary to determine the most efficient way
to export and import the very large tables through e.g. parallelization, use of
database specific import methods, etc.
Different size limits for database objects on the source and target database
platform might make it necessary to move tables to new data classes and use
database specific features like partitioning to fit the objects into the space
available. Size limits are an issue in DB2 V8. DB2 9 supports large tablespaces
(up to 16 TB) for data and indexes. Therefore size limits should no longer be an
issue.
When creating the tables and indexes in the target database the database specific
features have to be implemented. If they are not represented explicitly in the SAP
data dictionary standard R3load processing cannot handle them. This is a problem
even when only migrating to a different operating system without changing the
database platform. When changing the database platform the layout of tables and
indexes on the target database platform might differ from the layout in the source
database. The SAP data dictionary only contains the layout in the source database.
The first two problems are general. They have to be dealt with in all migrations of large
SAP systems containing very large tables. The third one is specific to SAP BI systems.
Information about how to speed up SAP system migrations to DB2 by tuning database
export and import is not further discussed in this whitepaper.
32 KB 16,384 GB
Table 2: DB2 9 for LUW tablespace size limits
New SAP installations on DB2 9 automatically use large tablespaces. When migrating
from DB2 V8 to DB2 9, regular tablespaces can be converted to large tablespaces.
On other database platforms, there are different size limits. For instance, on Informix
there is a size limit per table fragment of 64 GB when the DBSPACE has a page size of 4
KB and 32 GB when the DBSPACE has a page size of 2 KB. Fragmentation is the
Informix implementation of range partitioning. Table fragments reside in different
DBSPACES. There is no size limit for DBSPACES themselves. When migrating to DB2,
the data classes that are mapped to DBSPACES on Informix are mapped to tablespaces in
DB2. Thus, when migrating from Informix to DB2 V8, the following problems might
occur:
The size of an Informix DBSPACE might exceed the size limit of the DB2 V8
tablespace. In this case, the DB2 tablespace could be created with a larger page
size, if the DBSPACE size is less than 512 GB. This might not always help
because there is also a limit of 255 rows per tablespace page. Otherwise, tables
might have to be moved to other tablespaces.
The size of a fragmented table in Informix might exceed the DB2 V8 tablespace
size limit. The table fragments, although residing in different DBSPACES in
Informix, will be imported into a single table in the tablespace associated with the
table's data class in DB2. If the sum of the fragment sizes exceeds 512 GB, the
table cannot be stored in a DB2 tablespace on one database partition. For SAP BI
DataStore, PSA, and InfoCube fact tables several database partitions need to be
created in this case.
When planning the migration to DB2 V8 it is therefore necessary to get a detailed
overview of the database storage objects and their sizes on the source system and to
carefully plan the placement of tables in DB2 tablespaces, the tablespace page sizes, and
multi-partitioning. When doing this you should always calculate enough space for future
growth.
When migrating from Informix you can call report SAP_BWTOOLPGM_INF to get an
overview of the size and fragmentation of PSA, DataStore and InfoCube and aggregate
fact tables.
- 22 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
The combined indexes on fact tables have to be created clustered for non-MDC tables. If
the combined index on the F fact table does not exist, the index on the time dimension
key column has to be created clustered.
The data exported from the SAP data dictionary of the source system does not contain
this information, even if the source database platform is also DB2 for LUW. Additional
information is needed to create the tables and indexes correctly. This also applies to pure
non-Unicode to Unicode migrations, when the source and the target system use DB2
LUW. Also in this case, the information about partitioning keys, MDC dimensions and
clustered indexes is not contained in the data exported from the SAP data dictionary.
When migrating from other database platforms, additional unique indexes on DataStore
active tables have to be created non-unique on DB2. Otherwise SQL errors occur. The
combined index on fact tables has to be created with a different column order than on the
source database. Additional secondary indexes might have to be created on dimension
and fact tables that do not exist in the source database. Indexes on MDC dimensions
should not be created.
All this information is also not available in the data exported from the SAP data
dictionary of the source system. Additional information is required.
- 23 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
<Export_Directory>
DATA DB LABEL.ASC
DB6 DDLDB6.TPL
Figure 7: SAP export directory structure for target DB platform DB2 LUW
LABEL.ASC is the CD label created for the export. It is checked when installing the
target database. The DATA subdirectory contains the exported data and the SAP data
dictionary structure information. DDLDB6.TPL is a template for the DDL statements
used to create tables and indexes in DB2 for LUW. It also contains a standard mapping of
the SAP data classes to DB2 tablespaces. The DB6 subdirectory contains DBSIZE.XML,
the template containing the size estimates for the target database.
The export has to be transferred from the source server to the target server, for example
via FTP.
On the target server, the following steps have to be executed:
1. Generation of the SAP instance.
2. Obtain the migration key required for heterogeneous system copies from SAP.
3. Creation of the target database with tablespace sizes based on the estimations
from the source database and the sizes obtained from test migration.
4. Import the data into the target database with R3load.
5. Execute post migration reports and transactions as described in [3], [4] and [5] to
complete the migration.
The SAP installation programs SAPinst (for SAP systems greater or equal to Basis 6.20)
and R3Setup (for older SAP Basis releases) are used to export the source system and
install the target system and import the database.
The SAP Service Marketplace provides information about available tools and possible
optimizations for system copies under [2].
On the target system, after database import, a report has to be executed that
performs a number of SAP BI specific post migration tasks explained in SAP BI
migration post processing.
The complete migration process consists of the steps shown in Figure 8.
- 26 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 27 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
The output files of the report have to be placed in the DB/DB6 subdirectory of the source
database export directory. R3load will use them as additional input files when creating
the tables and indexes in the target database.
The .SQL output files are structured as shown below:
tab: <Table name>
sql: <DDL Statement(s) for table>
- 28 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
sql section (i.e. with an empty SQL statement) are created. This works in the same way
for all source database platforms different from DB2 LUW.
If the source system already runs on DB2 LUW the DDL is created from the DB2 system
catalog for all tables and indexes that use database specific features R3load cannot handle
(partitioning keys, MDC, row compression, clustered indexes). Because the information
is taken from the DB2 system catalog the tables and indexes will be created with exactly
the same layout as in the source system. For instance, it is not possible to create MDC for
non-MDC tables or activate row compression for tables that do not use it in the source
system.
If the source database platform is not DB2 LUW, RSADMIN parameters defined for SAP
BI on DB2 LUW can be set in the source system to influence the output. For instance, if
DB6_MDC_FOR_PSA is set to NO, the DDL for all PSA and PSA-like tables is created
without MDC while, if DB6_MDC_FOR_PSA is set to YES, the DDL for all PSA and
PSA-like tables is created with MDC on the request ID or request SID column. The
following RSADMIN parameters influence the output of SMIGR_CREATE_DDL:
• DB6_MDC_FOR_PSA: PSA and DataStore object activation queue and change
log tables are created with MDC if the parameter is set to YES and without MDC
if the parameter is set to NO. YES is the default for the following support
packages:
o SAP BW 3.0B support package 32
o SAP BW 3.1 Content support package 26
o SAP NetWeaver ’04 BI support package 18
o SAP NetWeaver 2004s BI support packages 1 to 8.
In all later support packages the default has been changed to NO. In earlier
support packages, MDC is not supported.
The following samples are taken from a SAP NetWeaver 2004s BI system running on
Oracle.
The DDL generation program determines which indexes with which properties exist on
the source system and generates the DDL for the indexes required on DB2 based on this
information. For other source database platform than Oracle, the generated DDL might
look different.
InfoCube fact tables without range partitioning
The following DDL is generated for a standard F fact table of an InfoCube that does not
use range partitioning:
tab: /BIC/FBFABCUBE5
sql: CREATE TABLE "/BIC/FBFABCUBE5"
("KEY_BFABCUBE5P" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5T" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5U" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE51" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE52" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/BCRMEM_QT" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/BCRMEM_VA" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BINVCD_VA" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BINVCD_QT" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/BRTNSVAL" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BRTNSQTY" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "KEY_BFABCUBE51"
, "KEY_BFABCUBE52"
, "KEY_BFABCUBE5T"
, "KEY_BFABCUBE5U"
)
USING
HASHING;
ALTER TABLE "/BIC/FBFABCUBE5" LOCKSIZE ROW;
ind: /BIC/FBFABCUBE5~0
ind: /BIC/FBFABCUBE5~02
sql: CREATE INDEX "/BIC/FBFABCUBE5~02" on "/BIC/FBFABCUBE5"
- 30 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
("KEY_BFABCUBE5T")
CLUSTER
ALLOW REVERSE SCANS;
ind: /BIC/FBFABCUBE5~03
The sql section below the “tab:” entry contains the CREATE TABLE statement with the
correct partitioning key. The ALTER TABLE statement sets the LOCKSIZE attribute to
ROW, indicating row level locking. This is always the case for non-MDC tables. For
MDC tables, the LOCKSIZE attribute might also be set t o BLOCKINSERT, indicating
MDC block locking.
The “ind:” entry for primary key index /BIC/FBFABCUBE5~0 contains no sql section.
Fact tables do not have a primary key index but standard R3load processing would
always create one. If there exists an entry for the index in the .SQL file 3load uses the
SQL statement in this entry. In this case the SQL statement is empty. Therefore the index
is not created.
The “ind:” entry for primary key index /BIC/FBFABCUBE5~02 contains the SQL
statement for creating the index on the time dimension key column as a clustered index.
In DB2 LUW, indexes on the unit dimension key column are not created. For this fact
table, index The “ind:” entry for primary key index /BIC/FBFABCUBE5~0 exists in the
Oracle database. The empty sql section avoids that the index is created in DB2 LUW.
If RSADMIN parameter DB6_PINDEX_ON_FTABLE was set to YES the following
DDL would be generated:
tab: /BIC/FBFABCUBE5
sql: CREATE TABLE "/BIC/FBFABCUBE5"
("KEY_BFABCUBE5P" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5T" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5U" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE51" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE52" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/BCRMEM_QT" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/BCRMEM_VA" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BINVCD_VA" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BINVCD_QT" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/BRTNSVAL" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BRTNSQTY" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
- 31 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
LONG IN "&locationL&"
PARTITIONING KEY ( "KEY_BFABCUBE51"
, "KEY_BFABCUBE52"
, "KEY_BFABCUBE5T"
, "KEY_BFABCUBE5U"
)
USING
HASHING
ALTER TABLE "/BIC/FBFABCUBE5" LOCKSIZE ROW;
ind: /BIC/FBFABCUBE5~0
sql: CREATE INDEX "/BIC/FBFABCUBE5~P" on "/BIC/FBFABCUBE5"
("KEY_BFABCUBE5T",
"KEY_BFABCUBE51",
"KEY_BFABCUBE52",
"KEY_BFABCUBE5U",
"KEY_BFABCUBE5P")
CLUSTER
ALLOW REVERSE SCANS;
ind: /BIC/FBFABCUBE5~03
The P index /BIC/FBFABCUBE5~P which does not exist in the source system is created as
clustered index. The SQL is stored under the entry for the primary key index
/BIC/FBFABCUBE5~0. Because the index does not exist in the source system no entry in
the R3load .TSK files is created for it. If it was stored under its own index name in the
.SQL files, R3load would never process it. When R3load executes the task to create the
primary key index /BIC/FBFABCUBE5~0, it uses the SQL statement to create the P index
instead.
An entry for index /BIC/FBFABCUBE5~02 is not needed because it is not created as
clustering index and therefore has no DB2 LUW specific features that R3load cannot
handle.
The following DDL is generated for a standard E fact table of an InfoCube that does not
use range partitioning:
tab: /BIC/EBFABCUBE5
sql: CREATE TABLE "/BIC/EBFABCUBE5"
("KEY_BFABCUBE5P" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5T" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5U" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE51" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE52" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/BCRMEM_QT" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/BCRMEM_VA" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
- 32 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
"/BIC/BINVCD_VA" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BINVCD_QT" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/BRTNSVAL" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BRTNSQTY" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "KEY_BFABCUBE51"
, "KEY_BFABCUBE52"
, "KEY_BFABCUBE5T"
, "KEY_BFABCUBE5U"
)
USING
HASHING;
ALTER TABLE "/BIC/EBFABCUBE5" LOCKSIZE ROW;
ind: /BIC/EBFABCUBE5~0
ind: /BIC/EBFABCUBE5~01
ind: /BIC/EBFABCUBE5~03
ind: /BIC/EBFABCUBE5~P
sql: CREATE UNIQUE INDEX "/BIC/EBFABCUBE5~P" on "/BIC/EBFABCUBE5"
("KEY_BFABCUBE5T",
"KEY_BFABCUBE51",
"KEY_BFABCUBE52",
"KEY_BFABCUBE5U",
"KEY_BFABCUBE5P")
CLUSTER
ALLOW REVERSE SCANS;
The sql section below the “tab:” entry contains the CREATE TABLE statement with the
correct partitioning key. The ALTER TABLE statement sets the LOCKSIZE attribute to
ROW, indicating row level locking.
The “ind:” entry for primary key index /BIC/EBFABCUBE5~0 contains no sql section.
This avoids that a primary key index is created for the table.
In DB2 LUW, indexes on the unit dimension key column are not created on F and E fact
tables and indexes on the package dimension key column are not created on E fact tables.
The empty sql sections prevent the indexes which exist in the source system from being
created in the DB2 LUW target database.
The “ind:” entry for index /BIC/FBFABCUBE5~P creates the P index on the E fact table as
clustering index with the correct column order for DB2 LUW.
InfoCube fact tables with range partitioning
- 33 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
The following DDL is generated for a standard F fact table of an InfoCube that uses
range partitioning if range partitioning is not converted to MDC:
tab: /BIC/FZTPHTGC1
sql: CREATE TABLE "/BIC/FZTPHTGC1"
("KEY_ZTPHTGC1P" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC1T" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC1U" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC11" INTEGER
DEFAULT 0 NOT NULL,
"SID_0CALMONTH" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/HTGKF1" INTEGER
DEFAULT 0 NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "KEY_ZTPHTGC11"
, "KEY_ZTPHTGC1T"
, "KEY_ZTPHTGC1U"
)
USING
HASHING;
ALTER TABLE "/BIC/FZTPHTGC1" LOCKSIZE ROW;
ind: /BIC/FZTPHTGC1~0
ind: /BIC/FZTPHTGC1~020
sql: CREATE INDEX "/BIC/FZTPHTGC1~020" on "/BIC/FZTPHTGC1"
("KEY_ZTPHTGC1T")
CLUSTER
ALLOW REVERSE SCANS;
ind: /BIC/FZTPHTGC1~900
The DDL is nearly the same as in the previous example with 2 exceptions:
• The table contains the additional column SID_0CALMONTH used for range
partitioning. This column remains in the table although DB2 LUW will not make
use of it.
• There is an additional entry with an empty sql section for index
/BIC/FZTPHTGC1~900 which exists in the source system but will not be created
in the DB2 LUW target system.
Range partitioning is implemented such that the E fact table is partitioned on the time
characteristic and the F fact table is partitioned on the package dimension key column. To
provide efficient access to the time characteristic column in the F fact table, the index
~900 is created in the Oracle system. In DB2 LUW the column will be maintained and
- 34 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
filled correctly but not used in SAP BI reporting. Therefore it is not necessary to create
an index on it.
The following DDL is generated for a standard F fact table of an InfoCube that uses
range partitioning if range partitioning is not converted to MDC:
tab: /BIC/EZTPHTGC1
sql: CREATE TABLE "/BIC/EZTPHTGC1"
("KEY_ZTPHTGC1P" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC1T" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC1U" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC11" INTEGER
DEFAULT 0 NOT NULL,
"SID_0CALMONTH" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/HTGKF1" INTEGER
DEFAULT 0 NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "KEY_ZTPHTGC11"
, "KEY_ZTPHTGC1T"
, "KEY_ZTPHTGC1U"
)
USING
HASHING;
ALTER TABLE "/BIC/EZTPHTGC1" LOCKSIZE ROW;
ind: /BIC/EZTPHTGC1~0
ind: /BIC/EZTPHTGC1~010
ind: /BIC/EZTPHTGC1~P
sql: CREATE UNIQUE INDEX "/BIC/EZTPHTGC1~P" on "/BIC/EZTPHTGC1"
("KEY_ZTPHTGC1T",
"KEY_ZTPHTGC11",
"KEY_ZTPHTGC1U",
"KEY_ZTPHTGC1P")
CLUSTER
ALLOW REVERSE SCANS;
The DDL is nearly the same as in the previous example with 2 exceptions:
• The table contains the additional column SID_0CALMONTH used for range
partitioning. This column remains in the table although DB2 LUW will not make
use of it.
• An entry with empty sql section for index /BIC/EZTPHTGC1~030 is not created
because the index does not exist in the source system.
InfoCube fact tables with range partitioning and conversion of range
partitioning to MDC
- 35 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Starting with the following support packages you can convert range partitioning on fact
tables to MDC:
• SAP BW 3.0B support package 34
• SAP BW 3.1 Content support package 28
• SAP NetWeaver ’04 BI support package 21
• SAP NetWeaver 2004s BI support package 13
You also need the following SAP BASIS support packages:
• SAP BASIS 620 support package 62
• SAP BASIS 640 support package 20
• SAP BASIS 700 support package 12
To convert range partitioning to MDC, enter RP_TO_MDC in the field Database Version
of report SMIGR_CREATE_DDL. Then the following output is created for the F fact
table of the previous example:
tab: /BIC/FZTPHTGC1
sql: CREATE TABLE "/BIC/FZTPHTGC1"
("KEY_ZTPHTGC1P" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC1T" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC1U" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC11" INTEGER
DEFAULT 0 NOT NULL,
"SID_0CALMONTH" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/HTGKF1" INTEGER
DEFAULT 0 NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "KEY_ZTPHTGC11"
, "KEY_ZTPHTGC1T"
, "KEY_ZTPHTGC1U"
)
USING
HASHING
ORGANIZE BY ( "KEY_ZTPHTGC1P"
, "SID_0CALMONTH"
);
ALTER TABLE "/BIC/FZTPHTGC1" LOCKSIZE BLOCKINSERT;
ind: /BIC/FZTPHTGC1~0
ind: /BIC/FZTPHTGC1~010
ind: /BIC/FZTPHTGC1~900
- 36 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
The CREATE TABLE statement for the F fact table contains the correct partitioning key
and the package dimension key column and the time characteristic column as MDC
dimensions (ORGANIZE BY clause). Furthermore the LOCKSIZE attribute is set to
BLOCKINSERT to support MDC fast roll-in.
The index /BIC/FZTPHTGC1~010 on the package dimension key column is not created
because this column is a MDC dimension and therefore has a MDC block index.
There is no entry for index /BIC/FZTPHTGC1~020. This index is not created as clustered
index because the table is an MDC table.
Again, the primary key index /BIC/FZTPHTGC1~0 and the index /BIC/FZTPHTGC1~900
on the time characteristic column SID_0CALMONTH are not created in the DB2 LUW
target database.
The following output is generated for the E fact table:
tab: /BIC/EZTPHTGC1
sql: CREATE TABLE "/BIC/EZTPHTGC1"
("KEY_ZTPHTGC1P" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC1T" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC1U" INTEGER
DEFAULT 0 NOT NULL,
"KEY_ZTPHTGC11" INTEGER
DEFAULT 0 NOT NULL,
"SID_0CALMONTH" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/HTGKF1" INTEGER
DEFAULT 0 NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "KEY_ZTPHTGC11"
, "KEY_ZTPHTGC1T"
, "KEY_ZTPHTGC1U"
)
USING
HASHING
ORGANIZE BY ( "SID_0CALMONTH"
);
ALTER TABLE "/BIC/EZTPHTGC1" LOCKSIZE BLOCKINSERT;
ind: /BIC/EZTPHTGC1~0
ind: /BIC/EZTPHTGC1~010
ind: /BIC/EZTPHTGC1~P
sql: CREATE UNIQUE INDEX "/BIC/EZTPHTGC1~P" on "/BIC/EZTPHTGC1"
("KEY_ZTPHTGC1T",
"KEY_ZTPHTGC11",
"KEY_ZTPHTGC1U",
"KEY_ZTPHTGC1P")
ALLOW REVERSE SCANS;
- 37 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
The CREATE TABLE statement contains the correct partitioning key and the time
characteristic column SID_0CALMONTH as MDC dimension. The P index
/BIC/EZTPHTGC1~P is created non-clustered.
For aggregates, the RSADMIN parameter DB6_MDC_FOR_AGGREGATES is not
evaluated. If RP_TO_MDC is selected, MDC for aggregate fact tables is generated if
these tables use range partitioning in the source system. Otherwise MDC is not generated.
Dimension tables
The following DDL is generated for dimension tables with more than one SID_...
column, if single-column indexes on the second, third, etc. SID_... columns do not exist
in the source system:
tab: /BIC/DBBLFAB51
sql: CREATE TABLE "/BIC/DBBLFAB51"
("DIMID" INTEGER
DEFAULT 0 NOT NULL,
"SID_ZCOORDER" INTEGER
DEFAULT 0 NOT NULL,
"SID_ZME_STATU" INTEGER
DEFAULT 0 NOT NULL,
"SID_ZCOUNTRY" INTEGER
DEFAULT 0 NOT NULL,
"SID_ZREGION" INTEGER
DEFAULT 0 NOT NULL,
"SID_ZEANUPC" INTEGER
DEFAULT 0 NOT NULL,
"SID_ZDISTR_CH" INTEGER
DEFAULT 0 NOT NULL,
"SID_ZFABSHPTO" INTEGER
DEFAULT 0 NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
LONG IN "&locationL&";
ALTER TABLE "/BIC/DBBLFAB51" LOCKSIZE ROW;
ind: /BIC/DBBLFAB51~0
sql: CREATE UNIQUE INDEX "/BIC/DBBLFAB51~0" on "/BIC/DBBLFAB51"
("DIMID")
ALLOW REVERSE SCANS;
ALTER TABLE "/BIC/DBBLFAB51"
ADD CONSTRAINT "/BIC/DBBLFAB51~0" primary key
("DIMID");
CREATE INDEX "/BIC/DBBLFAB51~020" on "/BIC/DBBLFAB51"
("SID_ZME_STATU")
ALLOW REVERSE SCANS;
CREATE INDEX "/BIC/DBBLFAB51~030" on "/BIC/DBBLFAB51"
("SID_ZCOUNTRY")
ALLOW REVERSE SCANS;
CREATE INDEX "/BIC/DBBLFAB51~040" on "/BIC/DBBLFAB51"
("SID_ZREGION")
ALLOW REVERSE SCANS;
- 38 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
tab: /BIC/AZFCT_R1000
sql: CREATE TABLE "/BIC/AZFCT_R1000"
("/BIC/BASIS6" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS7" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"CALDAY" SAPDB6VARCHAR(000008)
DEFAULT '00000000' NOT NULL,
"/BIC/AO1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS2" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS3" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/KLAMM1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/REF1B1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/REF2REF1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/KENNZ1" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/KENNZ2" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/KENNZ3" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/KENNZ4" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/KENNZ5" SAPDB6VARCHAR(000008)
- 39 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
ind: /BIC/AZFCT_R100001
sql: CREATE INDEX "/BIC/AZFCT_R100001" on "/BIC/AZFCT_R1000"
("/BIC/BASIS7")
ALLOW REVERSE SCANS;
The CREATE TABLE statement contains the correct partitioning key. The index
/BIC/AZFCT_R100001 which is unique on the source system has to be created non-
unique in DB2 LUW because it does not contain all partitioning key columns.
The following DDL is generated for the activation queue table if MDC for PSA tables is
activated with RSADMIN parameter DB6_MDC_FOR_PSA=YES:
tab: /BIC/AZFCT_R0540
sql: CREATE TABLE "/BIC/AZFCT_R0540"
("SID" INTEGER
DEFAULT 0 NOT NULL,
"DATAPAKID" SAPDB6VARCHAR(000006)
DEFAULT '000000' NOT NULL,
"RECORD" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/BASIS6" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS7" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"CALDAY" SAPDB6VARCHAR(000008)
DEFAULT '00000000' NOT NULL,
"/BIC/AO1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS2" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS3" SAPDB6VARCHAR(000010)
- 40 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
"/BIC/BASIS7" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/AO1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS2" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/BASIS3" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/KLAMM1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/REF1B1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/REF2REF1" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/KENNZ1" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/KENNZ2" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/KENNZ3" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/KENNZ4" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/KENNZ5" SAPDB6VARCHAR(000008)
DEFAULT '00000000' NOT NULL,
"/BIC/KENNZ6" SAPDB6VARCHAR(000006)
DEFAULT '000000' NOT NULL,
"/BIC/KENNZ7" INTEGER
DEFAULT 0 NOT NULL,
"CURRENCY" SAPDB6VARCHAR(000005)
DEFAULT ' ' NOT NULL,
"UNIT" SAPDB6VARCHAR(000003)
DEFAULT ' ' NOT NULL,
"RECORDMODE" SAPDB6VARCHAR(000001)
DEFAULT ' ' NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "/BIC/BASIS6"
, "/BIC/BASIS7"
)
USING
HASHING
ALTER TABLE "/BIC/AZFCT_R0600" LOCKSIZE BLOCKINSERT;
ind: /BIC/AZFCT_R0600~0
sql: CREATE INDEX "/BIC/AZFCT_R0600RD" on "/BIC/AZFCT_R0600"
("REQUEST",
"DATAPAKID",
"RECORD")
ALLOW REVERSE SCANS;
- 42 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 43 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "RECORD"
)
USING
HASHING;
ALTER TABLE "/BI0/B0000103000" LOCKSIZE ROW;
If DB6_MDC_FOR_PSA=YES and DB6_ROW_COMPRESSION=YES the following
DDL with an ORGANIZE BY clause and COMPRESS YES would be generated:
tab: /BI0/B0000103000
sql: CREATE TABLE "/BI0/B0000103000"
("REQUEST" SAPDB6VARCHAR(000030)
DEFAULT ' ' NOT NULL,
"DATAPAKID" SAPDB6VARCHAR(000006)
DEFAULT '000000' NOT NULL,
"PARTNO" INTEGER
DEFAULT 0 NOT NULL,
"RECORD" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/ZFABSHPTO" SAPDB6VARCHAR(000010)
DEFAULT ' ' NOT NULL,
"/BIC/ZEANUPC" SAPDB6VARCHAR(000018)
DEFAULT ' ' NOT NULL,
"/BIC/ZCOORDER" SAPDB6VARCHAR(000012)
DEFAULT ' ' NOT NULL,
"/BIC/ZREGION" SAPDB6VARCHAR(000003)
DEFAULT ' ' NOT NULL,
"/BIC/ZDISTR_CH" SAPDB6VARCHAR(000002)
DEFAULT ' ' NOT NULL,
"CALDAY" SAPDB6VARCHAR(000008)
DEFAULT ' ' NOT NULL,
"/BIC/ZME_STATU" SAPDB6VARCHAR(000002)
DEFAULT ' ' NOT NULL,
"/BIC/ZCRMEM_VA" SAPDB6VARCHAR(000017)
DEFAULT ' ' NOT NULL,
"CURRENCY" SAPDB6VARCHAR(000005)
DEFAULT ' ' NOT NULL,
"/BIC/ZCRMEM_QT" SAPDB6VARCHAR(000017)
DEFAULT ' ' NOT NULL,
"UNIT" SAPDB6VARCHAR(000003)
DEFAULT ' ' NOT NULL,
"/BIC/ZINVCD_VA" SAPDB6VARCHAR(000017)
DEFAULT ' ' NOT NULL,
"/BIC/ZINVCD_QT" SAPDB6VARCHAR(000017)
DEFAULT ' ' NOT NULL,
"/BIC/ZRTNSVAL" SAPDB6VARCHAR(000017)
DEFAULT ' ' NOT NULL,
"/BIC/ZRTNSQTY" SAPDB6VARCHAR(000017)
DEFAULT ' ' NOT NULL,
"/BIC/ZCOUNTRY" SAPDB6VARCHAR(000003)
DEFAULT ' ' NOT NULL)
IN "&location&"
- 44 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "RECORD"
)
USING
HASHING
ORGANIZE BY ( "REQUEST"
)
COMPRESS YES;
ALTER TABLE "/BI0/B0000103000" LOCKSIZE BLOCKINSERT;
PSA tables use no other DB2 LUW specific features.
Figure 10: Source Database Export with SAP NetWeaver '04 SAPinst
- 45 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
R3load based database export is not fully supported for SAP Business Information
Warehouse 3.0B and 3.1 Content. It is recommended to export the source database with
the SAPinst tool of R/3 Enterprise 4.7 Service Release 1 instead.
- 46 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
deciding about splitting packages for the export and determining the optimal unload
order. The report provides the following information:
InfoCubes sorted by number of rows in the fact tables
Aggregates of InfoCubes
DataStore tables sorted by size or alphabetically
PSA tables sorted by size or alphabetically
Display of the fragments of a table
Speed up export of very large tables
There are several options to speed up the export of very large tables:
1. Export them unsorted. This is possible for most tables except for a few ones that
are listed in the SAP documentation.
2. Use a SELECT Statement to split the table contents into several parts that can be
exported in parallel.
3. If the table is fragmented or range partitioned you can export the table fragments
or ranges in parallel
- 47 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 48 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Figure 13: SAP NetWeaver 2004s - Exit for creating additional database partitions
If you want to create a multi-partition DB2 database you cancel the installation at this
step and create the additional database partitions on the same server or additional servers.
You create the additional partitions with the task Additional Database Partitions of
SAPinst, as shown in Figure 14. You have to run SAPinst on every database partition
server.
- 49 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 50 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Figure 15: SAP NetWeaver 2004s - Default mapping of database partition groups to partitions
The installation then continues with the creation of the database.
- 51 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 52 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 53 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 54 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 55 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Figure 20: SAP NetWeaver '04 – Exit for installing additional database partition servers
- 56 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
not store fact and DataStore/PSA data on database partition 0. Database partition 0
contains all SAP BASIS and master data tables and serves as the coordinator partition for
all connections to the database. This results in a high workload on this partition.
Furthermore, it makes sense to keep the data volume on partition 0 small to speed up
database backup. When taking backups, partition 0 has to be backed up first and then all
other partitions can be backed up in parallel. For more information about database
partition design see [6].
The database partition group for dimension tables resides on database partition 0 only.
We strongly recommend not changing this setting. Dimension tables should reside only
on database partition 0.
Information about the database partition groups of the source system is stored in the file
DBSIZE.XML in the DB/DB6 subdirectory of the export. For each tablespace, it contains
the database partition group to which the tablespace belongs in the Nodegroup field of the
tablespace XML description (see Figure 21).
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE tables SYSTEM "keydb.dtd" >
<tables>
<tableset srcid="this file was created by R3szchk.exe">
<table name="tDB6_TABLESPACES_DEFAULT" namespaces="DB6">
...
<row>
<fld name="TablespaceName">
<strval>
<![CDATA[SAPSID#FACTD]]>
</strval>
</fld>
<fld name="TablespaceSize">
<exp>( SWITCH ( getContextParameter('UNICODE') ) : (
CASE (= 'YES') RETURN ( '100' ),
CASE (DEFAULT) RETURN ( '100' ) )
)</exp></fld>
<fld name="NumberOfContainer">
<strval>
<![CDATA[1]]>
</strval>
</fld>
<fld name="TablespaceType">
<strval>
<![CDATA[FACT]]>
</strval>
</fld>
<fld name="Nodegroup">
<exp>
<![CDATA[('NGRP_FACT_'+UPPER(getContextParameter('cpSapSystemName')))]]>
</exp>
</fld>
</row>
Figure 21: Tablespace information with database partition group in DBSIZE.XML
- 57 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
If you migrate from another database platform, DBSIZE.XML only contains the default
database partition groups. If your source database is DB2 for LUW and you have defined
additional database partition groups there, DBSIZE.XML contains this information.
When you migrate from another database platform and you want to implement your own
tablespaces and database partition groups in the DB2 target database, you can handle this
as follows:
• SAPinst of SAP NetWeaver 2004s provides an exit step for manually creating
tablespaces. You can create your own database partition groups and tablespaces
in this exit step.
• For SAP NetWeaver ’04 and earlier releases, you can add your own database
partition groups and tablespaces manually to DBSIZE.XML, for example as
shown in Figure 22.
The distribution of database partition groups over database partitions is not defined in
DBSIZE.XML but only in the SAPinst dialog or directly at database level.
...
<row>
<fld name="TablespaceName">
<strval>
<![CDATA[SAPSID#MYTBSP]]>
</strval>
</fld>
<fld name="TablespaceSize">
<exp>( SWITCH ( getContextParameter('UNICODE') ) : (
CASE (= 'YES') RETURN ( '100' ),
CASE (DEFAULT) RETURN ( '100' ) )
)</exp></fld>
<fld name="NumberOfContainer">
<strval>
<![CDATA[1]]>
</strval>
</fld>
<fld name="TablespaceType">
<strval>
<![CDATA[FACT]]>
</strval>
</fld>
<fld name="Nodegroup">
<exp>
<![CDATA[('NGRP_MYGRP_'+UPPER(getContextParameter('cpSapSystemName')))]]>
</exp>
</fld>
</row>
Figure 22: Defining additional tablespaces and database partition group in DBSIZE.XML
- 58 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
A .STR file, which contains the structure of the tables and indexes as defined in
the SAP data dictionary of the source system.
One or more .<nnn> files, which contain the data to be imported
A .cmd file, which contains the locations of the data, structure, and task files
The file DDL<DBSYS>.TPL, which contains the templates for the DDL
statements of the target database platform <DBSYS>.
One or more .SQL files which contain the DDL generated on the source system.
Figure 23: Input files to R3load for importing the target database
Standard R3load processing extracts the structure of the tables and indexes from the .STR
file and generates the DDL for creating them from this information and the templates
stored in DDL<DBSYS>.TPL. With the introduction of the .SQL files this has changed.
For each table or index to be processed, R3load looks for the DDL for creating it in the
.SQL file and executes it if found. Otherwise, it creates the table or index based on the
.STR file and the statement template.
Let's return to one of the example from an Oracle to DB2 LUW migration from section
6.1 to see how R3load uses the generated DDL:
The following was the DDL created for the F fact table:
F fact table:
tab: /BIC/FBFABCUBE5
sql: CREATE TABLE "/BIC/FBFABCUBE5"
("KEY_BFABCUBE5P" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5T" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5U" INTEGER
- 59 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
ind: /BIC/FBFABCUBE5~0
sql: CREATE INDEX "/BIC/FBFABCUBE5~P" on "/BIC/FBFABCUBE5"
("KEY_BFABCUBE5T",
"KEY_BFABCUBE51",
"KEY_BFABCUBE52",
"KEY_BFABCUBE5U",
"KEY_BFABCUBE5P")
CLUSTER
ALLOW REVERSE SCANS;
ind: /BIC/FBFABCUBE5~03
The task file contains the following entries for the F fact table (T for table creation, D for
data import, P for primary key index, I for additional secondary indexes):
T /BIC/FBFABCUBE5 C xeq
D /BIC/FBFABCUBE5 I xeq
P /BIC/FBFABCUBE5~0 C xeq
I /BIC/FBFABCUBE5~01 C xeq
I /BIC/FBFABCUBE5~02 C xeq
I /BIC/FBFABCUBE5~03 C xeq
I /BIC/FBFABCUBE5~04 C xeq
I /BIC/FBFABCUBE5~05 C xeq
R3load creates table "/BIC/FBFABCUBE5" by executing the DDL stored for it in the
.SQL file. Thus, it creates the table with the correct partitioning key.
The next task is to load the data into the F fact table.
- 60 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
By default, there is a task for every table to create the standard primary key index 0.
R3load finds the entry for it in the .SQL file. The DDL stored for it creates the clustered
P index that didn't exist in the Oracle source system with the correct column order for
DB2. The standard primary key index is not created.
The task file contains no entry for the P index because it does not exist on the source
system. R3load then continues with the indexes 01 to 05. Index 03 is not created because
the section for it in the .SQL file contains no SQL statement. The other indexes are not
DB2 LUW specific, therefore no DDL statements are required for them.
The following was the DDL generated for the E fact table:
E fact table
tab: /BIC/EBFABCUBE5
sql: CREATE TABLE "/BIC/EBFABCUBE5"
("KEY_BFABCUBE5P" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5T" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE5U" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE51" INTEGER
DEFAULT 0 NOT NULL,
"KEY_BFABCUBE52" INTEGER
DEFAULT 0 NOT NULL,
"/BIC/BCRMEM_QT" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/BCRMEM_VA" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BINVCD_VA" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BINVCD_QT" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL,
"/BIC/BRTNSVAL" DECIMAL(000017,000002)
DEFAULT 0 NOT NULL,
"/BIC/BRTNSQTY" DECIMAL(000017,000003)
DEFAULT 0 NOT NULL)
IN "&location&"
INDEX IN "&locationI&"
LONG IN "&locationL&"
PARTITIONING KEY ( "KEY_BFABCUBE51"
, "KEY_BFABCUBE52"
, "KEY_BFABCUBE5T"
, "KEY_BFABCUBE5U"
)
USING
HASHING;
ALTER TABLE "/BIC/EBFABCUBE5" LOCKSIZE ROW;
ind: /BIC/EBFABCUBE5~0
ind: /BIC/EBFABCUBE5~01
ind: /BIC/EBFABCUBE5~03
- 61 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
ind: /BIC/EBFABCUBE5~P
sql: CREATE UNIQUE INDEX "/BIC/EBFABCUBE5~P" on "/BIC/EBFABCUBE5"
("KEY_BFABCUBE5T",
"KEY_BFABCUBE51",
"KEY_BFABCUBE52",
"KEY_BFABCUBE5U",
"KEY_BFABCUBE5P")
CLUSTER
ALLOW REVERSE SCANS;
The task file contains the following entries for the E fact table (T for table creation, D for
data import, P for primary key index, I for additional secondary indexes):
T /BIC/EBFABCUBE5 C xeq
D /BIC/EBFABCUBE5 I xeq
P /BIC/EBFABCUBE5~0 C xeq
I /BIC/EBFABCUBE5~01 C xeq
I /BIC/EBFABCUBE5~02 C xeq
I /BIC/EBFABCUBE5~03 C xeq
I /BIC/EBFABCUBE5~04 C xeq
I /BIC/EBFABCUBE5~05 C xeq
I /BIC/EBFABCUBE5~P C xeq
R3load creates table "/BIC/EBFABCUBE5" by executing the DDL stored for it in the
.SQL file. Thus, it creates the table with the correct partitioning key.
The next task is to load the data into the F fact table.
In the .SQL file, the entries for the standard primary key index 0 and the indexes 01 and
03 contain no SQL statement. Therefore these indexes are not created.
The indexes 02, 04 and 05 are not DB2 LUW specific, therefore no DDL statements are
required for them.
The entry for the P index contains the SQL statement to create it in the correct column
order for DB2 LUW.
In general, indexes are handled in the following way:
For non-existing primary key 0 indexes, an entry without DDL statement is
generated. By default, all SAP tables have a primary key index with label 0
defined over the columns marked as key columns in the SAP data dictionary.
However, for SAP BI fact tables this index is not created in the database. Standard
R3load processing would create it based on the information in the .STR file.
When R3load processes the index, it executes the empty DDL statement stored for
it in the .SQL file and thus does not create it.
For indexes that do exist on the source database system but are not required in the
target DB2 database, entries without DDL are generated as well. The indexes will
not be created in the database. SAP BI post processing later adapts the SAP data
dictionary to the state in the database, i.e. it deletes indexes from the SAP data
dictionary that do not exist in the target database.
- 62 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
The DDL for indexes that are required in the DB2 target database but that do not
exist in the source database is appended to the standard primary key 0 index. SAP
BI migration post processing later adds all indexes to the SAP data dictionary that
exist in the database but not in the dictionary.
If a table has a clustered index, it is not necessary to create it before the data is imported
into the table. When inserting into an empty table, DB2 does not take any specific steps
to preserve the clustering order.
R3load provides the following methods for importing data into DB2:
-loadprocedure dbsl: row by row insert
-loadprocedure fast: uses array insert to insert blocks of rows instead of single
rows. This is faster than -loadprocedure dbsl.
-loadprocedure fast LOAD: uses DB2 LOAD instead of SQL INSERT. For large
tables this is faster than -loadprocedure fast.
The following options are available for import into DB2 9 databases and support DB2 9
data row compression:
-loadprocedure fast COMPRESS
-loadprocedure fast LOADCOMPRESS
These options cause that for tables created with compression enabled (i.e. COMPRESS
YES), a compression dictionary is created after a certain number of rows has been
inserted or loaded. You can define the number of rows by setting the environment
variable DB6LOAD_COMPRESSION_THRESHOLD. The default value is 10,000 rows.
By default, SAPinst invokes R3load with -loadprocedure fast. You can change the default
by editing the SAPinst configuration file keydb.xml and changing the value of field
"loadOptions". This can speed up considerably the import of large SAP BI PSA,
DataStore and InfoCube fact tables. When changing the default settings for the
loadprocedure parameter, R3load will decide for each table whether to use DB2 LOAD
or not. For empty or very small tables it will use array insert because DB2 LOAD has
some overhead that makes it slower than array insert in these cases.
- 63 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
SAP OSS note 454173 contains important information about using R3load with DB2
LOAD. You should be aware of the following requirements and restrictions:
DB2 LOAD uses TCP/IP ports for internal communication. By default, the ports
6000 through 60063 are reserved for LOAD. In large multi-partition
environments, this might not be enough. The rule of thumb is to reserve #parallel
LOADs * #logical partitions + 25% TCP/IP ports for DB2 LOAD. You define the
ports for LOAD in DB2 registry variable DB2ADTLD_PORTS. For example, to
reserve the ports 60000 to 6127 set DB2ADTLD_PORTS=6000:6127.
When you use DB2 LOAD and create the indexes before loading the data a huge
amount of temporary space might be required for sorting.
This slows down the import considerably because the indexes have to be maintained. But
you save the index creation time after data import. Before changing the default behavior,
you should try out in the test migrations whether the performance of creating the indexes
before data import is acceptable or not.
- 64 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 65 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
no data can be loaded from the source systems into the migrated SAP BI system. If there
are any source systems not attached report RS_BW_POST_MIGRATION will abort.
Step 5: Deletion of SAP BI temporary tables
SAP BI temporary tables from the source system cannot be used in the target system. In
this migration post processing step they are deleted with report
SAP_DROPTMPTABLES.
Step 6: Repair of the InfoCube fact views
On each InfoCube and aggregate, a UNION ALL view is defined on the F and the E fact
table. The SAP data dictionary cannot handle UNION ALL views. During migration the
views are created incorrectly in the target database. This is corrected in migration post
processing by executing a report that drops and recreates them correctly in the target
database.
Step 7: Repair of partitioning column
This is a specific activity for inventory InfoCubes.
Step 8: Other database platform specific repairs
For DB2 LUW as target platform this consists of adding the correct options for collecting
statistics on SAP BI tables. For InfoCube fact and dimension tables and for master data
tables, distribution and detailed index statistics are collected. This information is stored in
table DBSTATC because it differs from the default. This migration post processing steps
creates the required entries in table DBSTATC for the tables affected.
When called with variant SAP&POSTMGR the report only executes the following tasks:
Step 5: Deletion of SAP BI temporary tables
Step 6: Repair of InfoCube fact views
Please note that it is very important that all migration post-processing steps are executed
successfully. Otherwise, unexpected errors will occur in the migrated system and it will
not be usable. RS_BW_POST_MIGRATION writes a log file and a spool file that you
should scan carefully for any error messages.
detect inconsistencies between the database and the SAP data dictionary after SAP BI
migration post processing. When you changed the database platform, before post
migration, there usually are inconsistencies due to the different implementations of SAP
BI on the different database platforms (Figure 24). After post migration no more
inconsistencies should exist (Figure 25). When you didn’t change the database platform,
also before post migration no inconsistencies should exist. When selecting the menu item,
always the saved state of the last execution is displayed. Click “Refresh” to determine the
current state.
Figure 24: DB6COCKPIT: Missing tables and indexes before post migration
- 67 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Figure 25: DB6COCKPIT: Missing tables and indexes after post migration
- 68 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Figure 26: RSRV: Checking database indexes of an InfoCube and its aggregates
- 69 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
Figure 27: RSRV: Checking database indexes of an InfoCube and its aggregates - Result
SAP note 1023410 implements conversion of range partitioning on the source system to
MDC on the DB2 target system.
MDC support for SAP BW 3.0B, SAP BW 3.1 Content, and SAP NetWeaver ’04 was
introduced with the following support packages:
Support package 32 for SAP BW 3.0B
Support package 26 for SAP BW 3.1 Content
Support package 18 for SAP NetWeaver ‘04
In these support packages and in support packages 1 to 9 for SAP NetWeaver 2004s,
MDC for PSA tables is the default. If you do not want the DDL created to contain MDC
for PSA tables you have to set DB6_MDC_FOR_PSA=NO on the source system before
executing SMIGR_CREATE_DDL.
This usually indicates that the partitioning keys of the tables distributed over the database
partitions are not correct. This happens if R3load does not apply the DDL statements
generated by report SMIGR_CREATE_DDL when creating the tables. This can have
several reasons:
• The .SQL files are not stored in the correct location (DB/DB6 subdirectory of
directory containing the source system export).
• The file access permissions prevent R3load from reading the files (the
<sapsid>adm user needs read access).
• The file names do not correspond to the data classes in which the tables reside
(R3load reads the DDL statements for tables and indexes in data class DFACT
from DFACT.SQL, etc.). Especially if you want to move tables to new data
classes you have to make sure that the DDL statements are available in a .SQL
file with the name of the new data class.
If you detect this problem after the import you can do nothing to repair it. You have to
drop the affected tables and repeat the import.
During R3load processing you have the following options for checking that the generated
DDL is used:
• Check the R3load log file. It contains a warning message when no file with DDL
statements to be applied is found.
• You can do some sanity checking: after one or a few tables in the task file have
been processed run the DB2 db2look tool for them and compare the output to the
DDL in the .SQL files.
- 71 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
After the import, you should always execute the function modules
RSDU_CHKREP_PKEY_ALL_CUBES_DB6,
RSDU_CHKREP_PKEY_ALL_PSA_DB6 and
RSDU_CHKREP_PKEY_ALL_ODS_DB6 in the target system to ensure that all
partitioning keys are correct.
If you are only doing a test migration where you cannot attach the source systems or you
want to fix this issue later and make sure that at least all other post migration steps are
executed completely, you can generate a new variant for RS_BW_POST_MIGRATION
that omits the generation of new PSA versions and run the report with this variant.
Currently it is not possible to selectively generate new PSA versions for some source
systems.
- 72 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
1. An SQL error occurs, indicating that the tablespaces for the tables do not exist.
You have not implemented SAP note 919530. When executing report
SMIGR_CREATE_DDL in the source system, entries in table DDSTORAGE for
DB6 were created. These entries contain the names of the tablespaces where the
tables resided in the source system. These tablespaces might not exist in the target
system. If during InfoCube or aggregate activation in the target system these
invalid entries are used an SQL error occurs.
2. The InfoCube contains data and the application log contains the error message
“structure change at field level” and the message that a table conversion has to be
run.
This may occur on SAP NetWeaver 2004s systems if you have not implemented
SAP note 1062348 or you have activated the InfoCube already once before you
implemented SAP note 1062348.
The error only occurs for InfoCubes that used range partitioning in the source
system and that were not converted to MDC. As shown in section 6.1.1, the
additional column used as partitioning column in the source system is not deleted
in the DB2 LUW target system. Also the information that the column exists in the
SAP BI metadata in table RSDCUBE is kept. Due to a program error fixed with
the SAP note this information is accidentally deleted when the InfoCube is
activated again. The first reactivation completes without error message but deletes
the metadata. The second activation tries to remove the partitioning column from
the fact tables which requires a table conversion if the tables contain data.
This problem also occurs on SAP NetWeaver 2004s for InfoCubes that used range
partitioning on the source system of the migration and is not solved yet. If the
InfoCube is empty in the development system and changed and reactivated there
the partitioning column is dropped and the SAP BI metadata updated accordingly.
- 73 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
If this definition is transported to a target system were the InfoCube contains data
the partitioning column cannot be dropped and the InfoCube activation fails.
9. Conclusion
This document has provided the details of the migration procedure for SAP BI and SAP
BI-based systems, when the target database platform is DB2 LUW. Compared to other
SAP system migrations, SAP BI system migrations require two additional steps to handle
database specific features and implementation differences on different database
platforms. The SAP BI information model and the implementation of SAP BI on DB2
LUW have been introduced briefly. The specific problems of SAP BI system migrations
have been discussed. The steps of the migration process, i.e. SQL generation, export of
the source database, installation and import of the target database, and SAP BI migration
post processing have been discussed. Hints and tips for speeding up the export of the
source database and the import into DB2 have been provided. Finally, transactions and
reports for checking the consistency of the DB2 LUW target database after a migration
have been described.
10. Literature
[1] SAP Service Marketplace, SAP NetWeaver BI section
(http://service.sap.com/bi), Services & Implementation - Migration
[2] General system copy information at the SAP Service Marketplace,
http://service.sap.com/systemcopy
[3] “System Copy Guide: System Copy for SAP Systems Based on SAP
NetWeaver 7.0 SR2 ABAP”, http://service.sap.com/instguides
[4] "Homogeneous and Heterogeneous System Copy for SAP Systems Based on
SAP Web Application Server 6.40", http://service.sap.com/instguides
[5] SAP Unicode Conversion Guides, http://service.sap.com/unicode@sap,
Unicode library - Unicode conversion library
- 74 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
[6] “Database administration Guide: SAP NetWeaver Business Intelligence 7.0 and
Higher — Administration Tasks: IBM DB2 for Linux, UNIX, and Windows”,
http://service.sap.com/instguides
[7] SAP NetWeaver Installation: “SAP NetWeaver 7.0 SR2 ABAP on AIX: IBM
DB2 Universal Database for UNIX and Window”,
http://service.sap.com/instguides
[8] “SAP NetWeaver ‘04 SR1: Installation Guide SAP Business Warehouse 3.5”,
http://service.sap.com/instguides
[9] SAP Installation Guide: SAP Business Information Warehouse Server 3.1 on
UNIX: IBM DB2 Universal Database for UNIX and Windows,
http://service.sap.com/instguides
[10] Kevin McDonald, Andreas Wilmsmeier, David C. Dixon, W.H. Inmon:
"Mastering the SAP Business Information Warehouse", Wiley Publishing Inc.,
2002
[11] “Building and Scaling SAP Business Information Warehouse on DB2 ESE”,
SG24-7094, IBM redbook, http://www.redbooks.ibm.com/
[12] IBM Redbook “SAP Solutions on IBM DB2 V8.2.2 Handbook", SG24-6765,
http://www.redbooks.ibm.com/
[13] Marianne Nesiem: " Copying Your SAP/R3 System Across Platforms Using
DB2 Universal Database V8 Redirected Restore",
http://www7b.software.ibm.com/dmdd/library/techarticle/0308nesiem/0308nesi
em.html, July 2003
[14] Andreas Christian, Karl Fleckenstein, Stefan Kammerer: “Performance Study
for SAP Business Information Warehouse on DB2 Universal Database EEE”
http://www7b.boulder.ibm.com/dmdd/library/techarticle/0208christian/0208chri
stian.html
- 75 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 76 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 77 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 78 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
All trademarks or registered trademarks mentioned herein are the property of their
respective holders.
The information in this presentation may concern new products that IBM may or may not announce.
Any discussion of OEM products is based upon information which has been publicly available and is
subject to change. The specification of some of the features described in this presentation may change
before the General Availability date of these products.
REFERENCES IN THIS PUBLICATION TO IBM PRODUCTS, PROGRAMS, OR
SERVICES DO NOT IMPLY THAT IBM INTENDS TO MAKE THESE AVAILABLE
IN ALL COUNTRIES IN WHICH IBM OPERATES.
IBM MAY HAVE PATENTS OR PENDING PATENT APPLICATIONS COVERING
SUBJECT MATTER IN THIS DOCUMENT.
THE FURNISHING OF THIS DOCUMENT DOES NOT IMPLY GIVING LICENSE
TO THESE PATENTS.
- 79 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
- 80 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24
Heterogeneous SAP NetWeaver BI System Copy to IBM SAP DB2 LUW Development
IBM DB2 for Linux, UNIX and Windows
not constitute an endorsement of such products by IBM. Sources for non-IBM list prices
and performance numbers are taken from publicly available information, including
vendor announcements and vendor worldwide homepages.
IBM has not tested these products and cannot confirm the accuracy of performance,
capability, or any other claims related to non-IBM products. Questions on the capability
of non-IBM products should be addressed to the supplier of those products.
- 81 -
© Copyright IBM Corporation, 2007 All Version 1.0
Rights Reserved. 2007-07-24