Thursday, 30 May 2013

How to use Migration Monitor for Unicode Export/Import


  1. Introduction to  Migration Monitor
  2. Migration Monitor – Basic Configuration
  3. How to use Migration monitor
  4. Conclusion.
    
1.     Introduction to Migration Monitor

Combined upgrade and Unicode conversion (CU&UC) is a preferred method to perform SAP release upgrade and Unicode conversion as one step method. It is quite common while upgrading SAP  R/3 4.6  or 4.7 or ECC 5.0 non-unicode system to the latest ECC 6.0 (with EHPx), you need to perform both upgrade as well as Unicode conversion. In this regard,  you should take the opportunity to perform both upgrade and Unicode conversion as one step approach rather than multi-step approach which will reduce your testing time and overall effort. One of the most important questions regarding CU&UC is the length of the downtime and how you can optimize this. Major chunk of the downtime will be determined by Unicode conversion export/import. SAP provides couple tools to optimize ( or perform ) Unicode conversion export/import; one of these tools is Migration Monitor. The biggest advantage of using Migration Monitor is parallel export/import which will reduce your total conversion time. However Migration Monitor can be used only for ABAP stack or ABAP part of dual stack, not for Java stack. Migration Monitor itself is not an executable or binary, it is consisting of set of scripts and parameter files; which is internally based on SAP tool – R3load (and all other related tools – R3szchk, R3ldctl and R3ta). Migration Monitor can be used as an integrated tool from SAP installer (SAPINST) or it can be used as an independent tool without SAPINST. In this blog I will mostly cover Migration Monitor as independent tool to perform Unicode Export/Import.



2.     Migration Monitor – Basic Configuration

     Migration Monitor configuration centers around optimization of scripts and parameter files. In the following section, I will cover Migration Monitor configuration for basic export/import functionality. In this regard, you need to configure primarily “export_monitor_cmd.property “ for export and “import_ monitor_cmd.property” for import specific settings . By configuring these two files along with orderBy.txt file, you can perform export/import.


Migration Monitor : various files and their purposes
Files / Scripts
Purpose
export_monitor_cmd.properties
Export property file. Set all parameters related to export.
import_ monitor_cmd. properties
Import property file. Set all parameters related to import.
  • orderBy.txt
Set the order of export / import packages, tables and split chunk of tables.
export_monitor.sh (Unix)
export_monitor.bat (Windows)
Executable for export.
import_monitor.sh (Unix)
import_monitor.sh (Windows )
Executable for import.



Example :

In the following examples I will cover three different configuration scenarios for parallel export/import For all three scenarios, I will assume the following conditions:
OS : Any unix ( AIX, Linux, Solaris, HPUX) or Windows.
Database : Oracle or IBM DB2 LUW
Export location : /ExportData/PRD  ( NAS or SAN file system attached to source system ). This must be accessible to Target system.
Net exchange Directory : /ExpImp/NetExchange ( A file system accessible to both source and target systems.)
Export Installation Directory ( on Source system ) : /usr/sap/PRD/MM/InstDirExport
Import Installation Directory ( on Target system ) : /usr/sap/PRD/MM/InstDirImport
Migration Monitor Executable Directory : /use/sap/PRD/MM/MMWKDir


Case 1 : Standard SAP package

i)                    Export Configuration : Configure export_monitor_cmd.properties file. Open the file in any editor and set the following properties:

            # Export Monitor options
# ----------------Server operating mode --------------------
server
#
# Exchange mode: ftp | net
# Here we are using NFS as net exchange directory, so set to net.
net
#
# List of export directories, separator on Windows ; on UNIX :---
exportDirs=/ExportData/PRD

# --------------------------Installation directory-------
# ------ Location of Export log for Migration monitor -----
installDir=/usr/sap/PRD/MM/InstDirExport

# Package order: name | file with package names
orderBy=/usr/sap/PRD/MM/MMWKDir/orderBy.txt

# ------DDL control file, default is DDL<DB_TYPE>.TPL-------
ddlFile=/usr/sap/PBW/MM/MMWKDir/DDLDB6.TPL
      # -------- For Oracle, TPL file is : DDLORA.TPL -------------

# File with mapping between DDL files and package names
ddlMap=

# Monitor timeout in seconds
monitorTimeout=180

# ---------Generation of task files: yes | no------------
tskFiles=yes
# -------------Code page for Unicode conversion -------------------
dataCodepage=4102
# ---- Based on DB & OS set this to either 4102 or 4101 ---------

# Additional R3load arguments for LOAD phase
loadArgs=-stop_on_error

# Number of parallel jobs. You can set to as per available CPU and memory
jobNum=10

# Network exchange directory
netExchangeDir=/ExpImp/NetExchange



Do not set any other parameter; leave as it is:



ii)                  Import configuration : Configure import_monitor_cmd.properties file. Open the file in any editor and set the following properties:


# Import Monitor options
# Common options
#

# -- List of import directories, separator on Windows ; on UNIX :---
importDirs=/ExportData/PRD

