© 2003 International Business Machines Corporation. All rights reserved.
Important: Read the disclaimer before reading this article.
This article is intended to be used as a step-by-step guide to perform a cross-platform Heterogeneous System Copy of an existing SAP® R/3 system across different platforms using the redirected restore method of IBM® DB2® Universal DatabaseTM (UDB) Version 8. It deals with issues and concerns that may arise during the migration as well as important information you need to know to successfully complete the operation.
You may need to use a Heterogeneous System Copy to change operating system platforms or to duplicate a system. SAP recommends having such a copy when you need to build a test or training environment.
This article provides instructions that you must use along with the SAP Installation Manuals and the Homogeneous and Heterogeneous System Copy guides.
A System Copy between two systems running on the same operating system is called a Homogeneous System Copy and can be performed using the R3load tool or by using the DB2 redirected restore procedure.
A System Copy between two systems running on different operating systems or different DBMS systems is called a Heterogeneous System Copy. Before DB2 UDB Version 8, it was only performed using the R3load tool provided by SAP.
With DB2 UDB Version 8, you can use redirected restore to create a Heterogeneous System Copy between two systems running on different platforms. As shown in Figure 1, you can take a backup from any big-endian server[1] and restore it to any other big-endian server. For example, you can restore a backup image from DB2 UDB for HP-UX to DB2 UDB for AIX® or Sun Solaris. With Windows® and Linux, you are limited to the same platform.
Figure 1. Possible Heterogeneous System Copy combinations

In the following sections we will explain the process of copying an SAP R/3 system from one platform to another using redirected restore (Figure 2).
Figure 2. Using DB2 redirected restore to copy your SAP system

