0% found this document useful (0 votes)
175 views31 pages

SAP System Copy With Db2 For Z - OS - Cookbook

This document provides guidance on using SAP's System Copy tool with Db2 for z/OS. It discusses using Fastload and zLoad utilities to export and import table data for a system copy. The document outlines preparation, export, and import phases for the process. It also provides specifics on configuring Fastload and troubleshooting potential issues.

Uploaded by

road11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
175 views31 pages

SAP System Copy With Db2 For Z - OS - Cookbook

This document provides guidance on using SAP's System Copy tool with Db2 for z/OS. It discusses using Fastload and zLoad utilities to export and import table data for a system copy. The document outlines preparation, export, and import phases for the process. It also provides specifics on configuring Fastload and troubleshooting potential issues.

Uploaded by

road11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

SAP System Copy with Db2 for z/OS

Cookbook

Version: 17-September-2019
www.sap.com/contactsap

© 2019 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP
SE or an SAP affiliate company.
The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its
distributors contain proprietary software components of other software vendors. National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or
warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The
only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty
statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional
warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or
any related presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation,
and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platforms, directions, and
functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without
notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or
functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ
materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, and they
should not be relied upon in making purchasing decisions.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names
mentioned are the trademarks of their respective companies.
See www.sap.com/copyright for additional trademark information and notices.
TABLE OF CONTENTS

1 INTRODUCTION ............................................................................................................................................... 6
1.1 Scope ................................................................................................................................................................ 6
1.2 Documentation................................................................................................................................................... 6
2 FASTLOAD AND ZLOAD WITH DB2 FOR Z/OS .............................................................................................. 7
2.1 Motivation .......................................................................................................................................................... 7
2.2 Prerequisites ...................................................................................................................................................... 7
2.3 Fastload ............................................................................................................................................................. 7
2.4 zLoad ................................................................................................................................................................. 8
2.5 Known Issues .................................................................................................................................................... 9
3 PREPARATION PHASE .................................................................................................................................. 10
3.1 Verifying the SAP Maintenance Level .............................................................................................................. 10
3.2 Deleting Obsolete Data and Objects................................................................................................................ 10
3.3 Identifying the Target Database ....................................................................................................................... 10
3.4 Changing the Db2 Parameter Settings ............................................................................................................ 11
3.5 Preparing for a Unicode Conversion ................................................................................................................ 11
3.6 Handling Table Storage Attributes ................................................................................................................... 11
3.7 Creating SQL Files .......................................................................................................................................... 11
4 EXPORT PHASE ............................................................................................................................................. 14
4.1 Getting SWPM ................................................................................................................................................. 14
4.2 Setting up File Systems ................................................................................................................................... 14
4.3 Preparing Table Splitting ................................................................................................................................. 14
4.4 Configuring the Database Instance Export ...................................................................................................... 16
4.5 Configuring Parameters for Splitting Tool ........................................................................................................ 17
4.6 Setting General Unload Parameters ................................................................................................................ 18
4.7 Updating Database Statistics ........................................................................................................................... 19
4.8 Executing the Export ........................................................................................................................................ 19
5 IMPORT PHASE.............................................................................................................................................. 20
5.1 Setting Up File Systems .................................................................................................................................. 20
5.2 Setting of Environment Variables..................................................................................................................... 20
5.3 Starting SWPM ................................................................................................................................................ 20
5.4 Merging Packages ........................................................................................................................................... 20
5.5 Moving through the SWPM Dialog Panels ....................................................................................................... 21
5.6 Reviewing the Import Parameter Summary ..................................................................................................... 21
5.7 Executing the Import ........................................................................................................................................ 21
6 MANUALLY STARTING THE MIGRATION MONITOR ................................................................................... 23
6.1 Choosing the SWPM Option ............................................................................................................................ 23
6.2 Waiting for SWPM Prompt ............................................................................................................................... 23
6.3 Logging On to the SAP NetWeaver Application Server ................................................................................... 24
6.4 Adjusting Migration Monitor Properties ............................................................................................................ 24
6.5 Starting the Monitor ......................................................................................................................................... 25
6.6 Restart the Monitor .......................................................................................................................................... 25
6.7 Finalizing SWPM ............................................................................................................................................. 25
7 SPECIFICS OF THE FASTLOAD PROCEDURE ............................................................................................ 26
7.1 Environment Variables..................................................................................................................................... 26
7.2 Creating the FTP Parameter File ..................................................................................................................... 27
7.3 Troubleshooting ............................................................................................................................................... 27

3
8 SPECIFICS OF THE ZLOAD PROCEDURE ................................................................................................... 29
8.1 Environment Variables..................................................................................................................................... 29
8.2 Troubleshooting ............................................................................................................................................... 29
9 APPENDIX....................................................................................................................................................... 30
9.1 Helpful SAP Notes ........................................................................................................................................... 30
9.2 List of Figures and Tables ............................................................................................................................... 31

4
Applies to:
SAP ABAP system copies targeting Db2 for z/OS. The techniques that are presented apply to Unicode
conversions, homogeneous system copies and database migrations.

Summary
This documentation is a technical guideline to copy SAP ABAP systems to Db2 for z/OS with a special focus
on downtime reduction. Furthermore, it provides detailed instructions on how to utilize the Fastload feature
(Db2 11) and zLoad feature (Db2 12).
Authors: Joachim Rese (IBM), Christian Brasse (SAP), Bernd Kohler (SAP)
Created on: 5-Oct-2010
Updated on: 17-Sep-2019