#  ------------ Installation directory --------------------------------
installDir=/usr/sap/PRD/MM/InstDirImport

# Package order: name | size | file with package names
orderBy=/usr/sap/PRD/MM/MMWKDir/orderBy.txt
      #
# DDL control file, default is DDL<DB_TYPE>.TPL
ddlFile=/usr/sap/PRD/MM/MMWKDir/DDLDB6.TPL
      #
# File with mapping between DDL files and package names
ddlMap=
# Monitor timeout in seconds
monitorTimeout=180
#
# R3load options
# Optional path of R3load executable
r3loadExe=
# Generation of task files: yes | no
tskFiles=yes
      #
# Inclusion of extent files: yes | no
extFiles=no
      #
# DB code page for the target database
dbCodepage=4102
      #
# R3load omit value, can contain only 'DTPIV' letters
omit=
      #
# Additional R3load arguments for TASK phase
taskArgs=
# Additional R3load arguments for LOAD phase
#
loadArgs=-c 1000 -stop_on_error -loadprocedure fast
      #
# Number of parallel import jobs
jobNum=10
      #
# Network exchange directory
netExchangeDir=/ExpImp/NetExchange


Do not set any other parameter; leave as it is:



iii)    Set the order of export and import : Configure orderBy.txt file.

SAP0000
SAPNTAB
SAPAPPL0
SAPAPPL1
SAPAPPL2
SAPCLUST
SAPDDIM
SAPPOOL
SAPSDIC
SAPDFACT
SAPSDOCU
SAPSLDEF
SAPSLEXC
SAPSLOAD
SAPSPROT
SAPSSDEF
SAPSSEXC
SAPUSER
SAPUSER1
SAPSSRC
SAPUSER1
SAPSLDEF
SAPSSDEF

These are SAP standard packages and all tables are part of any of these packages. If you like to know more about mapping of table to package, logon to SAP , use the t-code SE11 and enter the table name. Go to technical settings,  it will show you package name for that particular table.
Each package is associated with one or more tablespaces and mapping between package and tablespace can be found in TADB6, IADB6 tables in DB2 and TAORA, IAORA tables in Oracle. Sometime these packages are refer as “TABART” in Oracle and “DataClass” in DB2.


Case 2 : Move out bigger tables from standard SAP package

Move out some large tables from the standard SAP package. The following list of tables we will pull out of the standard package :



                        GLPCA  : Size 80 GB
                        BSIS : Size 70 GB
                        LIPS : Size 60 GB
                        COEP : Size 50 GB
                        LIPS : Size 40 GB
                        VBRP : Size 30 GB
                        VBAP : Size 20 GB



                        ( Pull out all tables bigger than 20 GB )
                       
There will be no changes to export and import config file - “export_monitor_cmd.property “ and “import_ monitor_cmd.property”; main changes will take place in orderBy.txt file.Configure orderBy.txt file as follows:


GLPCA
                       BSIS
                       LIPS
                       COEP
                       LIPS
                       VBRP
                       VBAP
SAP0000
SAPNTAB
SAPAPPL0
SAPAPPL1
SAPAPPL2
SAPCLUST
SAPDDIM
SAPPOOL
SAPSDIC
SAPDFACT
SAPSDOCU
SAPSLDEF
SAPSLEXC
SAPSLOAD
SAPSPROT
SAPSSDEF
SAPSSEXC
SAPUSER
SAPUSER1
SAPSSRC
SAPUSER1
SAPSLDEF
SAPSSDEF


That means put each individual pull-out table as an entry in OrderBy.txt file.

                       
Case 3 : Table splitting

Move out some large tables from the standard SAP package and split these tables using Java splitter or SAPINST. In this example I will split the following list of tables.



                        GLPCA  : Size 100 GB
                        BSIS : Size 80 GB
                        LIPS : Size 60 GB
                        COEP : Size 50 GB
                        LIPS : Size 40 GB
                        VBRP : Size 30 GB


                        ( Split all tables bigger than 20 GB ).



                        Create another file called : tablesplit.txt as follows :
                       
                        GLPCA %5
                        BSIS %4
                        LIPS %3
                        COEP %3
                        LIPS %2
                        VBRP %2



Pass this file as an input to Java splitter or to SAPINST for table splitting. Also put this file into Migration Monitor executable directory ( /use/sap/PRD/MM/MMWKDir ) in both source and target systems.


i)                    Export Configuration : There is no changes to export configuration file àexport_monitor_cmd.property
ii)                  Import Configuration : Only one change if you database is IBM DB2 LUW.

loadArgs=-c 1000 -stop_on_error -loadprocedure fast LOAD


Because of split table you need to pass an additional argument called “LOAD”  along with “loadprocedure fast”.


iii)                Export/Import order : orderBy.txt file.

Configure the orderBy.txt file as the follows, where you need to mention each chunk of  split table along with standard package.


[GLPCA]
JobNum=1
GLPCA-1
GLPCA-2
GLPCA-3
GLPCA-4
GLPCA-5
[BSIS]
JobNum=1
BSIS-1
BSIS-2
BSIS-3
BSIS-4
.
.
.

            SAP0000