The procedure for a cross-platform Heterogeneous System Copy documented here is to be used as a reference along with the SAP installation manuals specific to your platform and to the SAP release you are currently running, as well as the IBM online documentation. In addition, you should review the following OSS notes:
- OSS Note # 316353: latest information on Heterogeneous System Copy
- OSS Note # 201149: 4.6C R/3 Inst. - Homogeneous System Copy
- OSS Note # 5647020: DB6: Homogeneous System Copy with SAPinst
- OSS Note # 73717: DB6: Tools for a System Copy
- OSS Note # 122222: DB2 UDB: Redirected Restore via DB2 CLP
- OSS Note # 516246: SAP Web AS 6.20 - Homogeneous and Heterogeneous System Copy
- OSS Note # 628156: DB6: Cross-Platform System Copy using Backup/Restore
- OSS Note # 95282: DB2/CS: Activity of the DB2 Event monitor for R/3
Preparing to make the System Copy
Before starting the System Copy, be advised of the following:
- To make a System Copy, both SAP systems must have the identical version (source and target[2] systems), and both systems should be on DB2 UDB Version 8.
- The source system must be in a consistent state --that is, it must be shut down completely -- before you make the copy.
- Create the logical volumes and file systems on the target DB2 UDB system to match the sizes of the source database file systems. Note that the file system sizes used will be different from those recommended in the SAP installation document depending on the data volume of the source system. Refer to R/3 Installation on UNIX: IBM DB2 Universal Database for UNIX and Windows for more information.
- Customers must contact SAP to obtain SAP's requirements for the migration (for example, obtain the migration package, have a certified consultant on site). For more information, please review OSS Note # 628156.
- At the time of this article, there are no SAP installation CDs for 4.6x or earlier available for 64-bit AIX 5L. To copy your system to AIX 5L 64-bit you must follow the manual steps described in Special case.
- To run a System Copy on R/3 Enterprise 470 you must use the same SID for both source and target systems, otherwise you will run into problems when finishing the installation. This article will be updated when a work-around is available.
- Take a full DB2 offline backup of the source system. To obtain an offline backup, you must:
- Shut down SAP R/3.
- Check that no applications are connected to the database. Do this by entering the command
db2 list applications. This command must return with:
No data was returned by the database system monitor. - Stop DB2 by entering the command
db2stop. - Run the backup:
db2 backup db <SID> to <backup directory>See the backup database command in the DB2 online documentation for more information about the backup database command.
- If your target system is 4.6x or earlier, follow these steps:
- Follow the installation instructions in the document SAP R/3 Homogeneous System Copy provided by SAP. (Instead of
CENTRDB.R3SorDATABASE.R3S, use the templatesCEDBR3CP.R3Sfor a central and database server, orDBR3CP.R3Sfor a database server.)Example:
./R3SETUP -f CEDBR3CP.R3SThe installation assistant will ask questions that you must answer according to your system's configuration. For guidelines to answer these questions, see R/3 Installation on UNIX: IBM DB2 Universal Database for UNIX and Windows.
R3SETUPwill stop at stepEXITR3COPY_IND_DB6. Modify and run the redirected restore script to fit the specifications of your target system. (More details and a sample script are provided in the download.)- Complete the installation as described in the SAP R/3 installation guide.
- Follow the installation instructions in the document SAP R/3 Homogeneous System Copy provided by SAP. (Instead of
- If your target system is 4.70:
- Install the central instance as described in SAP R/3 Enterprise 4.70 Installation on UNIX: DB2 Universal Database for UNIX and Windows. Important: You must have the same SID as the source system.
- Follow the instructions as per OSS Note 564720 to modify the file
control.xmlbefore installing the database instance. - Run the installation for the database instance, answering the questions as described in the guide until it stops before creating the database.
- Modify and run the redirected restore script to fit the specifications of your target system. More details and a sample script are provided in the download.
- Complete the installation as described in the SAP installation guide.
- After the installation is complete, complete the following steps:
- Report loads in an SAP system are OS-dependent; you must delete these loads to complete the System Copy. The system will automatically re-create them at first access. To delete the report loads, enter the following commands from the operating system using the DB2 command line processor (CLP):
- For 4.6x or earlier:
db2 "delete from sapr3.d010l" db2 "delete from sapr3.d010q" db2 "delete from sapr3.d010y" db2 "delete from sapr3.d010linf"
- For 4.70:
db2 "import from /dev/null of del replace into <schema_name>.repoload"
- For 4.6x or earlier:
- The DB2 event monitors keep information on owners and permissions, which are kept in the database system catalog. To avoid having the event monitors connect to the owner of the source system (rendering them unusable in the target system), drop and recreated them with the instance owner of the target system (follow the instructions in OSS note 95282).
- Report loads in an SAP system are OS-dependent; you must delete these loads to complete the System Copy. The system will automatically re-create them at first access. To delete the report loads, enter the following commands from the operating system using the DB2 command line processor (CLP):
Special case: System Copy to SAP R/3 4.6C 64-bit on AIX5L
There are no SAP installation CD's for 4.6x or earlier available for 64-bit AIX 5L at the time this article was written (32- bit installation for AIX5L is identical to the 32-bit AIX 4.3.3). If you would like to copy your source system (4.6x or earlier) into 64-bit AIX 5L, follow these manual steps:
- Take a DB2 backup as described in previous sections.
- On the target system, run the homogeneous System Copy using the 32- bit AIX Kernel CD provided by SAP.
- Modify and run the redirected restore script to fit the specifications of your target system. More details along with a sample script are provided in the download.
- Exchange the 32-bit kernel located on
/sapmnt/<SID>/exewith the AIX 5L 64-bit kernel that can be downloaded from SAP MARKETPLACE at http://service.sap.com. Recommendation: Before you replace the kernel, make a backup copy of the exe directory. - Copy the executable R3SETUP of the new kernel to the install directory, and complete the installation with the new R3SETUP as described in the SAP install guide.
Download: Sample redirected restore script
Use the redirected restore tool brdb6brt to generate a script. Run the tool on the original database, as follows:
brdb6brt -s <dbname> -bm RETRIEVE -user <instance_owner> -using <passwd> |
After the script is created, use any text editor to change the database name and the paths to the different containers.
To run the script, you can use the DB2 Command Line Processor (CLP) as follows:
db2 -tvf <script_file> |
At the bottom of this artice you will find a sample of a redirected restore script. For more information on the script or on the tool brdb6brt, see Chapter 3 of SAP Web Application Server Homogeneous System Copy.
By providing step-by-step instructions and recommendations, I hope this article helps you with your task of performing Heterogeneous system copies using the redirected restore method available in DB2 UDB.
- [ 1] "Big-endian" means that the most significant byte has the lowest address (the word is stored "big-end-first"); most RISC processor are big-endian. Intel microprocessors are little-endian.
- [ 2] The SAP system containing the original database is called the source system and the system to which the database copy is to be imported is called the target system.
This article contains sample code. IBM grants you ("Licensee") a non-exclusive, royalty free, license to use this sample code. However, the sample code is provided as-is and without any warranties, whether EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. IBM AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE THAT RESULT FROM YOUR USE OF THE SOFTWARE. IN NO EVENT WILL IBM OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF IBM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
An extended team of both IBM and SAP colleagues provided expert advice and consultation for this project. The author would like to acknowledge Liwen Yeow, Joachim Pfefferle and Jan Kritter for their help.
Appendix: Important issues when installating SAP R/3 Enterprise 4.70 or earlier with DB2 UDB V8.1
Because DB2 UDB Version 8 was introduced after the release of SAP Enterprise 4.70, there are a few issues that may arise when you install SAP R/3 Enterprise release 4.70 or earlier with DB2 Version 8. These issues do not apply if you are installing 4.70 SR1 or later.
Table 1 outlines these issues and the workarounds needed to complete a successful installation.
Table 1. Installation issues and solutions
| # | Description | Before V8 | V8 value/setting |
|---|---|---|---|
| 1 | sddb6ins will need to be recompiled due to change in sql.h ... will break on AIX. | Two different versions of sql.h exist. DB2 is trying to fix this inconsistency and make a single version of sql.h. | Get the latest sddb6ins from SAP MARKETPLACE. |
| 2 | Command to create the DAS instance on UNIX. | dasicrt | dascrt |
| 3 | Command to retrieve list of DAS instances on UNIX. | dasilist | daslist |
| 4 | Path for db2admin start. | /db2/db2as/sqllib/bin/db2admin start | /db2/db2as/bin/db2admin start |
| 5 | For 64-bit installations, the SHLIB_PATH or LD_LIBRARY_PATH must change after instance creation to point to the lib64 directory. | R3SETUP was able to handle this. | Must change from /opt/IBM/db2/V8.1/lib to /opt/IBM/db2/V8.1/lib64 after the instance creation step. |
| 6 | R3SETUP will begin to fail on the update dbm cfg phase (UPDATEDBMCFG_IND_DB6) because V8 will no longer use DFT_CLIENT_COMM parameter in dbm cfg. | Did not fail. | The workaround is to connect to the installation machine as <sid>adm, and run the following command: (This is the same command that R3SETUP tries but does not include the DFT_CLIENT_COMM parameter.)
/sapmnt/<SID>/exe/db6clp update database manager configuration using SYSADM_GROUP db<sid>adm SYSCTRL_GROUP db<sid>ctl DFT_MON_BUFPOOL ON DFT_MON_LOCK ON DFT_MON_SORT ON DFT_MON_STMT ON DFT_MON_TABLE ON DFT_MON_UOW ON MON_HEAP_SZ 128 UDF_MEM_SZ 128 RQRIOBLK 65000 SVCENAME sapdb2<SID> ASLHEAPSZ 15 KEEPDARI YES MAXAGENTS 60 DFTDBPATH /db2/<SID> DIAGPATH /db2/<SID>/db2dump NUM_POOLAGENTS 10 NUM_INITAGENTS 5 |
| 7 | If this system is migrated from DB2 Version 7 to Version 8 then you will receive SQL execution errors during this step: DB6INSTALLADMIN_IND_DB6. This is related to the lack of permissions for creating UDFs. The new database authority CREATE_EXTERNAL_ROUTINE was added in V8, and anyone who issues a CREATE function/procedure/method that has an EXTERNAL clause needs to have the authority. | Did not fail. | Run this command at the OS prompt using DB2 CLP:
db2 "GRANT CREATE_EXTERNAL_ROUTINE ON DATABASE TO SAPR3"
(The fix is integrated in the latest support package). |
| 8 | On database migration from V7 to V8 the db cfg parameter CATALOGCACHE_SZ = 1000 is converted to CATALOGCACHE_SZ = (MAXAPPLS*4)
Transaction ST04 may fail with an ABAP dump conversion error:
"DYNPRO_FIELD_CONVERSION" | Run the command:
db2 update db cfg for <SID> using CATALOGCACHE_SZ 1000 | |
| 9 | SAP releases before to 4.70 do not recognize V8 as a valid version of DB2 UDB. An environment variable must be set. | After the installation is completed successfully, follow note 113145:
As <sid>adm, update the .cshrc or .sh file (depending on your shell) with the following line:
setenv DB6_DBSL_ACCEPT_DBVERSION 08.01.0000
or
set DB6_DBSL_ACCEPT_DBVERSION=08.01.0000; export DB6_DBSL_ACCEPT_DBVERSION | |
| 10 | On AIX, the variable EXTSHM=ON must be set. | You must set this value to be able to start SAP.
(You might also have to run the command: db2set DB2ENVLIST=EXTSHM.) | |
| 11 | R3SETUP (RFC step) will take several attempts and possibly a few hours to complete at 96% ...This is due to deadlock stuations. | Run the following commands before the message:
'RFC ping /open (@ 96%'
alter table sapr3.D010LINF volatile;
In Release 4.70 these tables do not exist.D010LINF is a view on REPOLOAD. D010SINF is a view on REPOSRC. So, use: db2 alter table sap<sid>.repoload volatile |
During the installation, you will need to skip a few steps of the installation process to run the step manually according to Table 1 (issues 2, 3, 4, and 6 only). The following explains how to skip a step of the installation. Note that you should practice extreme care when performing the following operation and it should not be used for any other steps. You should also keep a backup copy of the original file before the modifications.
4.6x or earlier:
- Stop the installation.
- Open the file
<template>.R3Sfor editing - Change the status from ERROR to OK in the section that just failed.
Example:
This section of the CENTRDB.R3S file:
... [DB6UPDATEDBMCFG_IND_DB6] ACTION= CLASS=CDB6UpdateDBMConfig CONFIRMATION= CONFIRMED= LIST=Z_DB6UPDATEDBMCFG_IND_DB6 MSGID=RI_GIST_DB6UPDATEDBMCFG_IND_IND STATUS=ERROR **line to be replaced STEP_ENV=DB_ENV ... |
Should be replaced with:
... [DB6UPDATEDBMCFG_IND_DB6] ACTION= CLASS=CDB6UpdateDBMConfig CONFIRMATION= CONFIRMED= LIST=Z_DB6UPDATEDBMCFG_IND_DB6 MSGID=RI_GIST_DB6UPDATEDBMCFG_IND_IND STATUS=OK **replacement STEP_ENV=DB_ENV ... |
4.70 or later:
- Stop the installation.
- Open the file
keydb.xmlfor editing - Change the status from ERROR to OK in the section that just failed.
Example:
This section of the keydb.xml file:
...
<row>
<fld name="STEPKEY">
<strval><![CDATA[R3E|ind|ind|db6|R3E|47|0|SAPComponent|ind|ind|ind|ind|
ind|0|DatabaseServer|ind|ind|db6|ind|in
d|0|Tablespaces|ind|ind|db6|ind|ind|0|CreateTablespaces]]>
</strval>
</fld>
<fld name="STATUS">
<strval><![CDATA[ERROR]]> **line to be replaced
</strval>
</fld>
</row>
...
|
should be replaced with:
...
<row>
<fld name="STEPKEY">
<strval><![CDATA[R3E|ind|ind|db6|R3E|47|0|SAPComponent|ind|ind|ind|ind|ind
|0|DatabaseServer|ind|ind|db6|ind|in
d|0|Tablespaces|ind|ind|db6|ind|ind|0|CreateTablespaces]]>
</strval>
</fld>
<fld name="STATUS">
<strval><![CDATA[OK]]> **replacement
</strval>
</fld>
</row>
...
|
| Name | Size | Download method |
|---|---|---|
| brdb6brt.out | 40 KB | HTTP |
Information about download methods

Marianne Nesiem is a member of the IBM SAP Integration and Support Centre at the IBM Toronto Lab. Her current activities are integration testing of SAP's R/3 with IBM's DB2 and helping customers with problem analysis and troubleshooting. She also is a customer advocate providing custom tailored support for large customer accounts running SAP & DB2. She is a DB2 Certified Solution Expert, a system administrator, mostly for UNIX and has experience in application development on Java for databases and other applications. You can reach Marianne at aboukeer at ca.ibm.com.