Author Bio
Joachim Rese is a software engineer at the IBM Böblingen Laboratory in Germany. He is a member of the
joint SAP on IBM Z platform team and has over 20 years of experience in the field of SAP on IBM Z. Joachim
holds degrees in mathematics and computer science from the University of Paderborn in Germany.
Christian Brasse joined SAP SE in 1999. Within the SAP on IBM Z porting team he is responsible for the
installation tools. He graduated from University of Paderborn in Germany.
Dr. Bernd Kohler has been with SAP SE since 1996. He heads the SAP on IBM Z platform team (jointly with
IBM’s Thomas Raith). Before becoming manager, he worked in a variety of development areas related to the
integration of SAP with IBM Z and Db2 for z/OS, in particular life-cycle management tools and downtime
minimization technologies. He holds a Ph.D. in theoretical physics.

Acknowledgement
Thanks to the following people. This documentation would not be possible without their contribution.
• Thomas Vogt, SAP SE
• Dr. Burkhard Diekmann, SAP SE
• Bernhard Glaser, SAP SE
• Jennifer Johnson, SAP SE
• Jörg Maier, SAP SE
• Johannes Schützner, formerly IBM Deutschland Research & Development GmbH
• Hung Nguyen, formerly Handl Technology Inc

5
1 INTRODUCTION

1.1 Scope
This documentation is a technical guideline for copying an SAP ABAP system to Db2 for z/OS as part of a
homogeneous system copy, system migration or Unicode conversion. It contains tips and tricks on how to
reduce the downtime to a minimum.
The scope of this documentation covers the export and import phases. Note that in particular a Unicode
conversion requires many more steps, in particular if the source system supports multiple languages. These
steps are not covered in this documentation. For more information related to Unicode, see section 1.2.

1.2 Documentation
The SAP System Copy Guide for your system and information about Unicode are available here:
• Search “System Copy - Target Databases Other than SAP HANA” at help.sap.com
• SAP Note 1738258
• SAP Globalization Services at https://support.sap.com/globalization → Unicode
This cookbook does not replace the above-mentioned documentation. Therefore, be sure to download and
consult the latest version of all relevant guides before starting out.

6
2 FASTLOAD AND ZLOAD WITH DB2 FOR Z/OS

2.1 Motivation
Per default, SAP’s System Copy using the Software Provisioning Manager (SWPM) employs SQL INSERT
for loading the exported data into the target database instance. The method requires frequent SQL COMMIT.
This is rock solid and best suited for small to medium sized systems (typically with up to 2 TB of data).
However, for larger systems SQL INSERT of mass data can take very long and heavily consume logging
volume space. Therefore, alternative load methods are preferable. For Db2 for z/OS, two technologies have
been integrated within the SAP kernel for exploitation by SWPM:
• Fastload – available for Db2 11 and introduced in section 2.3 “Fastload”
• zLoad – based on Db2 12 and introduced in section 2.4 ”zLoad”

2.2 Prerequisites
The following prerequisites must be met to use the Fastload/zLoad features described in the document:
• Target database: Db2 Version 11 or 12 (Db2 10 is out-of-service!)
• NetWeaver 7.00 and higher (ABAP stack)
• SAP kernel release 7.21 and higher
• See the following SAP Notes for latest information:
• Fastload: SAP Note 1062976
• zLoad: SAP Note 2837836
• Check Section 2.5 for known bugs

2.3 Fastload
The feature Fastload has been provided by SAP and IBM since Q3 2007. It is an extension to the standard
SAP system copy process. Using this feature, tables are populated by the Db2 LOAD utility instead of SQL
INSERT operations. As a result, elapsed time during import phase can be reduced considerably.
Furthermore, data can be loaded in compressed format and massive logging activity is avoided. An
additional advantage is that the Db2 LOAD utility builds indexes very quickly.
In Q4 2008 two major enhancements were introduced: Exploitation of z/OS Unix System Services (USS)
named pipes and trusted record format.
The technical details of Fastload are depicted in Figure 1. If the table size exceeds a given threshold, R3load
does not use SQL INSERT to put data into Db2. Instead, data is converted into a format that can be read by
the Db2 LOAD utility. Using ftp that data is transferred into named pipes in the z/OS Unix System Services
(z/OS USS) area of the database host. In a parallel process, the Db2 LOAD utility (started by DSNUTILU)
reads that data from the named pipes and loads it into the table. For both tasks, R3load forks into processes
running the tool db2radm which is part of the SAP kernel.

7
Figure 1: Schematic Overview of Fastload (showing a Unicode conversion)

2.4 zLoad
With Db2 12, zLoad has been introduced. It shares the basic concepts of Fastload, e.g. the usage of the Db2
LOAD utility, but the setup has been heavily simplified, as setting up of named pipes and ftp is no longer
required (refer to Figure 2 for a schematic overview). Instead, data transfer and process control are managed
by Db2 Connect.
zLoad became available with Db2 Version 12 and SWPM 1.0 SP26. All application server platforms are
supported: AIX, Linux (x86, Power Little Endian, IBM Z) and Windows.
We highly encourage customers to use Db2 12 jointly with zLoad for their system copy projects.

8
Figure 2: Schematic Overview of zLoad (showing a Unicode conversion)

2.5 Known Issues


The following list contains important bug fixes. Please verify that the corresponding patches are applied to
your system before you start using Fastload or zLoad.

Db2 APAR Db2 Version / Description