SAPNTAB
SAPAPPL0
SAPAPPL1
SAPAPPL2
SAPCLUST
SAPDDIM
SAPPOOL
SAPSDIC
SAPDFACT
SAPSDOCU
SAPSLDEF
SAPSLEXC
SAPSLOAD
SAPSPROT
SAPSSDEF
SAPSSEXC
SAPUSER
SAPUSER1
SAPSSRC
SAPUSER1
SAPSLDEF
SAPSSDEF


3.     How to use Migration Monitor

In this example I will show you how Migration Monitor can be used in conjunction with SAP installer – SAPINST.


i)                    Download the correct version of Migration Monitor and configure


Use the following OSS note and download the MIGMON_<rel>.SAR file from the SAP service market place:

               Support pack and Patches --> Additional Components à SYSTEM COPY TOOLS GEN --> SYSTEM COPY TOOLS GEN 1.0 --> # OS independent

Note 784118 - System Copy Tools for ABAP Systems

-- UNCAR  MIGMON_<rel>.SAR file on both source and target system’s executable directory (/use/sap/PRD/MM/MMWKDir )
-- Configure export and import config files and set the orderBy.txt as per the above configuration. Select any one of the above configuration scenarios ( Case 1, Case 2 or Case 3) as per your requirement.

ii)                  Perform export

          I am not going to discuss any pre-requisite tasks for export and I assume that system has been upgraded and all the necessary pre-  requisite  steps for      Unicode conversion have been completed. So next step is to start the Unicode export/import.
          Start the SAP installer (SAPINST ) on the source system and select the following options :

           Inst_screen_1.JPG
Fig 1 : SAPINST selection for export
               

Enter all generic input for SAPINST ( I am not going to show all screen ) and pay attention to the following important selections. When you select the option – “Start Migration Monitor Manually”, SAPINST will prompt you to start Migration Monitor for your Unicode export.

           Fig2.JPG
Fig 2 : Select Migration monitor option

You need to cancel SAPINST and start your Migration Monitor for export. Based on the code page mentioned in the export configuration file, export process will convert your data from non-unicode to Unicode .

           Fig3.JPG
Fig 3 : Option to start Migration Monitor Manually


Goto your Migration Monitor executable directory ( in this example - =/usr/sap/PRD/MM/MMWKDir ) and start the export process by executing export_monitor.sh ( or export_monitor.bat ) executable.

           Fig4_start_export.JPG
Fig4 : Start Migration Monitor  for export:

After completion of export, start SAPINST on the source system to complete the export process.

           Fig5_Start_SAPINST_after_export.JPG
Fig 5 : Start SAPINST after completion of Migration Monitor – export
           
           Fig6_export_completed..JPG
Fig 6 : Export completed successfully.

iii)                Perform Import

               To perform import you will have two options, either in-place import or parallel export/import.   Whenever      you      do      not      have      separate            host      for      import,      you      need      to perform export and import on the same host - called in-place import. For in-place (export/) import, once you completed the export part;  uninstall the exiting SAP, build your target system as Unicode enable system and perform import.For parallel export/import you will have separate host for both export and import. In this example I assumed that we will perform parallel export/import.Use SAPINST to install target system and choose the following option .

           Fig7_sapinst_import.JPG
Fig 7 : Install Target system for import.


           Enter all required information for SAPINST. I will not show all screenshots, please pay special attention for the following “Migration Monitor” option.

           Fig8_import_migmon_selection.JPG
Fig 8 : Option for Migration Monitor


SAPINST will prepare your system for import – it will install SAP kernel and database binary, build the template database and setup database connectivity. At one point of time SAPINST will prompt you to start Migration Monitor manually as the following. Cancel the SAPINST and start Migration Monitor Manually.

           Fig9_import_migmon_NO.JPG
Fig 9 : SAPINST will prompt to start Migration Monitor Manually.

Goto your Migration Monitor executable directory ( in this example - =/usr/sap/PRD/MM/MMWKDir ) and start the import process by executing import_monitor.sh ( or import_monitor.bat ) executable.

          Fig10_start_import.JPG
Fig 10 : Start Migration Monitor for Import

              Parallel export/import :
          
          Fig13_paralel_exp_imp.JPG
Fig 11 : Parallel export/import

After completion of import, start SAPINST on the target system to complete Central Instance installation process.

           Fig11_import_migmon_OK.JPG
Fig 12 : Start SAPINST after completion of import

           Fig12_import_completed.JPG
Fig 13 : Central Instance build completed.


iv)                Migration monitor Logs



Export logs : Export installation directory. In this example
installDir à /usr/sap/PRD/MM/InstDirExport

Import logs : Export installation directory. In this example
installDir à /usr/sap/PRD/MM/InstDirImport


  1. Conclusion
Use Migration Monitor with medium size database ( 500 GB to 1 TB) and when you have option to perform parallel export/import. For large database use Distribution Monitor.

1 comment: