Homogeneous System Copy or DB Refresh on IBM i with SWPM using a save file
There is an old habit from the early days of SAP on IBM i:
When copying an SAP system on IBM i via homogeneous system copy or when refreshing the current SAP database schema with the data from a different SAP system, sometimes the data is just copied with plain OS tools (SAVLIB/RSTLIB) from a save file without using the SAP Software Provisioning Manager (SWPM).
While it can work in some scenarios, this is not the officially recommended way to do a homogeneous system copy import or database refresh because it can cause errors.
More detailed information:
Starting with NW 7.40, it is typical that the SAP database schema permanently contains objects of type *PGM and *SRVPGM (like SQL triggers, user-defined-functions, and variables). Other than objects of type *FILE (for SQL tables, views, indexes), references from programs or service programs to other database objects (for example the base table on which a trigger got defined) are not adjusted automatically during restore. That means, objects of type *PGM and *SRVPGM will continue to “point” to the original location resulting in data inconsistencies in the worst case. This can happen if your SAP user profiles are for some reason configured (maybe misconfigured) to have access to other SAP systems than their own and the source schema resides on the same LPAR.
The only way to correct the references is to recreate the affected objects with the new schema name.
SWPM does all needed steps in the post load phase using dedicated ABAP reports.
For more information how the affected objects are created, see SAP Note 2368628.
We strongly recommend that you do a homogeneous System Copy import or a DB Refresh by using the SWPM.
On IBM i, the SWPM offers two methods to export and import the SAP schema:
a) SAP generic: R3Load(for ABAP) / JLoad(for Java) or
b) Database specific: IBM i specific database tools SAVLIB/RSTLIB.
When you are using the IBM i specific tools, the SWPM will restore (RSTLIB) the database library from a save file. The creation of the database library export (SAVLIB) into a save file is done manually.
The recommended steps of a system copy or DB Refresh are described the SAP System Copy documentation.
In general when using the IBM i specific database tools SAVLIB/RSTLIB, you must do the following steps:
- Create manually a save file of the SAP database library. This save file is called the SAP database export. For convenience reasons the SWPM is not involved when performing a database library export using the command SAVLIB. For more information, see SAP Note 585277.
- Only for the DB Refresh: Before you start the Refresh Database Content option on IBM i, you must delete the SAP database library of your target SAP system. This is described in detail in the SAP System Copy documentation, section Copying the Database Only – Refresh Database Content.
- Start the SWPM as described in the SAP System Copy documentation for IBM i, section Running the Installer.
- In the SWPM Welcome screen choose the option you want to use:
a) <SAP_Product_Name> → IBM Db2 for i → System Copy → Target System or
b) Generic Options → IBM Db2 for i → Refresh Database Content - Fill the parameter values in the dialog phase of the SWPM as described in the system copy guide. Provide the name and location of your save file (your SAP database export).
- Review all parameters in the Summary screen of the SWPM at the end of the dialog phase and click Next to execute the SAP System Copy Import or DB Refresh.
In the execution phase of the SWPM the data of the save file will be restored (RSTLIB) into the SAP database library. Finally, ABAP reports will do additional configuration steps. Especially for NW 7.40 and higher objects of type *PGM and *SRVPGM are recreated consistently for the new SAP database library.
SAP recommends that you use the latest SWPM. At the time of writing, this is SWPM 1.0 SP 23 patch level 05. For more information, see SAP Note 1680045.