SAP Patch Method
SAP Note 2831836 Db2 11 Fastload db2radm: jcl submission error
SAP Note 2813146 Db2 12 zLoad zLoad fails with SQL error = -89989

Table 1: Bug Fixes for System Copy

9
3 PREPARATION PHASE

3.1 Verifying the SAP Maintenance Level


Ensure that the SAP Support Packages (SPs) and ABAP Corrections listed in the following SAP Notes have
been applied to the source system. The required SAP maintenance level depends on the database version
of the target system:
• Db2 11: SAP Note 1850404 (with SP levels from SAP Note 1480594)
• Db2 12: SAP Note 2303027 (with SP levels from SAP Note 1480594)

3.2 Deleting Obsolete Data and Objects


In order to ensure good performance of your SAP system and to reduce costs at the same time, you should
delete obsolete data from your system on a regular basis. However, before running a Unicode conversion it
is even more important to get rid of data that is not needed anymore, because that way the downtime of the
conversion process might be reduced considerably.
• Download the latest Data Management Guide from SAP:
https://wiki.scn.sap.com/wiki/display/TechOps/Data+Volume+Management
• Find the largest tables in your system and for each table check whether there is a recommendation
in the Data Management Guide regarding reducing the size of that table.
On an SAP BW system, perform the following tasks additionally:
• Delete obsolete data from all BW objects, in particular PSA.
• Run ABAP Report SAP_DROP_TMPTABLES (with all table types selected) before starting the export.

3.3 Identifying the Target Database


For a Unicode conversion or a system copy you need to consider where your target SAP system will reside:
Different Db2 subsystem
• Source and target system can have the same SAP system name (SAP SID) and database schema.
Db2 subsystem IDs must be different if the source and target Db2 systems are in the same Sysplex.
• You can run export and import in parallel. You must adjust programs and scripts that refer to or
connect to the Db2 subsystem.
Same Db2 subsystem and same SAP system name
• The source system is replaced by the target system.
• Export and import cannot run in parallel.
• After export, you drop the source system using either SAP or Db2 means.
• No temporary DASD storage is needed for the Unicode conversion.
• SAP SID, Db2 subsystem id and database schema are not changed.
• If you choose this option, you need to plan for a fallback scenario (Db2 restore).
Same Db2 subsystem with a (temporary) different DB schema
• You can install the target system into the Db2 subsystem of the existing source system. However,
the database schema of target and source system must be different.
• You can run export and import in parallel. The source system must be deleted from the Db2
subsystem using SWPM after the Unicode conversion is complete, in other words, at uptime.
• Optionally, change the database schema of the target system back to the original schema after the
source system has been deleted.
o Run REORG on SYSIBM.SYSDBASE.

10
o Run the CATMAINT utility and utilize option SCHEMA SWITCH. For more information, see the
SAP System Copy Guide for guidance.

3.4 Changing the Db2 Parameter Settings


You must make sure that the following Db2 parameters are set:
• STORTIME=NOLIMIT, if Fastload is utilized

• MGEXTSZ=YES

3.5 Preparing for a Unicode Conversion


A Unicode conversion involves a great deal of preparation before the database export can be started. This is
in particularly true if the system supports several codepages (multi display multi-processing – MDMP).
However, also when converting a single-codepage system to Unicode, several tasks need to be performed in
the source system. Otherwise, either the import or the export will fail. Guidance for running the necessary
preparatory steps is not in the scope of this paper. However, for more information, see the SAP Unicode
Conversion Guide that is relevant for your system.

Note: Do not run ABAP Report SMIGR_CREATE_DDL (see section 3.7) before the preparation steps have
been successfully finished. Otherwise the layout of some pool tables might be incorrect in the target
system.

3.6 Handling Table Storage Attributes

Note: You need to clean table DDSTORAGE before running report SMIGR_CREATE_DDL. Therefore, delete all
rows from table DDSTORAGE before you proceed.

Often storage attributes of tables are not optimal, for example the way that partitions are defined. If you want
some storage parameters in the target system to be different from the source system, modify and save these
within the database utility (transaction SE14). You should not adjust the database after saving the modified
storage parameters, since it would trigger a long running data conversion process. The saved modifications
are read by report SMIGR_CREATE_DDL that generates appropriate SQL DDL (data definition language)
statements (see section 3.7).
The technique described above is particularly helpful in the following cases:
• If you utilize Fastload/zLoad, you should turn secondary indexes on a partitioned table into DPSIs
(data partitioned secondary indexes). You should also turn the primary index into a DPSI. This
increases performance of the index build phase of the Db2 LOAD utility and also avoids the logging
that occurs when an NPI (non-partitioned index) is built.
• Some tables in the source system may have exceeded the 64GB limit and therefore have been
historically partitioned by ranged. With Db2 11 and higher partition-by-range is not necessary for
large tables anymore. Turn these tables into partition-by-growth tablespace (which can hold up to
128TB).
Please note, that if you do not change the storage attribute of a range partitioned table, the table will be
range partitioned in the target system, even though partition-by-growth is activated.
After report SMIGR_CREATE_DDL has run, you should delete the saved (but not activated) storage parameters
by deleting the corresponding records from table DDSTORAGE (either with database means or within
transaction SE14).

3.7 Creating SQL Files


This step is necessary to preserve Db2 specific table attributes – for example partitioning. This is mandatory
for all systems that contain at least one SAP BW object (infocube, etc.).

11
Note: If you do not carry out this step, all Db2 tables in the target system have default settings (not
partitioned, DSSIZE 4G, default bufferpool).

