sap hana on ibm power systems · 2020. 10. 27. · introduction this paper demonstrates a sample...

56
SAP HANA on IBM Power Systems SAP HANA Big-Endian to Little-Endian Migration IBM Deutschland GmbH Created on February 27 th , 2018 – Version 1.0 Last modified on December 10 th , 2019 – Version 3.2 © Copyright IBM Corporation, 2019

Upload: others

Post on 25-Jan-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

  • SAP HANA on IBM Power Systems

    SAP HANA Big-Endian to Little-Endian Migration

    IBM Deutschland GmbH

    Created on February 27th, 2018 – Version 1.0 Last modified on December 10th, 2019 – Version 3.2

    © Copyright IBM Corporation, 2019

  • 2

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Preface

    Edition Notice and Version Information

    © Copyright IBM Corporation 2019. All Rights Reserved.

    US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA

    ADP Schedule Contract with IBM Corp. All trademarks or registered trademarks mentioned

    herein are the property of their respective holders. IBM Corporation Systems and Technology Group Route 100 Somers, NY 10589

    Version: this is version 3.0 of this document.

    The most recent published version of this paper is available at:

    http://www.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP102761

    Version History Changes 1.0 Initial release

    2.0 Rewrite to adapt to SAP documentation changes

    3.0 Add a walkthrough using the combined migration method

    3.1 Some minor corrections

    3.2 Remove instructions about executing SMIGR_CREATE_DDL

    Authors

    • Walter Orb, IBM SAP International Competence Center

    • Dr. Edmund Häfele, IBM Technical Sales for SAP

    Feedback

    We’re interested in any feedback you have. Please send your comments to

    [email protected].

    Note: Before using this information and the product it supports, be sure to read the

    general information under “Copyrights and Trademarks” on page 55 as well as

    “Disclaimer and Special Notices” on page 56.

    http://www.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP102761mailto:[email protected]:[email protected]

  • 3

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Table of Contents Introduction ............................................................................................................................................ 6

    Test System Information ..................................................................................................................... 7

    Hostnames and SIDs........................................................................................................................ 7

    LPAR Sizes........................................................................................................................................ 7

    Part I – SAP HANA System Migration Tool .............................................................................................. 8

    Prerequisites ........................................................................................................................................... 8

    System Setup .......................................................................................................................................... 8

    Install Target System ........................................................................................................................... 8

    Prepare Target System ........................................................................................................................ 9

    Install Data Provisioning Agent (DPAgent) .......................................................................................... 9

    Configure Data Provisioning Agent ................................................................................................... 12

    Start Data Provisioning Agent ........................................................................................................... 12

    Enable the Data Provisioning Server ................................................................................................. 14

    Extract the Migration Tool ................................................................................................................ 14

    Verify Source System Compatibility .................................................................................................. 15

    Create User in Source System ........................................................................................................... 16

    Grant Privileges to SYSTEMMIGRATION User ................................................................................... 16

    Grant access to schemas created by the HANA Repository ......................................................... 17

    Update migration tool configuration file .......................................................................................... 25

    Migration Process ................................................................................................................................. 26

    Stop using the source system ........................................................................................................... 27

    Start database migration tool ........................................................................................................... 27

    Monitor database migration ............................................................................................................. 27

    Post Migration................................................................................................................................... 28

    Switch application server to new HANA 2.0 database ..................................................................... 29

    Start Application Server .................................................................................................................... 31

    Drop Migration User ......................................................................................................................... 31

    Manual Postprocessing ..................................................................................................................... 32

    Part II – Combined Migration Method .................................................................................................. 33

    Detailed Process ................................................................................................................................ 34

    System Setup ........................................................................................................................................ 36

    Prepare SWPM .................................................................................................................................. 36

    Download SAP SWPM software .................................................................................................... 36

    Unpack SWPM software ................................................................................................................... 36

    Create a dump directory for the Export........................................................................................ 37

  • 4

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Create a work directory for SWPM export and import................................................................. 37

    Prepare Table Splitting, shortly before the Export ....................................................................... 38

    Prepare SAP HANA System Migration Tool ................................................................................... 44

    Update migration tool configuration file ...................................................................................... 44

    Start the SAP HANA Migration Tool for Catalog Migration and Migration of other data ............ 44

    Start SWPM Export phase ............................................................................................................. 45

    Start SWPM Import ....................................................................................................................... 47

    Summary ............................................................................................................................................... 52

    Appendix ............................................................................................................................................... 53

    Run Export/ Import unattended ....................................................................................................... 53

    References ........................................................................................................................................ 53

    SAP Notes ...................................................................................................................................... 53

    SAP Documentation ...................................................................................................................... 54

    Copyrights and Trademarks .................................................................................................................. 55

    Disclaimer and Special Notices ............................................................................................................. 56

  • 5

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figures Figure 1 SAP HANA Migration Tool Test Landscape ............................................................................... 7

    Figure 2 HANA Studio - Size of Source Database .................................................................................... 7

    Figure 3 HANA Studio - SQL Console: alter database ........................................................................... 14

    Figure 4 HANA Studio - Check source system compatibility ................................................................. 16

    Figure 5 HANA Studio - Create systemmigration project ..................................................................... 18

    Figure 6 HANA Studio - role editor ....................................................................................................... 18

    Figure 7 HANA Studio – Role Editor: migration.hdbrole ....................................................................... 20

    Figure 8 HANA Studio - Create New Repository Workspace ................................................................ 21

    Figure 9 HANA Studio - Share Project ................................................................................................... 22

    Figure 10 HANA Studio - systemmigration in repository tab ............................................................... 23

    Figure 11 HANA Studio – migration role in Systems tab ...................................................................... 24

    Figure 12 HANA Studio – add migration role to systemmigration user ............................................... 25

    Figure 13 HANA Studio – SQL Console: results of migration run .......................................................... 28

    Figure 14 SAPGUI – SAP HANA database Overview .............................................................................. 31

    Figure 15 Overview - Combined migration method ............................................................................. 33

    Figure 16 Combined Migration – Detailed Process .............................................................................. 34

    Figure 17 Execution of the hybrid migration ........................................................................................ 35

    Figure 18: SWPM Export – Dump Directory Structure ......................................................................... 37

    Figure 19: SAP HANA SQL Console – Query largest tables.................................................................... 39

    Figure 20: SWPM - Table Splitting Preparation .................................................................................... 43

    Figure 22 SWPM - Database Export parameters .................................................................................. 46

    Figure 23 SWPM import - Database for SAP System ............................................................................ 49

    Figure 24 SWPM – Migration Export Location ..................................................................................... 50

    Figure 25 SWPM import – Migration Monitor ...................................................................................... 51

  • Introduction This paper demonstrates a sample migration of an SAP HANA 1.0 system running in big

    endian mode to an SAP HANA 2.0 system in little endian mode.

    In the first part, the migration method described is the SAP HANA System Migration Tool as

    documented in SAP Note 2537080 - Migrate SAP HANA 1.0 on IBM Power Systems Big-

    Endian to SAP HANA 2.0 on IBM Power Systems Little-Endian. The version of the SAP

    note used for this walkthrough was “Version 19 from July 12, 2019“. In the remainder of this

    paper, the term Migration Guide will be used as a synonym for this SAP note.

    Preparing the environment, installing the required tools, and executing a big endian to little

    endian migration with the SAP HANA System Migration Tool is pretty much a

    straightforward task and not overly complicated. The biggest challenge is to manage the

    migration of very large databases given the available resources within an acceptable down-

    time window. This is comparable to traditional SAP migration projects and the duration is

    very often dominated by a relatively small number of very large tables.

    To address the need for migration of very large databases in a reasonable down-time window,

    SAP has recently released SAP Note 2802500 - Combined SWPM and HANA Migration

    Tool Database Migration, which documents the procedure for a combined migration method.

    The term Combined Migration Guide will be used as a synonym for this note. The combined

    method uses the SAP HANA System Migration Tool together with the Software Provisioning

    Manager (SWPM) 1.0 System Copy method allowing the use of the well-known and

    established R3load and Migration Monitor (migmon) tools to optimize the data migration of

    an ABAP schema. The second part of this paper describes a sample migration using the

    combined method.

    In addition to the Migration Guide and Combined Migration Guide, SAP maintains a list of

    frequently asked questions in SAP Note 2554012 - FAQ: SAP HANA Big Endian to Little

    Endian Migration for IBM Power. Among further explanations and references to other

    important SAP notes, the Migration FAQ also contains a set of recommendations for

    parameter settings, that influence the runtime of a migration.

    The official documentation in the SAP notes and the Migration FAQ should always be used

    to plan, test, and execute a big endian to little endian migration. This paper is only meant as a

    supplement to the SAP documentation and should help with some sections, where the

    description is a little bit terse or where it might not be immediately clear where to find

    additional documentation for a particular topic.

    Throughout the rest of the document, the following symbol and header will serve as a

    reference to the respective section in the Migration Guide, the Combined Migration Guide, or

    the Migration FAQ.

    Migration Guide: Reason and Prerequisites

    https://launchpad.support.sap.com/#/notes/2537080https://launchpad.support.sap.com/#/notes/2537080https://launchpad.support.sap.com/#/notes/2802500https://launchpad.support.sap.com/#/notes/2802500https://launchpad.support.sap.com/#/notes/2554012https://launchpad.support.sap.com/#/notes/2554012

  • 7

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Test System Information

    Hostnames and SIDs

    • Source HANA system hostname: ph02na2

    • Target HANA system hostname: ph02nb1

    • Application Server hostname: ph02as2

    • DPAgent hostname: ph01dpa

    • SAP HANA SID: H02

    • S/4HANA App Server SID: H02

    LPAR Sizes

    CPU Memory

    Source HANA system 8 processor cores 160 GB

    Target HANA system 8 processor cores 160 GB

    Application Server 4 VCPUs, entitlement 3.2 16 GB

    DP Agent 6 VCPUs, entitlement 4.8 64 GB

    The picture below shows an overview of the test landscape used for this migration exercise.

    Figure 1 SAP HANA Migration Tool Test Landscape

    The source system is an SAP S/4HANA 1609 IDES system. The size of the database is

    approximately 39 GB:

    Figure 2 HANA Studio - Size of Source Database

  • 8

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Part I – SAP HANA System Migration Tool This part records the preparations and required steps to perform a big-endian to little-endian

    migration using the SAP HANA System Migration Tool.

    Important: it is extremely important to perform one or more test migrations using a copy of

    the actual source system before attempting a production migration. This helps to prevent

    system specific migrations issues and to verify that the down-time requirements can be met.

    Prerequisites

    Migration Guide: Prerequisites

    Check the migration guide for the minimum supported versions of the source and the target

    database. The following revisions are used to create this paper:

    • Source System Revision: 1.00.122.25

    • Target System Revision: 2.00.037.02

    • Data Provisioning Agent: 2.3.5.4

    The source system used in this walkthrough is a single tenant and single node HANA

    database.

    Please check the remarks about Multi-Tenant Database Containers, SAP HANA Dynamic

    Tiering, SAP HANA liveCache as used by S4/HANA or SAP SCM, SAP HANA XS Advanced,

    Scale-Out Systems and the referenced SAP notes in the Migration Guide in case some of

    those scenarios apply to your source system.

    System Setup

    Install Target System

    Migration Guide: System Setup - Target system installation

    Download the target database installation image and perform the HANA database installation

    as documented in the SAP HANA Server Installation and Update Guide. The target database

    must be empty (use hdblcm parameters --hdbinst_server_import_content=off and

    --skip_hostagent_calls), otherwise the migration tool will not work.

    We use the following command to install the HANA database on our target system.

    The preferred method is to directly install the desired target revision. If for some reason, you

    want to install the base HANA SPS first and then perform a revision upgrade, you must use

    the hdblcm parameters --hdbupd_server_import_content=off and

    --skip_hostagent_calls.

    # ./hdblcm --action=install --hdbinst_server_import_content=off \ --skip_hostagent_calls

  • 9

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    After the installation of the target system is complete, it is recommended to create a backup

    of the HANA database so that the target system can be easily reset in case the migration

    needs to be restarted. Please make sure that you create a backup of both the SYSTEMDB and

    the tenant database.

    Prepare Target System

    Migration Guide: System Setup - Target system configuration

    For performance reasons, dynamic range partitioning must be disabled during migration.

    Connect a SQL Console to the target tenant database and use the following SQL statement to

    change the dynamic_range_check_time_interval_sec configuration parameter to “0” (the

    SELECT statement can be used to check the current setting on the source system too, this

    parameter might have to be adapted accordingly on the target system after the migration).

    Install Data Provisioning Agent (DPAgent)

    Migration Guide: System Setup - DPAgent

    The installation of the Data Provisioning Agent is described in the Installation and

    Configuration Guide for SAP HANA Smart Data Integration and SAP HANA Smart Data

    Quality. This guide is available at help.sap.com:

    https://help.sap.com/viewer/p/HANA_SMART_DATA_INTEGRATION >

    Installation and Configuration Guide > Configure Smart Data Integration >

    Install the Data Provisioning Agent

    Make sure to select the correct version of the documentation corresponding to the used

    software version. The planning section of the Migration Guide states that it is not

    recommended to install the Data Provisioning Agent directly on the SAP HANA system, it

    should run in a separate partition.

    # ./hdblcm --action=update --hdbupd_server_import_content=off \ --skip_hostagent_calls

    SELECT * FROM M_INIFILE_CONTENTS where file_name= 'indexserver.ini' and section = 'partitioning' and "KEY" = 'dynamic_range_check_time_interval_sec' ; ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'SYSTEM') SET ('partitioning', 'dynamic_range_check_time_interval_sec') = '0' WITH RECONFIGURE ;

    https://help.sap.com/viewer/p/HANA_SMART_DATA_INTEGRATION

  • 10

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    The software download location is documented in the SDI installation guide. For this test

    migration, we login to the SAP ONE Support Launchpad, navigate to

    SAP Software Download Center > Software Downloads > Support Packages &

    Patches > By Alphabetical Index (A-Z) > H > SAP HANA SDI > SAP HANA SDI 2.0

    > Comprised Software Component Versions > HANA DP AGENT 2.0

    and download the image for SP03 Patch 4 for HANA DP AGENT 2.0.

    The installation of the Data Provisioning Agent on Linux requires an existing non-root agent

    user that has full read and write access to the intended installation location.

    The DPAgent installation is performed using the following commands. You need a copy of

    the SAPCAR utility (from an existing HANA installation or download from the SAP Software

    Download Center) to unpack the HANA DPAgent image.

    ### Create new group # groupadd sapsys ### Create DPagent userid # useradd -d /usr/sap/dataprovagent -m -s /bin/bash -g sapsys dpagent ### Set password for the DPagent userid # passwd dpagent

  • 11

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Please check the output and the listed log file carefully and verify that the installation was

    successful. Also note the remarks regarding SSL and follow the steps in the Installation and

    Configuration Guide in case you want to secure the communication channel between the

    Data Provisioning Agent and the HANA server.

    Do not perform any other steps described in the Installation and Configuration Guide like

    connecting the DPAgent to the target system or installing the DP Delivery Unit. This would

    populate the target system with content and subsequently break the SAP HANA System

    Migration Tool. The migration tool will create the required connection by itself using the

    DPAgent host and port provided in the migration properties file.

    # su - dpagent dpagent@ph01dpa:~> ### Unpack and prepare installation image dpagent@ph01dpa:~> /tmp/SAPCAR -manifest SIGNATURE.SMF -R /tmp \ -xvf /tmp/IMDB_DPAGENT200_03P_20-80002267.SAR dpagent@ph01dpa:~> chmod 644 /tmp/SIGNATURE.SMF dpagent@ph01dpa:~> mv /tmp/SIGNATURE.SMF /tmp/HANA_DP_AGENT_20_PPC_64LE/ dpagent@ph01dpa:~> ### Install DPAgent dpagent@ph01dpa:~> /tmp/HANA_DP_AGENT_20_PPC_64LE/hdbinst --silent --batch \ --path=/usr/sap/dataprovagent SAP HANA Data Provisioning Agent installation kit detected. SAP HANA Lifecycle Management - dataprovagent Installation 2.3.5.4.0 ******************************************************************** Checking installation... Preparing package 'dataprovagent'... Preparing package 'Installer'... Installing SAP HANA Data Provisioning Agent to /usr/sap/dataprovagent... Installing package 'dataprovagent'... Installing package 'Installer'... ##################################################################### IMPORTANT NOTE: ##################################################################### You have installed Data Provisioning Agent with default settings. The default settings use insecure channel to communicate with HANA server. For secure communication, SSL settings must be configured via the Data Provisioning Agent Configuration tool after the installation is complete. Please see SAP HANA Smart Data Integration Installation and Configuration Guide for details on configuring SSL between the Agent and HANA server. ##################################################################### Installation done Log file written to '/var/tmp/hdb_dataprovagent_2019-07-23_08.49.10_4119 /hdbinst_dataprovagent.log' on host 'ph01dpa'.

  • 12

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Configure Data Provisioning Agent

    Migration FAQ: System Setup – DPAgent

    Please pay attention to the sections “Which parameters influence the runtime of the

    migration?” and “How should the process of optimization be implemented?” in the

    Migration FAQ. The source system used in this guide is rather small and does not warrant

    any special tuning in terms of table splitting, etc. However, a few parameters changes should

    always be applied, otherwise you risk that you run into out of memory problems and

    migration errors.

    We change the following parameters in the dpagent.ini and dpagentconfig.ini before starting

    the Data Provisioning Agent:

    Start Data Provisioning Agent

    Login with the dpagent userid and start the Data Provisioning Agent using the agentcli.sh

    tool.

    dpagent.ini: -Xmx57344m dpagentconfig.ini: adapterSession.keepAliveTimeInHours=24 framework.fetchSize=10000 framework.threadPoolSize=128

  • 13

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    # su – dpagent dpagent@ph01dpa:~> bin/agentcli.sh --configAgent Configuring the Agent at the following location: /usr/sap/dataprovagent Initializing DPAgent Configuration Tool ************************************************************ DPAgent Configuration Tool ************************************************************ 1. Agent Status 2. Start or Stop Agent 3. Agent Preferences 4. Remote Source Credentials 5. SSL Keystores 6. SAP HANA Connection 7. Agent Registration 8. Adapter Registration 9. Custom Adapters 10. Agent & Adapter Versions q. Quit b. Back ************************************************************ Enter Option:2 ************************************************************ Start or Stop Agent ************************************************************ 1. Start Agent 2. Stop Agent 3. Ping Agent q. Quit b. Back ************************************************************ Enter Option:1 Agent service location: /usr/sap/dataprovagent/bin/dpagent_service.sh dpagent_service.sh location: /usr/sap/dataprovagent/bin/dpagent_service.sh Starting agent service. Command: /usr/sap/dataprovagent/bin/dpagent_service.sh start Start service return code: 0 Press Enter to continue... ************************************************************ Start or Stop Agent ************************************************************ 1. Start Agent 2. Stop Agent 3. Ping Agent q. Quit b. Back ************************************************************ Enter Option:q

  • 14

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Enable the Data Provisioning Server

    Migration Guide: System Setup - DPServer

    Follow the steps in the Configure the Data Provisioning Server section of the SDI installation

    and configuration guide to enable a data provisioning server instance on the target system.

    The ALTER DATABASE SQL command must be used to enable the Data Provisioning

    Server on tenants in a multi-database container environment.

    We open a SQL Console to the SYSTEMDB on the target system and execute the following

    command:

    The screen shot shows the result of the alter database statement in our target system.

    Figure 3 HANA Studio - SQL Console: alter database

    Extract the Migration Tool

    Migration Guide: System Setup - Extract the Migration Tool

    The migration tool is delivered as part of the HANA 2.0 installation or update in a

    compressed tar format in the $DIR_SYSEXE/global/hdb directory. The following commands

    are used to extract the migration tool.

    ALTER DATABASE ADD 'dpserver' AT LOCATION '[:]' ;

    alter database H02 add 'dpserver' at location 'ph02nb1' ;

  • 15

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Verify Source System Compatibility

    Migration Guide: System Setup - Verify Source System Compatibility

    Execute the following SQL query on the source system to verify that the system has been

    updated to a service pack level that enables the migration tool. The query should return a row

    with ‘TRUE’.

    This is a screenshot of the query result when executed in our source system:

    # su – h02adm h02adm> cd $DIR_SYSEXE/global/hdb/ h02adm> pwd /usr/sap/H02/SYS/exe/hdb/global/hdb h02adm> tar -zxvf dbEndiannessMigration.tgz ./ ./DBMigrationTool/ ./DBMigrationTool/__init__.py ./DBMigrationTool/dropMigrationUser.py ./DBMigrationTool/exportCatalog.py ./DBMigrationTool/migrateSystem.py . . . h02adm> ls -l total 80 -r--r--r-- 1 h01adm sapsys 78711 Jun 12 04:01 dbEndiannessMigration.tgz drwxr-x--- 3 h01adm sapsys 145 Jun 12 04:01 DBMigrationTool

    SELECT 'TRUE' FROM SYS.P_PROCEDURES_ WHERE NAME = 'SYSTEM_COPY_EXPORT_CATALOG_DEV' ;

  • 16

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 4 HANA Studio - Check source system compatibility

    Create User in Source System

    Migration Guide: System Setup - Create a User in the Source System

    The migration tool requires a designated user in the source database system. Use a SQL

    Console to create a new user (please choose a secure password instead of the password used

    in this example).

    Grant Privileges to SYSTEMMIGRATION User

    Migration Guide: System Setup - Grant Privileges to SYSTEMMIGRATION User

    The migration user needs several privileges in the source system.

    • The system privileges ADAPTER ADMIN, AGENT ADMIN, CATALOG READ,

    CREATE REMOTE SOURCE, INIFILE ADMIN, IMPORT, EXPORT

    • SELECT, INSERT, UPDATE, DELETE, CREATE ANY privileges on all database

    schemas which contain tables to be migrated

    The following query can be used to list the schemas that need to be migrated (please

    check the Migration Guide that this query is still up to date):

    For each schema listed in the output of the above query, you must connect to the

    schema owner and execute the required GRANT statement. The following example

    DROP USER SYSTEMMIGRATION CASCADE ; CREATE USER SYSTEMMIGRATION PASSWORD Password123 NO FORCE_FIRST_PASSWORD_CHANGE ;

    SELECT T.SCHEMA_NAME FROM PUBLIC.TABLES T JOIN PUBLIC.SCHEMAS S ON T.SCHEMA_NAME = S.SCHEMA_NAME WHERE T.SCHEMA_NAME NOT IN ( 'SYS', '_SYS_XB', '_SYS_AFL', '_SYS_AUDIT', '_SYS_EPM', '_SYS_EPM_DATA', '_SYS_SECURITY', '_SYS_SQL_ANALYZER', '_SYS_STATISTICS', '_SYS_TASK', '_SYS_TELEMETRY', '_SYS_WORKLOAD_REPLAY') AND S.SCHEMA_OWNER '_SYS_REPO' GROUP BY T.SCHEMA_NAME ;

  • 17

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    shows the grant of the required privileges for the SAPABAP1 schema of our source

    database.

    • EXECUTE on SYS.SYSTEM_COPY_EXPORT_CATALOG_DEV privilege

    This privilege must be granted by the SYSTEM user.

    Grant access to schemas created by the HANA Repository

    The SYSTEMMIGRATION user needs access to the schemas created by the HANA

    repository. A design time role is required to grant these privileges.

    Create Design Time Role

    For information about creating a design-time role, please check the HANA documentation

    available at:

    https://help.sap.com/viewer/product/SAP_HANA_PLATFORM/1.0.12/en-US

    Development > View All > SAP HANA Developer Guide (How to build applications

    using the SAP HANA studio, …) > Setting Up Roles and Privileges > Create a

    Design-Time Role

    A step by step guide to create design time roles in HANA is also available at the following

    SAP community blog:

    https://blogs.sap.com/2017/02/09/a-step-by-step-guide-to-create-design-time-script-based-

    roles-in-sap-hana/

    The following shows the necessary steps performed to create this design time role in our

    source system.

    Create Project

    1. Login to HANA Studio.

    2. Click on Open Perspective icon ( icon in the upper right corner).

    3. Select SAP HANA Development.

    CONNECT SAPABAP1 PASSWORD Password123 ; GRANT SELECT, INSERT, UPDATE, CREATE ANY, DELETE ON SCHEMA SAPABAP1 TO SYSTEMMIGRATION ;

    CONNECT SYSTEM PASSWORD Password123 ; GRANT EXECUTE ON SYS.SYSTEM_COPY_EXPORT_CATALOG_DEV TO SYSTEMMIGRATION ;

    https://help.sap.com/viewer/product/SAP_HANA_PLATFORM/1.0.12/en-UShttps://blogs.sap.com/2017/02/09/a-step-by-step-guide-to-create-design-time-script-based-roles-in-sap-hana/https://blogs.sap.com/2017/02/09/a-step-by-step-guide-to-create-design-time-script-based-roles-in-sap-hana/

  • 18

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    4. Select File > New > Project…

    5. Select General > Project and click Next.

    6. Enter project name systemmigration and click Finish.

    You should now see the systemmigration project in the Project Explorer.

    Figure 5 HANA Studio - Create systemmigration project

    Create a new folder in systemmigration project

    1. Select the new systemmigration project, right mouse-click, New > Folder.

    2. Enter folder name utils and click Finish.

    Create Design-time role

    1. Select the utils folder, then File > New > Other…

    2. Select SAP HANA > Database Development > Role and click the Next button.

    3. In the New role wizard, leave the Container name as /systemmigration/utils, enter the

    Role Name migration and click the Finish button.

    4. The role editor will open with an empty template for the new role.

    Figure 6 HANA Studio - role editor

    5. Open a SQL Console and check the schemas that the migration user needs to access:

  • 19

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    6. For each schema, add the required privilege statement to the design time role editor as

    described in the migration guide.

    As an alternative, you can login with the sidadm user in a terminal session on the

    source systems and create a text file called generate_migration_role.sql with the

    following content:

    Then use the hdbsql tool to run these SQL statements:

    SELECT SCHEMA_NAME FROM PUBLIC.SCHEMAS WHERE SCHEMA_OWNER = '_SYS_REPO' ;

    SELECT 'role systemmigration.utils::migration {' FROM DUMMY; SELECT ' catalog schema "'|| SCHEMA_NAME || '": SELECT, INSERT, UPDATE, DELETE;' FROM PUBLIC.SCHEMAS WHERE SCHEMA_OWNER = '_SYS_REPO'; SELECT ' catalog schema "_SYS_STATISTICS": SELECT;' FROM DUMMY; SELECT ' system privilege: ADAPTER ADMIN, AGENT ADMIN, CATALOG READ, CREATE REMOTE SOURCE, DATA ADMIN, INIFILE ADMIN, IMPORT, EXPORT;' FROM DUMMY; SELECT '}' FROM DUMMY;

  • 20

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    7. Copy the generated output of the script to the role editor in HANA studio.

    Figure 7 HANA Studio – Role Editor: migration.hdbrole

    8. Save the role using File > Save.

    9. In the Project Explorer pane, right click on migration.hdbrole and select Validate.

    The validation should complete without warnings or errors.

    10. Create a repository workspace

    a. Switch to repository tab, select the migration source system, right click and

    select Create Repository Workspace.

    b. Select source system, verify the Workspace Root folder, and click Finish.

    h01adm> hdbsql -i 00 -u SYSTEM -p Password123 -x -j -a -C -I \ generate_migration_role.sql role systemmigration.utils::migration { catalog schema "_SYS_REPO": SELECT, INSERT, UPDATE, DELETE; catalog schema "_SYS_XS": SELECT, INSERT, UPDATE, DELETE; catalog schema "_SYS_RT": SELECT, INSERT, UPDATE, DELETE; catalog schema "_SYS_BI": SELECT, INSERT, UPDATE, DELETE; catalog schema "_SYS_BIC": SELECT, INSERT, UPDATE, DELETE; catalog schema "SAP_REST_API": SELECT, INSERT, UPDATE, DELETE; catalog schema "UIS": SELECT, INSERT, UPDATE, DELETE; catalog schema "HANA_XS_BASE": SELECT, INSERT, UPDATE, DELETE; catalog schema "SAP_XS_LM_PE_TMP": SELECT, INSERT, UPDATE, DELETE; catalog schema "SAP_XS_LM_PE": SELECT, INSERT, UPDATE, DELETE; catalog schema "SAP_XS_USAGE": SELECT, INSERT, UPDATE, DELETE; catalog schema "SAP_XS_LM": SELECT, INSERT, UPDATE, DELETE; catalog schema "SAP_HANA_BACKUP": SELECT, INSERT, UPDATE, DELETE; catalog schema "SAP_AUTHORIZATION": SELECT, INSERT, UPDATE, DELETE; catalog schema "SAP_HANA_ADMIN": SELECT, INSERT, UPDATE, DELETE; catalog schema "_SYS_STATISTICS": SELECT; system privilege: ADAPTER ADMIN, AGENT ADMIN, CATALOG READ, CREATE REMOTE SOURCE, DATA ADMIN, INIFILE ADMIN, IMPORT, EXPORT; }

  • 21

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 8 HANA Studio - Create New Repository Workspace

    11. Activate the new design time role

    a. Switch back to Project Explorer tab, right click on project systemmigration,

    and select Team > Share Project...

    b. In the Share Project window, select the Repository Workspace of the source

    system. Make sure to check the Add Project Folder as Subpackage check box

    and click Finish.

  • 22

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 9 HANA Studio - Share Project

    c. The systemmigration package should now appear on the Repositories tab.

  • 23

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 10 HANA Studio - systemmigration in repository tab

    12. To activate the role, open source system > (Default) > systemmigration > utils. Right

    click on migration.hdbrole and select Activate.

  • 24

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    13. Verify that the new role is listed on the Systems tab entry of the source system under

    Security > Roles (Right-click on Roles allows you to define a filter, enter the filter

    pattern “migration” to search for the new role).

    Figure 11 HANA Studio – migration role in Systems tab

    14. Add the migration role to the systemmigration user.

    On the Systems tab, open Security> Users, right click on SYSTEMMIGRATION user

    and select Open. In the Granted Roles pane, add the new role and click the Deploy

    icon to activate the change.

  • 25

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 12 HANA Studio – add migration role to systemmigration user

    Update migration tool configuration file

    Migration Guide: System Setup – Configuration

    The migration tool uses a configuration file for parametrization. A template file named

    migration.properties is available in the DBMigrationTool directory. Please check the

    Migration Guide for the documentation of the available parameters and the Migration FAQ

    for parameter recommendations.

    The following shows the content of the migration.properties file we use for our test

    migration. Please note that we just changed the host and port parameters in the source, target,

    and agent sections and adjusted the concurrency parameters to match the size of the target

    LPAR.

  • 26

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Migration Process Before starting the actual migration process, please pay attention to the “Is there any

    recommendation that needs to be considered before starting the migration?” section in the

    Migration FAQ and check the referenced notes to perform a cleanup of several tables in the

    source system.

    [source] host = ph02na1 port = 30015 user = SYSTEMMIGRATION [target] host = ph02nb1 port = 30015 [agent] host = ph01dpa port = 5050 [schemas] #exceptionList = exceptionList = /usr/local/bin/schema.exclude [tables] #list = #exceptionList = #excludedTablesQuery = loadOrder = largestFirst [main] logLevel = INFO logSql = false concurrency = 64 ddlConcurrency = 8 dataConcurrency = 63 parallelTasks = 1 dataSourcePrefix = MIGRATE_DS agentName = MIGRATE_AGENT dataSourceTypeForInitialLoad = SDI initialLoadRetryCount = 3 [splitting] splitThreshold = 100000000 maxPartitions = 1000 parallelTaskOperations = 8 parallelPartitionsInTask = 12 [nativecopy] sizeThreshold = 26000000000 rowThreshold = 600000000 chunkSize = 1000000

  • 27

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Stop using the source system

    Migration Guide: Migration Process – Stop using the source system

    Stop all SAP NetWeaver application servers connected to source database system:

    Start database migration tool

    Migration Guide: Migration Process – Initial Load

    The following commands are used to start the migration process on our target system.

    Monitor database migration

    Migration Guide: Migration Process – Check migration status

    After the initial catalog migration completed, you can monitor the migration process using

    the following SQL statements on the target system:

    The migration tool will stop automatically after the migration of all tables has been

    completed. Check the SYSTEM_MIGRATION_TASKS table for the status of the migration

    run.

    # su – h02adm h02adm> stopsap

    # su – h02adm h02adm> export PYTHONPATH=$DIR_SYSEXE/global/hdb:$PYTHONPATH h02adm> cd $DIR_SYSEXE/global/hdb/DBMigrationTool h02adm> python migrateSystem.py --configFile=./migration.properties

    connect systemmigration password Password123 ; SELECT * FROM CATALOGMIGRATION_RESULTS ; SELECT * FROM CATALOGMIGRATION_RUNS ; SELECT status, count(*) FROM SYSTEM_MIGRATION_TASKS group by status ;

  • 28

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 13 HANA Studio – SQL Console: results of migration run

    Please check the Troubleshooting section in the Migration Guide in case the migration tool

    ends with an error or the above query shows migration tasks with an ERROR status.

    Post Migration

    Migration Guide: Migration Process – Post Migration

    Immediately after the previous step, the migration tool must be re-started with the

    --postMigration parameter to perform the post migration steps. Once that is complete, the

    HANA database must be restarted.

    After the restart of the HANA database, the hdbupdrep tool must be called to perform a

    content upgrade to the SAP HANA 2.0 level:

    # su – h02adm h02adm> export PYTHONPATH=$DIR_SYSEXE/global/hdb:$PYTHONPATH h02adm> cd $DIR_SYSEXE/global/hdb/DBMigrationTool h02adm> python migrateSystem.py --configFile=./migration.properties \ --postMigration h02adm> HDB stop h02adm> HDB start

  • 29

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Switch application server to new HANA 2.0 database

    Migration Guide: Migration Process – Post Migration

    After the database migration has been completed, all application servers or HANA clients

    must be moved to the new target system. Please check the SAP Product and Availability

    Matrix that your application server OS release combination is compatible with HANA 2.0.

    Normally this shouldn’t be a problem, but in some cases, it might require an SAP NetWeaver

    kernel upgrade to a newer kernel version. Ideally, as the recent kernel versions like SAP

    # su – h02adm h02adm> cd /usr/sap/$SAPSYSTEMNAME/SYS/global/hdb/install/bin h02adm> ./hdbupdrep SAP HANA Lifecycle Management - Update Repository 2.3.86 ******************************************************** Enter System Database User Name [SYSTEM]: Enter System Database User (SYSTEM) Password: Importing delivery units... Importing delivery unit HCO_INA_SERVICE Importing delivery unit HANA_DT_BASE Importing delivery unit HANA_IDE_CORE Importing delivery unit HANA_TA_CONFIG Importing delivery unit HANA_UI_INTEGRATION_SVC Importing delivery unit HANA_UI_INTEGRATION_CONTENT Importing delivery unit HANA_XS_BASE Importing delivery unit HANA_XS_DBUTILS Importing delivery unit HANA_XS_EDITOR Importing delivery unit HANA_XS_IDE Importing delivery unit HANA_XS_LM Importing delivery unit HDC_ADMIN Importing delivery unit HDC_BACKUP Importing delivery unit HDC_IDE_CORE Importing delivery unit HDC_SEC_CP Importing delivery unit HDC_SYS_ADMIN Importing delivery unit HDC_XS_BASE Importing delivery unit HDC_XS_LM Importing delivery unit SAPUI5_1 Importing delivery unit SAP_WATT Importing delivery unit HANA_SEC_CP Importing delivery unit HANA_BACKUP Importing delivery unit HANA_HDBLCM Importing delivery unit HANA_SEC_BASE Importing delivery unit HANA_SYS_ADMIN Importing delivery unit HANA_ADMIN Importing delivery unit HANA_WKLD_ANLZ Update Repository done Log file written to '/var/tmp/hdb_H02_UpdateRepository_2019-08-08_08.11.21/hdbupdrep.log' on host 'ph02nb1'.

  • 30

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    kernel 7.49 or SAP kernel 7.53 are compatible with both HANA 1.0 and HANA 2.0, this

    kernel upgrade and, if necessary, a HANA client upgrade should be performed well in

    advance to the HANA database migration itself.

    We change the client connection information in the hdbuserstore to reflect the new target

    system.

    This step must be repeated on each application server of a 3-tier landscape with multiple SAP

    application servers and local hdbuserstore containers. In landscapes where the SAP HANA

    connection data is centrally stored in the ABAP SFFS (secure storage in the file system)

    already, you should follow the instructions in SAP Note 2154997 - Migration of hdbuserstore

    entries to ABAP SSFS to update the connection data.

    The last step is to change or verify the relevant parameters in the DEFAULT.PFL to the

    hostname and tenant name of the target system. The output of the grep command below

    shows the relevant parameters in our system.

    The database connection to the new target system can be tested with the R3trans command.

    R3trans should finish with a return code 0000. You can also check the generated trans.log

    trace file for additional details.

    # su - h02adm ph02as2:h02adm 1> hdbuserstore list DATA FILE : /home/h02adm/.hdb/ph02as1/SSFS_HDB.DAT KEY FILE : /home/h02adm/.hdb/ph02as1/SSFS_HDB.KEY KEY DEFAULT ENV : ph02na1.isicc.de.ibm.com:30015 USER: SAPABAP1 ph02as2:h02adm 2> hdbuserstore delete DEFAULT ph02as2:h02adm 3> hdbuserstore set DEFAULT ph02nb1.isicc.de.ibm.com:30013@H02 \ SAPABAP1 Password123 ph02as2:h02adm 4> hdbuserstore list DATA FILE : /home/h02adm/.hdb/ph02as2/SSFS_HDB.DAT KEY FILE : /home/h02adm/.hdb/ph02as2/SSFS_HDB.KEY KEY DEFAULT ENV : ph02nb1.isicc.de.ibm.com:30013 USER: SAPABAP1 DATABASE: H02

    ph02as2:h02adm 79> egrep "ph02nb1|H02" \ /usr/sap/$SAPSYSTEMNAME/SYS/profile/DEFAULT.PFL SAPDBHOST = ph02nb1 j2ee/dbname = H02 j2ee/dbhost = ph02nb1 dbs/hdb/dbname = H02 SAPSYSTEMNAME = H02 rdisp/msserv = sapmsH02

    https://launchpad.support.sap.com/#/notes/2154997https://launchpad.support.sap.com/#/notes/2154997

  • 31

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Start Application Server

    This SAPGUI screenshot shows the SAP HANA database Overview screen (transaction st04)

    after the application server has been moved to the target system.

    Figure 14 SAPGUI – SAP HANA database Overview

    Drop Migration User

    After the migration has finished successfully, the migration user id and its related objects

    should be dropped on the target system for security reasons.

    ph02as2:h02adm 80> R3trans -x This is R3trans version 6.26 (release 753 - 29.11.18 - 20:18:11). unicode enabled version R3trans finished (0000).

    # su - h02adm ph02as2:h02adm 1> startsap

    # su – h02adm h02adm> cd /usr/sap/$SAPSYSTEMNAME/SYS/exe/hdb/global/hdb/DBMigrationTool h02adm> python dropMigrationUser.py --host ph02nb1 --port 30015 \ --migrationUserToDrop SYSTEMMIGRATION

  • 32

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Manual Postprocessing

    Migration Guide: Migration Process – Post Migration

    Please check the Manual Postprocessing section in the Migration Guide for additional tasks

    that might have to be performed after the migration.

    In our system, we enable SAP Host Agent calls using the instructions in SAP Note 2023587 -

    Maintaining "hdbuserstore" using "setProperty" for SAP Host Agent. We recommend that

    you first upgrade the installed SAP Host Agent to the latest available version as described in

    SAP Note 1031096 - Installing Package SAPHOSTAGENT. Please note that the saphostctrl

    command must be executed twice (with slightly different options), the first one enables SAP

    Host Agent calls on the System DB and the second one on the tenant DB.

    # /usr/sap/hostctrl/exe/saphostctrl \ -host ph02nb1 -user h02adm Password123 \ -dbname SYSTEMDB@H02 -dbtype hdb \ -dbuser SYSTEM -dbpass Password123 \ -function SetDatabaseProperty DBCredentials=SET \ -dboption Password=Password123 Webmethod returned successfully Operation ID: FA71DDD59E201EE8A380E1D16BBC1670 ----- Log messages ---- Info: saphostcontrol: Executing SetDatabaseProperty Info: saphostcontrol: SetDatabaseProperty successfully executed # /usr/sap/hostctrl/exe/saphostctrl \ -host ph02na1 -user h02adm Password123 \ -dbname H02@H02 -dbinstance HDB00 -dbtype hdb \ -dbuser SYSTEM -dbpass Password123 \ -function SetDatabaseProperty DBCredentials=SET \ -dboption Password=Password123 Webmethod returned successfully Operation ID: FA71DDD59E201EE8A380E639363C9D64 ----- Log messages ---- Info: saphostcontrol: Executing SetDatabaseProperty Info: saphostcontrol: SetDatabaseProperty successfully executed

    https://launchpad.support.sap.com/#/notes/2023587https://launchpad.support.sap.com/#/notes/2023587https://launchpad.support.sap.com/#/notes/1031096

  • Part II – Combined Migration Method In the second part, we will now record the migration of the same system again using the

    combined migration method. Before the migration can start, the target system must be reset

    using the backup that was taken after the initial installation and preparation steps.

    Figure 15 illustrates the approach for the combined migration:

    • The SAP HANA Migration Tool migrates the database catalog and all the data that is

    not part of the SAP NetWeaver ABAP schema.

    • SWPM 1.0 uses R3load to migrate then SAP NetWeaver ABAP schema.

    Caution: The R3load based method will handle only those objects of the SAP

    NetWeaver ABAP schema that are also known in the ABAP dictionary. Any database

    objects that are not defined in the ABAP dictionary will not be copied.

    Figure 15 Overview - Combined migration method

    The migration process workflow of the combined migration method is as follows:

    Combined Migration Guide: Solution – Detailed Process

    • Prepare the databases and migration tools on both source and target hosts

    o The setup of the SAP HANA Migration Tool should be done according to part I

    of this document.

    o The setup of the SWPM tool is outlined below.

    This includes the sub steps

  • 34

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    ▪ Export Preparation (Optional)

    the target structure for the exported data is created

    ▪ Table Splitting Preparation

    In case of very large tables, they are analyzed in advance to allow an

    export with parallel R3load processes. Individual Select ranges are

    identified, so that each of the parallel R3load processes will handle a

    balanced amount of data.

    • Start the migration for the complete database catalog to the target database using the

    SAP HANA Migration Tool. After the catalog migration, the SAP HANA Migration

    Tool continues to migrate the remaining data (outside of the data in the ABAP

    schema).

    • Concurrently start the export of the ABAP schema in the source system using SWPM.

    • After the SWPM export is done, the SWPM import can be started only after the SAP

    HANA Migration Tool has completed the catalog migration.

    • When both migration tools have finished, execute the post migration steps for both the

    SAP HANA Migration Tool and SWPM.

    Note: The SWPM system copy tools allow for running the export and import phases in

    parallel to further optimize the required downtime window. However, the SWPM import must

    only be started after the SAP HANA Migration Tool has finished the initial catalog migration.

    The whole procedure must be carefully managed and should only be executed by an

    experienced migration consultant. In our walkthrough, we run the export and import phases

    sequentially.

    Detailed Process

    The following figure gives an overview of the test landscape used for this migration test:

    Figure 16 Combined Migration – Detailed Process

    1. The SAP HANA Migration Tool is started on the target host.

  • 35

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    It communicates with the DP Agent, which connects to the source database.

    2. The SWPM export task is started on the SAP application server to export the ABAP

    schema in the source database.

    3. When the SAP HANA Migration Tool has finished the initial catalog migration step

    and the SWPM export task has completed the data export, the SWPM import is started

    to import the data of the ABAP schema.

    4. Once both tools finished the data migration, the post-processing steps are executed.

    5. The repository upgrade on the target database is performed.

    Figure 17 illustrates the sequence of the different working streams for the hybrid migration:

    Figure 17 Execution of the hybrid migration

    • SAP HANA Migration Tool and SWPM export can run in parallel. Typically, the

    database export will take longer than the catalog migration.

    • The database import must not start before the catalog migration (part of the SAP

    HANA Migration Tool execution) is finished. The catalog migration will create the

    objects (e.g. tables) in the ABAP database schema – the existence of all those is a

    prerequisite for the SWPM import as part of the Combined Migration Method.

    • Depending on the strategy, there might be an additional step required for copying the

    data generated by the export processes to the repository of the import processes.

    • In an enhanced setup, SWPM export and SWPM import may run in parallel. Such an

    enhanced setup is out of the scope of this document.

  • 36

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    System Setup The HANA source system used in our test environment is relatively small and the largest

    table has about a hundred thousand rows. If you plan to migrate a very large database, please

    check in advance whether the source system has tables in the ABAP schema with more than

    two billion rows. In that case, you must follow the instructions in SAP Note 2784715 -

    SWPM: Using R3load-based migration for SAP System on HANA when tables contain more

    than 2 billion rows, otherwise a R3load based copy attempt will fail.

    Prepare SWPM

    With the combined migration method, SAP Software Provisioning Manager (SWPM) is used

    to export all SAP tables belonging to the ABAP database schema of the source system. Later

    SWPM is used again to load the data in the target system.

    • Export with SWPM needs to be setup for the source system.

    • Import with SWPM needs to be setup for the target system.

    Typically, export and import are executed on one or more SAP application servers.

    Sufficient compute capacity and network connectivity between database and application

    servers is required to achieve the desired throughput for both export and import.

    Download SAP SWPM software

    Download the latest patch of SWPM 1.0 for the OS of the SAP application server.

    For this test migration, we login to the SAP ONE Support Launchpad, navigate to

    SAP Software Download Center > Software Downloads > Support Packages &

    Patches > By Alphabetical Index (A-Z) > S > SL TOOLSET > SL TOOLSET 1.0 >

    ENTRY BY COMPONENT > SOFTWARE PROVISIONING MANAGER > SOFTWARE

    PROVISIONING MGR 1.0

    and download SWPM 1.0 SP26 for NW higher than 7.0x for LINUX ON POWER LE 64BIT.

    Make sure that you select the package that matches the OS of your application server.

    Current SWPM releases do not contain content for SAP NetWeaver 7.4 anymore – in case of

    such a system, an older SWPM release may be required.

    Unpack SWPM software

    Copy the SWPM software archive to the SAP application server and unpack the file with the

    SAPCAR.

    # mkdir /sapexport/swpm # cd /sapexport/swpm # /usr/sap/hostctrl/exe/SAPCAR -xf /tmp/SWPM10SP26_7-70002492.SAR SAPCAR: processing archive /tmp/SWPM10SP26_7-70002492.SAR (version 2.01) SAPCAR: 449 file(s) extracted

    https://launchpad.support.sap.com/#/notes/2784715https://launchpad.support.sap.com/#/notes/2784715https://launchpad.support.sap.com/#/notes/2784715

  • 37

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Create a dump directory for the Export

    During the execution of the SWPM export, the R3load processes writes database content to a

    set of dump files in a database independent and compressed format. As the data is already

    compressed within the SAP HANA database, the additional compression rate is small and

    enough disk space for the dump directory must be provisioned.

    The filesystem used for the dump directory should have enough free space similar to the data

    content size of the SAP HANA source database.

    Ensure that the directory does not contain any files from any previous export run. In case a

    system copy export was cancelled, delete all files from previous runs before a new export is

    started.

    The SWPM export creates the following structure in the dump directory:

    Figure 18: SWPM Export – Dump Directory Structure

    Create a work directory for SWPM export and import

    Create several work directories for SWPM and change the ownership and access permissions.

    At least 300 MB free space are required in the work directory for each installation option. In

    addition, 300 MB free space are required for the installer executables (sapinst_instdir).

    # mkdir /sapexport/dump

    # cd /sapexport # mkdir export import prep_split tmp # chown root:sapinst export import prep_split # chmod 775 export import prep_split # chmod 777 tmp

  • 38

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Prepare Table Splitting, shortly before the Export

    An SAP ABAP system consists of thousands of tables, but typically only a small number of

    tables contain the majority of the data. These tables may take a long time to export and

    import and, in many cases, dominate the runtime of a database migration.

    Splitting the tables with the Table Splitter allows for parallel export/import at the table level

    and can help to optimize the migration runtime. The Table Splitter is imbedded into the

    SWPM export/import execution, a file containing the table names and their desired

    parallelism needs to be supplied to the process.

    The goal is to maximize the throughput on the SAP application servers during the entire

    runtime for the both the export and import phases – and to avoid single long running

    export/import processes dominating the overall runtime. The handling of tables with their

    own processes, Table Splitting, and splitting the TABART sets into more granular packages

    help to achieve this goal. Splitting into too many packages with too high parallelism will

    increase complexity and overhead and should be avoided. This might require several

    optimizations to ensure an optimal setup for a production migration. Especially Table

    Splitting requires a lot of experience and additional manual steps, it should be executed by

    experienced consultants with SAP OS/DB migration knowledge.

    Some additional considerations:

    Software Provisioning Manager 1.0 SP25

    and older

    no support for table splitting via partitions

    potential issues in case of splitting tables

    • with more than 3 key fields

    • with more than 2 billion rows

    Software Provisioning Manager 1.0 SP26 table splitting via partitions supported

    It is strongly recommended to use the latest SWPM release.

    Identify the largest tables

    The following SQL statement may be used to query the SAP HANA source database for the

    largest tables in order to identify candidates for table splitting.

    SELECT TABLE_NAME, TABLE_SIZE FROM SYS.M_TABLES WHERE SCHEMA_NAME = 'SAPABAP1' ORDER BY TABLE_SIZE DESC ;

  • 39

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 19: SAP HANA SQL Console – Query largest tables

    Create a split file

    For the SAP splitting tools, the candidate tables need to be referenced in a file containing a

    list of

    • the table names

    • the intended parallelism for the export of the table

    Create a split_file where each line in the file follows the pattern:

    The split file content is later evaluated by the SAPuptool, which calculates a WHERE clause

    that is used during the export phase.

    %

  • 40

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    The goals for the export phase are:

    • a large table gets processed in multiple smaller packages

    • each table row is handled by one and only one R3load process

    • each R3load process has a comparable working set to process

    If an export or import of a table aborts with an error, only the failed package needs to be

    repeated. Export and import of one table are performed in parallel by starting multiple R3load

    processes. If the parallel processing is not optimal or single packages are processed in serial,

    the complete processing time for one table may increase.

    Caution: a number of specific tables related to the ABAP data dictionary or sequencing

    cannot be split. This restriction includes the following tables.

    Example for a split_file (SAP S/4HANA IDES System).

    Optimize the split file (SWPM 1.0 SP26)

    SWPM 1.0 SP26 includes further optimizations for table splitting. Please check SAP Note

    2779173 for more details about this optimized table splitting process.

    The prerequisites for using the optimizeTableSplitter.py tool are

    • Python is installed on the SAP Application Server performing the export

    • the HANA database client library is available in the Python environment,

    otherwise install it from the HANA client directory, e.g.

    pip install /usr/sap/hdbclient/hdbcli-N.N.N.tar.gz

    DDNTF DDNTF_CONV_UC DDNTT DDNTT_CONV_UC DDLOG (is never copied, but created empty in the target system) DDXTT DDXTF DDXTT_CONV_UC DDXTF_CONV_UC

    DOKTL%10 D010TAB%5 REPOSRC%4 RSMPTEXTS%3 T100%3 DD04T%3 D010INC%2 DD07T%2 DD03L%2 REPOTEXT%2 DBTABLOG%2 D021T%2 TLANINDX%2

    https://launchpad.support.sap.com/#/notes/2779173https://launchpad.support.sap.com/#/notes/2779173

  • 41

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    • the environment variable PYTHONPATH is set to the HANA client directory

    • a split file with % entries as documented above

    The following python script call uses the input split file and creates a new file with additional

    information for the generation of the WHERE clauses.

    The new split file contains all the tables from the input file as well as additional command

    flags for the SAPuptool execution related to splitting method and keyfields.

    Caution: the option -f in the optimizeTableSplitter.py tool will load the table into SAP

    HANA memory as required. This is the recommended execution option but may consume

    additional memory. If the table is not loaded into SAP HANA memory, then the

    optimizeTableSplitter.py tool might not find a suitable keyfield for table splitting. SAPuptool

    then splits a table on the primary key columns provided from the ABAP dictionary only,

    which may result in unbalanced split ranges.

    Example for an optimized split file:

    Start SWPM Table Splitting

    Change to the working directory for the export on the SAP application server of the source

    system and start the sapinst tool as root with the SUPPORT_DECLUSTERING option set to

    false.

    sapinst provides the URL for login to the SWPM GUI using the root userid and password of

    the application server.

    In the SWPM GUI, we navigate to

    # su – h02adm h02adm> cd /sapexport/prep_split h02adm> setenv PYTHONPATH /usr/sap/$SAPSYSTEMNAME/hdbclient h02adm> python /sapexport/swpm/COMMON/INSTALL/HDB/optimizeTableSplitter.py \ -i split_file -o split_file.opt -f

    H02adm> cat split_file.opt DOKTL%10,method=standard keyfields=LINE D010TAB%5,method=standard keyfields=TABNAME REPOSRC%4,method=standard keyfields=IDATE RSMPTEXTS%3,method=standard keyfields=SPRSL T100%3,method=standard keyfields=SPRSL DD04T%3,method=standard keyfields=DDLANGUAGE D010INC%2,method=standard keyfields=MASTER DD07T%2,method=standard keyfields=DDLANGUAGE DD03L%2,method=standard keyfields=LENG REPOTEXT%2,method=standard keyfields=DATALG DBTABLOG%2,method=standard keyfields=USERNAME D021T%2,method=standard keyfields=LANG TLANINDX%2,method=standard

    # cd /sapexport/prep_split # /sapexport/swpm/sapinst SUPPORT_DECLUSTERING=false

  • 42

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Software Provisioning Manager 1.0 SP 26 > SAP S/4HANA 1610 > SAP

    S/4HANA Server > SAP HANA Database > System Copy > Source System >

    Based on AS ABAP > Table Splitting Preparation

    The Next button at the bottom of the screen then starts the Table Splitting Preparation

    workflow. This workflow is an optional step to prepare the splitting of tables before starting

    the actual export.

    During the step

    • the export directory DATA is created

    • all the database structure files (*.STR) for the tables to be split are created

    • the generated STR files are split

    • the where-conditions for the tables to be split are generated

    • the generated WHR files are copied to the export directory DATA

    We follow the instructions on the GUI and enter the requested parameters, including the

    export location, the target database type, the file with the optimized split information, the

    export directory, and the number of parallel SAPuptool jobs.

  • 43

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 20: SWPM - Table Splitting Preparation

    On the Declustering / Depooling Option screen, verify that SWPM was started with the

    SUPPORT_DECLUSTERING=false option:

    The next screen allows for a final review of the parameters, clicking Next again starts the

    execution of the table split preparation. Confirm with Ok and then use the Exit button to stop

    the sapinst process in the terminal session.

    The ABAP/DATA subdirectory of the dump directory will now contain the WHERE clauses

    created by this workflow. These will be used later during the SWPM export phase.

  • 44

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Prepare SAP HANA System Migration Tool

    We’ve now finished the necessary preparations to start the SWPM export process.

    Before we can start the actual database migration, we need to perform all the steps

    documented in part I of this document up to the START DATABASE MIGRATION TOOL section.

    Update migration tool configuration file

    Migration Guide: System Setup – Configuration

    For the combined migration method, the ABAP database schema of the source system is

    handled by SWPM, so it needs to be excluded from the SAP HANA Migration Tool

    processing. The migration.properties file used in part I needs to be updated to include an

    exceptionlist parameter.

    Create a file containing the name of the schema that should be excluded.

    Add an exceptionlist parameter with the file name of the exclude file in the [schemas] section

    of the migration.properties file:

    Start the SAP HANA Migration Tool for Catalog Migration and Migration of other data

    Warning: at this time, all SAP NetWeaver application servers connected to the source

    database system must be stopped!

    We can now start the SAP HANA System Migration Tool as described in section START

    DATABASE MIGRATION TOOL in part I of this document.

    # ls /sapexport/dump/ABAP/DATA D010INC-1.WHR DD03L-1.WHR DOKTL-5.WHR RSMPTEXTS-3.WHR D010INC-2.WHR DD03L-2.WHR DOKTL-6.WHR RSMPTEXTS-4.WHR D010INC-3.WHR DD04T-1.WHR DOKTL-7.WHR T100-1.WHR D010TAB-1.WHR DD04T-2.WHR DOKTL-8.WHR T100-2.WHR D010TAB-2.WHR DD04T-3.WHR DOKTL-9.WHR T100-3.WHR D010TAB-3.WHR DD04T-4.WHR REPOSRC-1.WHR T100-4.WHR D010TAB-4.WHR DD07T-1.WHR REPOSRC-2.WHR TLANINDX-1.WHR D010TAB-5.WHR DD07T-2.WHR REPOSRC-3.WHR TLANINDX-2.WHR D010TAB-6.WHR DOKTL-1.WHR REPOSRC-4.WHR TLANINDX-3.WHR D021T-1.WHR DOKTL-10.WHR REPOTEXT-1.WHR TLANINDX-4.WHR D021T-2.WHR DOKTL-2.WHR REPOTEXT-2.WHR whr.txt DBTABLOG-1.WHR DOKTL-3.WHR RSMPTEXTS-1.WHR DBTABLOG-2.WHR DOKTL-4.WHR RSMPTEXTS-2.WHR

    h02adm> cd $DIR_SYSEXE/global/hdb/DBMigrationTool h02adm> echo 'SAPABAP1' > combined_migration.exclude

    [schemas] exceptionlist = combined_migration.exclude

  • 45

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Use the monitoring SQL statements described in MONITOR DATABASE MIGRATION to check

    the status of the catalog migration.

    While the SAP HANA System Migration Tool is running, we can start the SWPM export of the

    ABAP schema.

    After the initial catalog migration and SWPM export completed, we can start the SWPM

    import process in parallel while the SAP HANA System Migration Tool still continues to

    migrate the data of the tables outside of the ABAP schema.

    Once the SAP HANA System Migration Tool completes, we still have to wait for the SWPM

    import process to finish before we can continue with the post-processing steps described in

    part I.

    Start SWPM Export phase

    We change to the export work directory and start sapinst with the option

    SUPPORT_DECLUSTERING set to false to start the database export of the ABAP schema.

    We use the provided URL to login to the SWPM GUI and navigate to

    Software Provisioning Manager 1.0 SP 26 > SAP S/4HANA 1610 > SAP

    S/4HANA Server > SAP HANA Database > System Copy > Source System >

    Based on AS ABAP > Database Instance Export

    We start the database export workflow with the Next button. On the Database Export screen,

    we select our prepared dump directory as export location and continue with Next.

    # cd /sapexport/export # /sapexport/swpm/sapinst SUPPORT_DECLUSTERING=false

  • 46

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 21 SWPM - Database Export parameters

    On the next screen, we select SAP HANA Database as target database type and continue with

    Next. The workflow then asks whether SMIGR_CREATE_DDL should be executed. This isn’t

    necessary as all database structures in the target system are created by the SAP HANA

    migration tool instead of SWPM, so we select the option to skip the report.

  • 47

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    We step through the remaining workflow using mostly the suggested default options on each

    screen. We adjust the Number of Parallel Jobs parameter to 32 to match the available

    processor resources on our application server.

    Then we start the export process with the Next button on the Review Parameters screen.

    Start SWPM Import

    Caution: Before we can start the SWPM import process, the catalog migration part of the

    SAP HANA System Migration tool must be finished! Check the migration tool output, the

    monitoring queries described in part I and the following query to verify that the catalog

    migration has finished.

    The SWPM import process expects that the ASCS instance is up and running, so we start this

    in advance.

    Then we change to our import work directory and start sapinst one more time to start the

    database import of the ABAP schema. For the SWPM import, sapinst must be called with the

    additional option HDB_IMPORT_WITH_SDI=true.

    SELECT MAX(END_TIME) FROM CATALOGMIGRATION_RUNS ;

    # su – h02adm # startsap r3 ASCS01

  • 48

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    After login to the SWPM GUI at the provided URL, we navigate to

    Software Provisioning Manager 1.0 SP 26 > SAP S/4HANA 1610 > SAP

    S/4HANA Server > SAP HANA Database > System Copy > Target System >

    Standard System > Based on AS ABAP > Refresh or Move Database Instance

    We will not discuss all the screens of the import workflow in detail and focus on a few

    important ones. On most of the other screens, you can just use the defaults, or the requested

    information should be self-explanatory (profile directory, passwords, software location, etc.).

    On one screen, SWPM will ask for the SAP kernel archives, even though the application

    server is already installed – so make sure that the archives are available for the import phase.

    On the Parameter Settings screen, we choose the parameter mode Custom. On the following

    set of screens, we confirm the location of the profile directory, enter a master password, and

    the password for the System Administration user.

    On the copy method screen, we choose the default selection of Standard System Copy /

    Migration (Load-Based).

    On the Database for SAP System screen, we provide the host and instance number of the

    target database system.

    Caution: at this moment, the application server profile and hdbuserstore content still point to

    the source database system. Please make sure that you enter the data for the target

    environment, otherwise the subsequent R3load import would reload the data into the existing

    source database, essentially performing a system refresh operation.

    # cd /sapexport/import # /sapexport/swpm/sapinst SUPPORT_DECLUSTERING=false HDB_IMPORT_WITH_SDI=true

  • 49

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 22 SWPM import - Database for SAP System

    On the next screen, we provide the password of the SYSTEM user of the SystemDB of the

    target database.

    On the Software Package Browser screen, we select the directory with our downloaded SAP

    kernel archives.

    On the Media Browser screen, we enter our dump directory as the migration export location.

  • 50

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Figure 23 SWPM – Migration Export Location

    On the SAP HANA Multitenant Database Containers screen, we confirm that our target

    tenant H02 is listed and then continue through the Database Schema for the DBACOCKPIT

    and SAPABAP1 schema screens.

    On the Secure Storage for Database Connection screen, we continue with the default

    selection of hdbuserstore.

    We continue through the SAP HANA Import Parameters and Declustering / Depooling

    Options screens and perform the check on the SAP System Report Execution Result Check

    screen. The check issues a warning that HDB_TABLE_CLASSIFICATION.TXT for systems

    based on SAP kernel 7.4* is missing. As our S/4HANA system is based on SAP kernel 7.5,

    we select the Continue flag and proceed with the Next button.

    On the SAP HANA Table Placement Parameters screen, we follow the instructions under

    Additional Information and the referenced SAP Note 1900822 and provide the correct

    parameter file for our system.

    On the SAP System Database Import / General load parameters screen, we adjust the

    Maximum Number of Parallel Jobs parameter to 32 to reflect the size of our application

    server partition.

  • 51

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    We then use the defaults on the Migration Monitor Controller and Actions Before SAP

    System Start screens and enter the DDIC user password on the SAP System DDIC Users

    screen.

    On the Configuration of SAP liveCache with SAP HANA screen, we de-select the Install SAP

    liveCache for SAP System option and then step through the Cleanup of Operating System

    Users screen.

    After a final verification on the Parameter Summary screen, we start the SWPM import

    process with the Next button. The process performs a number of preparation steps and

    eventually will start the migration monitor, where we can watch the progress of the R3load

    import jobs.

    Figure 24 SWPM import – Migration Monitor

    Once all import jobs are processed, the workflow will continue with several post-load

    activities.

    You may see some warning dialogs about "Not all objects are successfully processed" or

    “One or more delivery units could not be activated”. These can be safely ignored as

    documented in the Combined Migration Guide.

    After the SWPM import workflow completes, we check the status of the SAP HANA System

    Migration Tool (which in most cases should be finished by now) and then continue with the

    post-migration steps documented in part I.

    If you followed the instructions above and executed SWPM import on an existing application

    server, you can skip the step of switching the application server to the target database since

  • 52

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    this was done by SWPM already. However, if you use multiple application servers with a

    local hdbuserstore, you have to update the database connection on each of them.

    Caution: please make sure that all application servers of a 3-tier landscape connect to the

    new database server before opening them up for the end users again. We recommend to either

    shutdown the source HANA system or change its IP address to prevent a scenario where

    some of the application servers might still connect to the source HANA system.

    Summary

    We now have three choices for performing a big-endian to little-endian migration:

    1. SAP HANA Migration Tool Start with this tool if your downtime requirement fits into the data rates that can be

    achieved with this tool. The current estimate is about 1TB per day (the total size for

    all HANA tables as reported by "select sum(table_size) from m_tables ").

    You need to plan for a number of test migrations as the effective data rate depends on

    a number of conditions and 1TB per day might not be achievable in every customer

    environment. Please pay special attention to the “Which parameters influence the

    runtime of the migration?” and “How should the process of optimization be

    implemented?” sections in the Migration FAQ, which explain the available tuning

    parameters that can influence the runtime of a migration. The optimum settings are

    system specific and test migrations are required to determine a set of parameters that

    will allow for a migration within the allotted time window.

    2. SWPM/R3load Migration For systems where the size of the ABAP schema in the HANA 1.0 source system is

    very large, using the SAP HANA Migration Tool might exceed the available downtime

    window. If the HANA 1.0 system contains only an SAP ABAP schema and matches

    the other restrictions documented in

    SAP note 1718576 - Migration from SAP HANA to another database system, an

    SWPM/R3load heterogeneous system copy provides the fastest available migration

    option.

    3. Combined Migration Method This method can be used as a fallback when either option above won't work. The start

    of the various required steps needs to be managed carefully. As part of the process,

    the SAP HANA Migration Tool performs the complete catalog migration and

    afterwards all ABAP schema tables contain primary keys already. This might affect

    the SWPM/R3load import performance. The effective data rate achievable with this

    method will be somewhere between the SAP HANA Migration Tool and a

    SWPM/R3load migration.

    Customer experiences have shown that due to individual circumstances, unknown problems

    may be discovered in the tooling or the involved HANA components. As it could take a while

    until a new problem is fixed and delivered with the next HANA revision, the number one

    advise for any big endian to little endian migration project is to start testing as early as

    possible.

    https://launchpad.support.sap.com/#/notes/1718576

  • 53

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Appendix

    Run Export/ Import unattended

    It is possible to start SWPM export/import in unattended mode in case it should be executed

    for optimization purposes in several cycles with identical parameters. See also

    https://launchpad.support.sap.com/#/notes/2230669

    Save the parameter file inifile.params for re-use to a location outside the sapinst execution

    directory:

    cp inifile.params //inifile.export

    Grep the product-id from the sapinst_dev.log log file after the first (manual) execution:

    Then clear the sapinst execution directory, and restart sapinst in unattendent mode:

    //sapinst \ SAPINST_INPUT_PARAMETERS_URL=//inifile.export \ SAPINST_EXECUTE_PRODUCT_ID=NW_Export:NW750.HDB.CP \ SAPINST_SKIP_DIALOGS=true \ SUPPORT_DECLUSTERING=false

    References

    SAP Notes

    2537080

    Migrate SAP HANA 1.0 on IBM Power Systems Big-Endian to SAP HANA 2.0 on IBM

    Power Systems Little-Endian

    2554012

    FAQ: SAP HANA Big Endian to Little Endian Migration for IBM Power

    2802500

    Combined SWPM and HANA Migration Tool Database Migration

    2784715

    SWPM: Using R3load-based migration for SAP System on HANA when tables contain

    more than 2 billion rows

    2779173

    R3load based System Copy from SAP HANA to SAP HANA - Table Splitting

    1738258

    System Copy for Systems Based on SAP NetWeaver - Using Software Provisioning

    Manager 1.0

    grep product-id sapinst_dev.log Running with control file control.xml version=999 changelist=192802 product-id=NW_Export:NW750.HDB.CP

    https://launchpad.support.sap.com/#/notes/2230669https://launchpad.support.sap.com/#/notes/2537080https://launchpad.support.sap.com/#/notes/2537080https://launchpad.support.sap.com/#/notes/2554012https://launchpad.support.sap.com/#/notes/2802500https://launchpad.support.sap.com/#/notes/2779173https://launchpad.support.sap.com/#/notes/1738258https://launchpad.support.sap.com/#/notes/1738258

  • 54

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    2154997

    Migration of hdbuserstore entries to ABAP SSFS

    2023587

    Maintaining "hdbuserstore" using "setProperty" for SAP Host Agent

    SAP Documentation

    https://help.sap.com/viewer/swpm10guides

    https://support.sap.com/en/tools/software-logistics-tools.html

    https://launchpad.support.sap.com/#/notes/2154997https://launchpad.support.sap.com/#/notes/2023587https://help.sap.com/viewer/swpm10guideshttps://support.sap.com/en/tools/software-logistics-tools.html

  • 55

    IBM SAP International Competence Center © Copyright IBM Corporation, 2019

    Copyrights and Trademarks © Copyright 2018 IBM Corporation. All Rights Reserved. IBM Corporation Systems and Technology Group Route 100 Somers, NY 10589 Neither this documentation nor any part of it may be copied or reproduced in any form or by any means or translated into another language, without the prior consent of the IBM Corporation. IBM makes no warranties or representations with respect to the co