Note: This step must be performed immediately before downtime if the application utilizes SAP BW
technology, like BW, SRM and SEM. Otherwise system activity might change the layout of some
tables, thus the generated *.SQL files become obsolete and the import phase fails.

To create the <Table Category>.SQL files:


1. Implement SAP Note 1586409.
2. Run ABAP report SMIGR_CREATE_DDL. This report generates <table category>.SQL files that
contain SQL DDL (data definition language) statements for all tables with special attributes. In the
import phase, R3load reads these files and executes the DDL statements.

Figure 3: Report SMIGR_CREATE_DDL


3. Select DB2 as Target Database and choose the Database Version of the target system.
• You can also choose BI settings in addition to the Db2 version. If you choose the option BI
settings, BI tables obtain the attributes that are defined in parameter table RSADMIN,
regardless of what these table attributes in the source Db2 look like.
• Choose BI settings only for BI tables or table categories that contain BI tables (i.e. by default
DFACT, DDIM and DODS).

• In general, we recommend that you do not choose the option BI settings, thus all table
attributes are copied from source to target system.

12
4. Select Unicode Migration in the screen Additional Parameters and choose a directory to which the
<table category>.SQL files should be written. User <sid>adm must have the permission to write
into that directory.
5. If there is only a single table within a table category, enter the table name in the section Optional
Parameters. Otherwise specify a table category, but no table name. All tables in that table category
are checked for Db2-specific attributes.
6. You need to run this report for all tables / table categories with table attributes that you would like to
retain. If you specify neither a table category nor a table name, all tables are checked for Db2
specific table attributes. For each table category that has at least one table with Db2 specific
attributes, a <table category>.SQL file is written.

Note: We recommend that you specify neither a table category nor a table name and run the
report only once in order to generate all necessary <table category>.SQL files.

7. Since bufferpool assignments are copied, you must ensure that all relevant bufferpools are active in
the target system. Therefore, we recommend that you copy bufferpool settings from the source
system to the target system before the import phase is started.

13
4 EXPORT PHASE

4.1 Getting SWPM


We recommend to always use most recent SP level of SAP SWPM. For details refer to:
https://support.sap.com/en/tools/software-logistics-tools.html
The subsequent screenshots were generated
• with SAP NetWeaver 7.40 SR2
• using SL Toolset SP27.

4.2 Setting up File Systems


Set up the following file systems:
• Ensure that the installation directory <SWPM_INSTDIR_EXP> has approximately 2 GB of free space.
The value of <SWPM_INSTDIR_EXP> is determined by the following environment variables.

OS Environment Variable Usual Value

Unix TMP /tmp

Windows %PROGRAMFILES% C:\Program Files

• <EXPDIR> with free space of approximately 1/8 of the uncompressed database size.
Subsequently, execute the following option on the SWPM welcome screen:
<YOUR PRODUCT> → IBM Db2 for z/OS → System Copy → Source System → Based on
AS ABAP → Export Preparation
With this option, SWPM creates the directory structure <EXPDIR>/ABAP/…

4.3 Preparing Table Splitting


You can exploit the table splitting functionality to process large tables within multiple R3load packages.

Note: Fastload and zLoad do not support parallel processing of split tables that are not ranged partitioned.
In other words, non-partitioned split tables are processed by SQL INSERT processing.

Be sure to use the table splitting feature selectively. Split only those tables that tend to dominate the
aggregate elapsed time of either export or import phase. Tables that are candidates for splitting are the
following:
• Large tables
• Partitioned tables
• Tables with LOB columns and high export time
• Cluster tables (often have a high export elapsed time in Unicode conversion)

Note: Fastload does not support split tables with a LOB column. A split table with a LOB column is always
imported by SQL INSERT processing.

Note: Do not utilize table splitting if you cannot identify an appropriate candidate.

14
For each table that is split in n packages, the files <table name>-[1..n].WHR, must exist in directory
<EXPDIR>/ABAP/DATA. These files contain a WHERE condition that represents the content of a package. The
tool R3ta generates these files.
You proceed as follows to configure R3ta and run it via SWPM:
• You must create file <R3ta_input> in directory <SWPM_INSTDIR_EXP> that contains the line
<table name>%<number of packages>

for each non-partitioned table that is supposed to be split. Dependent on the data distribution, it is
possible that the actual number of packages created by R3ta differs from the number specified in file
<R3ta_input>.

• For each partitioned table, add the line


<table name>+<number of partitions>

The plus sign (+) instead of the percent (%) instructs R3ta to define packages according to partition
ranges. In other words, a partitioned table is split in a way that each package contains exact the data
of exactly one partition.
Ensure that <number of partitions> is indeed the number of partitions of the table. The following
SQL statement generates the necessary information for partition tables.
SELECT TAB.NAME || '+' || CHAR(COUNT(*))
FROM SYSIBM.SYSTABLES TAB,
SYSIBM.SYSTABLEPART PRT
WHERE TAB.DBNAME = PRT.DBNAME AND
TAB.TSNAME = PRT.TSNAME AND
PRT.PARTITION >= 1 AND
TAB.TYPE = 'T' AND
TAB.CREATOR = '<DB schema>'
GROUP BY TAB.NAME
HAVING COUNT(*) > 1

where <DB schema> is the database schema of all SAP tables.


For non-partitioned tables, you need to add the information manually to file <R3ta_input>.
• For non-partitioned tables, you may also want to create the file R3ta_hints.txt to limit the set of
columns that can be taken by R3ta to generate a WHERE condition. The file R3ta_hints.txt is
ignored for partitioned tables.
• On each non-partitioned table that is split, you must also create a temporary index on the split
column to increase read performance. Use R3load to create that index, see the SAP System Copy
Guide for guidance. You should not, however, create this index on tables that are always exported
sorted, in particular cluster tables. Sorted export should be supported by the primary index to avoid
time consuming explicit sorts.
You do not need to create such an index on a table that is split according to partition boundaries.
• Select the following option on the SWPM welcome screen:
<YOUR PRODUCT> → IBM Db2 for z/OS → System Copy → Source System → Based on AS
ABAP → Table Splitting Preparation
• Execute SWPM to completion after specifying the parameters for table splitting (Figure 4):
o Enter <R3ta_input> for File with tables to be split.
o Enter <EXPDIR> for Export Directory.

15
Figure 4: SWPM Dialog – Table Splitting Preparation

4.4 Configuring the Database Instance Export


See SAP System Copy Guide for documentation about system copy / Database Instance Export with SWPM.
To configure database instance export. Select the following option on the SWPM welcome screen:
<YOUR PRODUCT> → IBM Db2 for z/OS → System Copy → Source System → Based on AS
ABAP → Database Instance Export
When specifying the database system parameters, ensure that Split STR files is selected (Figure 5).
Perform at least the first test run with an automatic start of the Migration Monitor, i.e. do not choose Start
Migration Monitor manually. Keep the configuration file export_monitor_cmd.properties for reference and
use it as a starting point for subsequent runs with manually started Migration Monitor.

16
Figure 5: SWPM Dialog – SAP System Export for Target System

4.5 Configuring Parameters for Splitting Tool


Enter the parameters for the Java splitting tool in the dialog shown below (Figure 6)
1. To archive a more uniform distribution of workload to the packages, you should increase Number of
Tables to Be Extracted to 100 (for example) to generate more, but smaller packages.
2. In addition, you should limit the size of packages. Package size refers to size of data as indicated in
the file <EXPDIR>/ABAP/DB/DB2/<package_name>.EXT. The size of a package including indexes
inflates by a factor of 3 to 10 in Db2. In other words, a package of 500 MB contributes up to 5 GB to
the final database size.
3. If you are utilizing table splitting, you must ensure that there is a dedicated package for each table
that is split.
4. Check Split predefined tables and provide a text file that contains a line with the table name for at
least each split table. Use <EXPDIR>/ABAP/DATA/whr.txt as Table Input File, unless you want to
explicitly define more than the split tables for separation into a dedicated package (see Figure 6).

17
Figure 6: SWPM Dialog – Split STR Files

4.6 Setting General Unload Parameters


It is important that you choose Use Unsorted Unload (as shown in Figure 7) for better performance and less
resource consumption (e.g. I/O operations). Some specific tables within the SAP system do not support
unsorted export, for example cluster tables. The R3load program is aware of these tables and will unload
them ordered independent from the general setting.

18
Figure 7: SWPM Dialog – Unload Settings

4.7 Updating Database Statistics


Continue to specify the input values in the SWPM dialog panels. Choose whether you would like to update
database statistics (RUNSTATS).

Note: A statistic update is not needed for the complete system if you run an unsorted unload as
recommended (Figure 7). Ensure however that the database statistics for all SAP cluster tables are
up-to-date.

4.8 Executing the Export


After having finished the definition of all parameters the execution will start. If you chose to start and
configure the Migration Monitor manually, you will be prompted to do so. Refer to Section 6 for details on
how to proceed.
SWPM creates the file export_monitor_cmd.properties in the log directory.
Also, SWPM generates two template files in <EXPDIR>/ABAP/DB: DDLDB2.TPL (with parameter
ORDER_BY_PKEY) and DDLDB2_LRG.TPL (without parameter ORDER_BY_PKEY). If ORDER_BY_PKEY is specified
the data export is done sorted by the primary index (~0). You should generally export the source system in
an unsorted manner (see SWPM setting in Figure 7), therefore the relevant template file is DDLDB2_LRG.TPL.
The ddlFile setting within file export_monitor_cmd.properties is specified accordingly.
Note that the number of parallel jobs can be adjusted dynamically (parameter jobNum) within command file
export_monitor_cmd.properties while the export is running.

19
5 IMPORT PHASE

5.1 Setting Up File Systems


Ensure that the installation directory <SWPM_INSTDIR_IMP> has approximately 2 GB of free space. The value
of <SWPM_INSTDIR_IMP> is determined by the following environment variables.

OS Environment Variable Usual Value

Unix TMP /tmp

Windows %PROGRAMFILES% C:\Program Files

5.2 Setting of Environment Variables


Set the environment variables required for Fastload/zLoad (check column “Required” in Table 2 & Table 3!):
• Fastload (Db2 11) → Section 7.1 (Table 2)
• zLoad (Db2 12) → Section 8.1 (Table 3)
For both methods, environment variable dbs_db2_fld_thr specifies the minimum number of table rows
which triggers the use of Fastload/zLoad. Due to some overhead for data conversion the load technologies
are only beneficial for larger tables. A setting of dbs_db2_fld_thr=50000 is considered to be a good starting
point.

5.3 Starting SWPM


Use the version of SWPM employed for the export phase (see Section Export Phase on page 4). To select
database instance import, select one of the following two options on the SWPM welcome screen:
• <YOUR PRODUCT> → IBM Db2 for z/OS → System Copy → Target System → Standard System
→ Based on AS ABAP → Standard System
• <YOUR PRODUCT> → IBM Db2 for z/OS → System Copy → Target System → HA System →
Based on AS ABAP → Database Instance

5.4 Merging Packages


If system copy option “parallel export and import” is not utilized, it is possible to import all packages that
belong to a split table within one Db2 LOAD call. For this, you need to merge the packages of a split table
into one single package. SAP provides a tool to achieve this. Proceed as follows:
1. The file TOCFileMerger.jar is attached to SAP Note 1115173. Download this file into directory:
<SWPM_INSTDIR_IMP>/sapinst_instdir/…/AS-ABAP.
2. Run the tool by executing the following command:
java TOCFileMerger.jar –path <EXPDIR>/ABAP/DATA

This command merges all packages of each split table into a single package.
3. In case, some partitioned tables are extremely large and importing them within a single package
would dominate the elapsed time of the import phase, you should utilize the option –leaveTables to
exclude the corresponding packages from being merged:
java TOCFileMerger.jar –path <EXPDIR>/ABAP/DATA
–leaveTables HUGE_TAB1,HUGE_TAB2

20
5.5 Moving through the SWPM Dialog Panels
In generally, there is no need to start the Migration Monitor manually, in particular if it is the first test import.
Therefore, leave the related check box on panel SAP System Database unmarked (see Figure 8).

Figure 8: SWPM Dialog – SAP System Database

5.6 Reviewing the Import Parameter Summary


Once all parameters are specified, SWPM provides a summary (see ). Carefully review and – if necessary –
adjust the settings. Subsequently, choose Next to execute the service.

Figure 9: SWPM Dialog – Parameter Summary

5.7 Executing the Import


SWPM runs automatically through all required installation steps. Once it has reached the phase ABAP
Import, you can check the import monitor status by carrying out the steps below:

21
• To check the status of the export process, see file import_state.properties. This file contains the
import status per package. Each entry looks like
<package name>={0|+|-|?}

The package import is either not yet started (0), successful (+), unsuccessful (-), or currently
running (?).
To see the packages that are currently loading (Unix):
grep –e "=?" import_state.properties

To see in Unix the number of failed packages (Unix):


grep –e "=-" import_state.properties | wc –l

• Only Fastload
For each package that is loaded with Fastload, the following files are written in the installation
directory:
fldlogs/<package name>.mkussfifo.<id>
fldlogs/<package name>.ftp.<id> and
fldlogs/<package name>.loader.<id>

The latter contains the LOAD utility output, for example:


TEMPLATE DATAFIL PATH='/usr/temp/ATAB.P32684' PATHOPTS=ORDONLY
FILEDATA=RECORD PATHDISP=(,KEEP)...
LOAD DATA INDDN DATAFIL [...]
[...]
DSNU010I DSNUGBAC - UTILITY EXECUTION COMPLETE,
HIGHEST RETURN CODE=0

Check file fldlogs/<package name>.ftp.<id> to verify that z/OS USS named pipes have been
utilized, for example:
[...]
This is db2radm executing file upload for loader.
[...]
FTP read :200 Representation type is Image
FTP read :local: | cat ATAB.32684 remote: /usr/temp/ATAB.P32684
FTP read :229 Entering Extended Passive Mode (|||3380|)
FTP read :125 Appending to named pipe /usr/temp/ATAB.P32684
FTP read :250 Transfer completed successfully.
FTP read :226960 bytes sent in 00:01 (122.77 KB/s)
FTP read :200 SITE command was accepted
FTP read :200 SITE command was accepted
Upload of file <ATAB.32684> to file /usr/temp/ATAB.P32684 is successful.
db2radm finished (0000)
db2radm stop:21.09.2019 12:30:11

For an overview on all tables that have been imported so far using Fastload (including start and end
time), see Db2 table DB2FLDPROT. A “D” in field STATUS indicates that the stored procedure that runs
the LOAD utility has finished without errors. (That does not imply that the LOAD utility has finished
successfully).
Note that the number of parallel jobs can be adjusted dynamically (parameter jobNum) within command file
import_monitor_cmd.properties while the import is running.
For troubleshooting, refer to Sections 7.3 (Fastload) and 8.2 (zLoad).

22
6 MANUALLY STARTING THE MIGRATION MONITOR
The following sections describe how to manually start the migration monitor. The related steps are very
similar for the two system copy scenarios Export and Import.

6.1 Choosing the SWPM Option


To manually run the Migration Monitor, mark the related entry within the SWPM dialog panels:
• Export: SAP System Export for Target System (Figure 5)
• Import: SAP System Database (Figure 10).

Figure 10: SWPM Dialog – Database Installation Method


That way you are able to change settings in the following command files beforehand:
• Export: export_monitor_cmd.properties
• Import: import_monitor_cmd.properties

6.2 Waiting for SWPM Prompt


A dialog window appears in phase Export ABAP (Figure 11) / Import ABAP (Figure 12). Keep this dialog
window open until all remaining steps in this section are complete, in other words until the manual call of the
Migration Monitor has finished successfully.

23
Figure 11: SWPM Dialog – Export ABAP

Figure 12: SWPM Dialog – Import ABAP

6.3 Logging On to the SAP NetWeaver Application Server


1. Logon as root user and give all access permissions to the installation directory to all users:
• Export: chmod 777 <SWPM_INSTDIR_EXP>/sapinst_instdir/…/AS-ABAP/EXP
• Import: chmod 777 < SWPM_INSTDIR_IMP>/sapinst_instdir/…/SYSTEM/…/AS-ABAP
2. Logon as <sid>adm. to the source (Export) / target (Import) system.
3. Change to the installation directory (path described in Step 1.)
4. Only Import: Set the environment variables required for Fastload (Db2 11: Table 2) and zLoad (Db2
12: Table 3).
5. Only Import with Fastload: Generate configuration file param.ftp and download kernel library
db2jcllib.*. Refer to Section 7.2 for details.
6. Perform all subsequent steps in this environment.

6.4 Adjusting Migration Monitor Properties


In the log directory, SWPM created the following command files for the Migration Monitor:

24
• Export: export_monitor_cmd.properties
• Import: import_monitor_cmd.properties
Refer to the SAP System Copy Guide for details on how to adjust these files. If system resources allow, the
number of parallel jobs (jobNum) can be considerably higher than the default 10. This is the most important
tuning parameter in reducing the elapsed time of the export and import phases.

6.5 Starting the Monitor


Perform the following steps:
1. Ensure that JAVA_HOME is set in the environment (pointing to Java 1.4 or higher)
2. Start the monitor by entering:
• Export: ./export_monitor.sh (Unix) or .\export_monitor.bat (Windows)
• Import: ./import_monitor.sh (Unix) or .\import_monitor.bat (Windows)

6.6 Restart the Monitor


Once the import/export monitor stops, check whether any packages have failed, e.g.
grep -e "=-" import_state.properties

Only Import with Fastload: Before starting the import monitor again, you should delete all old named pipes,
i.e. delete all files with naming schema <package name>.P<pid> from the USS directory specified by
environment variable dbs_db2_uss_dir.

6.7 Finalizing SWPM


After all packages have been processed successfully, choose OK and proceed with standard SWPM
procedure.

25
7 SPECIFICS OF THE FASTLOAD PROCEDURE

7.1 Environment Variables


The usage of Db2 Fastload throughout the import process is governed by the following environment
variables:

Environment Variable Value(s) Required Description

Setting R3LD_CLILOAD=1 ensures that SWPM


automatically writes the parameter
R3LD_CLILOAD 1 Yes
loadArgs=-loadprocedure fast
into import_monitor_cmd.properties.

Threshold for number of records; if exceeded Fastload


dbs_db2_fld_thr <Number> Yes is used instead of SQL INSERT (usually
dbs_db2_fld_thr=50000 is a good starting point)

dbs_db2_hlq <HLQ> Yes High level qualifier for temporary z/OS datasets

Set to 1, if z/OS USS named pipes are utilized, which


dbs_db2_uss_pipes 1 Yes
is recommended

Directory into which z/OS USS named pipes are


dbs_db2_uss_dir <Path> Yes written. If not set, USS named pipes are written to
/tmp.

Overwrites USS named pipe timeouts that are defined


in profile dataset FTP.DATA:
FIFIOPENtime
FIFOOPENTIME 86400 FIFOIOtime
Yes
FIFOIOTIME 86400 It is highly recommended to set the USS named pipe
timeouts as high as possible, i.e. 86400 seconds and
to set Db2 utility timeout (STORTIME) to NOLIMIT.
Otherwise you might experience either a USS named
pipe timeout or an SQL error -471.

Use only for diagnosis purposes. Set to 1, if z/OS USS


dbs_db2_uss_files 0, 1
files instead of named pipes should be used.

Use only for diagnosis purposes. Set to 0 to disable


R3LD_FLD_TRUSTED 0, 1
the trusted row format.

Directory where all Fastload log files are written.


dbs_db2_fastload_tracedir <Path> Default is relative path fldlogs from SWPM
installation directory

Set to (1..4) for additional trace written by the


DB2_FLD_TRACE 1..4
Fastload

Set to 0 to deactivate loading of LOBs that are smaller


than 32KB by Fastload. (LOBs larger than 32KB
R3LD_FLD_LOB 0, 1 cannot be loaded by Fastload.) You must only set this
in the rare case that the majority of LOBs is larger than
32KB.

Table 2: Fastload Environment Variables

26
7.2 Creating the FTP Parameter File
To allow an FTP logon to the database host, a configuration file param.ftp is required. Also, a particular
kernel library (db2jcllib.*) is needed for the installation process.
Therefore, proceed as follows:
1. Logon in a separate session to the application server.
2. Switch to the installation directory: <SWPM_INSTDIR_IMP>/sapinst_instdir/…/AS-ABAP
3. Check the version of the db2radm tool by calling:
./db2radm -vl (Unix)
.\db2radm.exe -vl (Windows)
4. Download the matching version of db2jcllib.dll / db2jcllib.so / db2jcllib.o from the
SAP Software Center into the same directory.
5. Set the environment variables LD_LIBRARY_PATH (Linux), LIBPATH (AIX) or Path (Windows) to the
installation directory.
6. Execute the following command to created param.ftp:
./db2radm -m enc -s <DBHOST> -u <DB2_CONNECT_USER>
-p <DB2_CONNECT_USER_PASSWORD> -f param.ftp

The password must be surrounded by single quotes (') if it contains a special character.
7. Test the FTP connection using the command:
./db2radm –m tst –f param.ftp

7.3 Troubleshooting
Symptom: Bad performance due to slow sorting.
Solution: Increase number of sort work datasets for DFSORT. Spread these datasets over a high number of
volumes. Specify a higher number of sort work datasets at Db2 LOAD option SORTNUM by setting
environment variable R3LD_FLD_SORTNUM.

Symptom: Bad performance due to paging activity on the IBM Z Host.


Solution: Fastload consumes more memory than the standard load. Therefore, increase the amount of
real memory, if possible.
Verify that the default amount of memory allocated by each DFSORT task (TMAXLIM) is in line with
the amount of available real memory.
Make sure that DFSORT work datasets are not defined as VIO.
Make sure that there is no high number of bufferpools with page fix ( PGFIX) option defined.

27
Symptom: Message in <package name>.loader.<ID>:
DSNUGDYN - ERROR ALLOCATING DATA SET
DSN=<HLQ>.<DB2 SUBSYSTEM>.<SAPSID>.<GUID>.<ID>.SYSUT1
Solution: In RACF dataset profile for '<HLQ>.**', add ALTER authority for user <DB2_CONNECT_USER>.

Symptom: The Fastload process terminates with the following message:


125-WAITING FOR READ PROCESS TO OPEN <uss dir>/<package>.Pxxxxxx
125 TRANSFER REQUEST ABORTED
450 TIMER EXPIRED WAITING FOR READ PROCESS TO OPEN
<uss dir>/<package>.Pxxxxxx
226 ABORT SUCCESSFUL.
CAT: OUTPUT ERROR
BROKEN PIPE

Solution: The process that writes into the USS named pipes gets a timeout if after 1 minute the reader
process has not read from the pipe. Increase the timeout value by setting the following
environment variables:
FIFOOPENTIME = 86400
FIFOIOTIME = 86400

28
8 SPECIFICS OF THE ZLOAD PROCEDURE

8.1 Environment Variables


The usage of zLoad throughout the import process is governed by the following environment variables:

Environment Variable Value(s) Required Comment

Setting R3LD_CLILOAD=1 ensures that SWPM


automatically writes the parameter
R3LD_CLILOAD 1 Yes
loadArgs=-loadprocedure fast
into import_monitor_cmd.properties.

Threshold for number of records; if exceeded zLoad is


dbs_db2_fld_thr <Number> Yes used instead of SQL INSERT (usually
dbs_db2_fld_thr=50000 is a good starting point)

dbs_db2_hlq <HLQ> Yes High level qualifier for temporary z/OS datasets

Setting dbs_db2_cliload=1 activates usage of


dbs_db2_cliload 1 Yes
zLoad

dbs_db2_cliload_tl 1..4 Governs the trace level written by zLoad

Directory where all fast load log files are written.


dbs_db2_fastload_tracedir <Path> Default is subdirectory fldlogs of SWPM installation
directory

Table 3: zLoad Environment Variables

8.2 Troubleshooting
Symptom: zLoad process terminates with the following message:
A1EEIMP 010 Task failed with error: (DBS) 'DBExeFastload' failed
A1EEIMP 010 (IMP) DbSlExeModify failed in insert for table '<tname>' with 99
A1EEIMP 010 (IMP) SQL error = -89989

Solution: See SAP Note 2813146. Copy the latest version of dbdb2slib.* to the installation directory
<SWPM_INSTDIR_IMP>/sapinst_instdir/…/SYSTEM/…/AS-ABAP
and continue SWPM with option Retry.

29
9 APPENDIX

9.1 Helpful SAP Notes


The following SAP Notes contain helpful information if you want to perform a Unicode conversion. You
should be familiar with all of them. Most of them are mentioned in this document.

General

552464 What is Big/Little Endian? What Endian do I have?

1738258 System Copy for Systems Based on SAP NetWeaver - Using SWPM 1.0

1480594 Prereqs & preparations for Db2 10

1850404 Prereqs & preparations for Db2 11

1850409 Installation & system copy with Db2 11

2303027 Prereqs & preparations for Db2 12

2303045 Installation & system copy with Db2 12

Prepare / Export

1586409 Latest version of SMIGR_CREATE_DDL

Import

1062976 Fast load with Db2 LOAD utility and USS named pipes (FIFOs)

1115173 Merging packages generated by R3ta

2813146 zLoad fails with SQL error = -89989

2831836 db2radm: jcl submission error

2837836 SAP System Copy using Db2 zLoad

Table 4: Important SAP Notes

30
9.2 List of Figures and Tables
Figure 1: Schematic Overview of Fastload (showing a Unicode conversion) ................................................... 8
Figure 2: Schematic Overview of zLoad (showing a Unicode conversion) ....................................................... 9
Figure 3: Report SMIGR_CREATE_DDL ........................................................................................................ 12
Figure 4: SWPM Dialog – Table Splitting Preparation .................................................................................... 16
Figure 5: SWPM Dialog – SAP System Export for Target System ................................................................. 17
Figure 6: SWPM Dialog – Split STR Files ....................................................................................................... 18
Figure 7: SWPM Dialog – Unload Settings...................................................................................................... 19
Figure 8: SWPM Dialog – SAP System Database .......................................................................................... 21
Figure 9: SWPM Dialog – Parameter Summary .............................................................................................. 21
Figure 10: SWPM Dialog – Database Installation Method .............................................................................. 23
Figure 11: SWPM Dialog – Export ABAP ........................................................................................................ 24
Figure 12: SWPM Dialog – Import ABAP ........................................................................................................ 24

Table 1: Bug Fixes for System Copy ................................................................................................................. 9


Table 2: Fastload Environment Variables ........................................................................................................ 26
Table 3: zLoad Environment Variables ............................................................................................................ 29
Table 4: Important SAP Notes ......................................................................................................................... 30

31

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy