Lost In Replication? Or, How to Replicate Data to Your App in the Cloud
By Martina Galabova, Valeri Sedevchev, Petra Lazarova and Daniel Vladinov
So now what?
Easy-peasy: The solution is to replicate the necessary backend data to your productive SAP HANA instance on SAP HANA Cloud Platform and use the data in your application.
As you may have already guessed, in this blog you will learn how to get the data you need, when you need it, and put it where you need it! Or, in simple words (for developers only 🙂 ): how to replicate your data from an on-premise system to your productive SAP HANA instance on the cloud via SLT (i.e. SAP Landscape Transformation Server).
What you have:
- On-premise ERP system that holds your data – let’s call it Source;
- Productive SAP HANA instance – let’s call it Target system, available in your SAP HANA Cloud Platform account;
- SAP HANA Cloud Platform SDK: it brings the needed DB tunnel tool;
- SLT system installed as on-premise to replicate the data from Source to Target system via the DB tunnel;
- SAP HANA Studio to configure and manage the Target schema, users, roles and privileges.
What you want:
- SAP HANA XS application that consumes and processes the backend ERP data
- Near real-time data availability
What to do:
- Set the Users.
- Configure the Replication.
- Go and Replicate.
- Enjoy! 🙂
You need to have:
- An ERP installed with latest version of DMIS add-on version 2011_1_* with all related SAP Notes applied.
- An SLT server installed with latest version of DMIS add-on version 2011_1_* with all related SAP Notes applied and a SAP HANA secondary database library installed. Latest information can be found in the SAP LT Replication Server blog.
NOTE: You can see the version of the client via the cockpit -> Database Schemas.
- An account on SAP HANA Cloud Platform
- A productive SAP HANA instance on the SAP HANA Cloud Platform
- Downloaded and installed the SAP HANA Studio Developer Edition in accordance with the SAP HANA Studio Installation Guide
- Downloaded the latest version of SAP HANA Cloud Platform SDK (Java Web), in accordance with the Installing the SDK page, both on your local and your SLT machine. (You will need Java version 1.6 or higher previously installed.)
I. Set the Users
Desired Result: Getting a replication user with all required permissions that you will need for the actual replication.
The whole procedure with setting up the users requires three types of users:
- Your SCN user that you need to open the DB connectivity tunnel ( for example, p1234567)
- Once the tunnel is open, it returns an SAP HANA DB user that grants you access to the dedicated SAP HANA instance on SAP HANA Cloud Platform via your SAP HANA Studio (it has the same name as your SCN user; in our example, p1234567 )
- In the SAP HANA Studio, you create a third user (<DR_ADM_USER>) that you need for the replication configuration itself.
- Open a DB tunnel for secure connection from your local machine to SAP HANA Cloud Platform. To do this, use your SCN user and enter command neo open-db-tunnel. Then enter the required information, such as:
- Landscape host
- Your account
- Your landscape account User
- Target HANA database name – you will get this name once you order your productive HANA in your landscape.
neo open-db-tunnel -i <target_hanadb_name> -h hana.ondemand.com -a <my_account> -u <my_SCN_user>
For more information, see the Documentation. RESULT: The DB tunnel makes your productive HANA system locally accessible via the properties displayed in the console output: Host name (usually localhost), JDBC Url, Instance number, newly created database User, and Initial password for it.
- Open your SAP HANA Studio and add a new system, using the credentials provided by the tunnel. When prompted, change the initial password to a permanent one. Hint: this is the automatically created HANA database user with a name equal to your SCN user.
NOTE: Remember the specified permanent password – you’ll need it later to configure the Target credentials for replication.
- In the SAP HANA Studio, create a new user that will be used as SLT administrator. This automatically creates a new schema with the same name. Provide the name and initial password for it. In our example, we will use the name <DR_ADM_USER>. Note that the initial password will be changed in just a moment (step 5 below)!
- Configure the following settings for <DR_ADM_USER> :
- In the Granted Roles tab, add HCP_SYSTEM role.
- In the Object privilege tab, add REPOSITORY_REST SQL object with EXECUTE privilege.
- If SYS_REPL schema already exists, the EXECUTE, SELECT, INSERT, UPDATE and DELETE privileges should be grantable to others. SYS_REPL is a system schema used by SLT to store replication configuration data. Skip this step if SYS_REPL schema is not present!
- Save the <DR_ADM_USER> user settings.
- In the SAP HANA Studio, right-click on your system (from tab Systems), and select the “Add Additional User…” option to log on with the <DR_ADM_USER>. SAP HANA Studio will prompt you in a pop-up window to change the initial password.
The second entry will appear in the Systems tab so that you can log off from the p1234567 login session.
II. Configure the Replication
Desired Result: Establishing a secure connection from your SLT to the dedicated SAP HANA on SAP HANA Cloud Platform, and to configure the replication, so that everything is set and ready to go.
You need to open a DB tunnel from your SLT system to the dedicated SAP HANA instance on SAP HANA Cloud Platform. (Create replication configuration to establish the connection between your on-premise ERP system to your dedicated HANA instance on the platform.) To establish a secure connection from your SLT system to your dedicated SAP HANA instance, you have to open a DB tunnel from your on-premise SLT machine.
- Log in to your SLT machine.
- Download and install the latest version of SAP HANA Cloud Platform SDK (Java Web) in accordance with page Installing the SDK.
- Open a DB tunnel with your SCN user to your target schema. The tunnel allows SQL statements only for the owner of that schema to pass through it. To keep the tunnel permanently alive, you should add the additional parameter –timeout 0
neo open-db-tunnel -h hana.ondemand.com -a <my_account> -u <my_SCN_user>-i <target_hanadb_name> –timeout 0
For more information, see the Documentation.
- Create Replication Configuration
NOTE: This document applies to SP05 of DMIS add-on. In previous versions, all the data is populated on one screen.
- Log in to your SLT system and open transaction LTR.
- In the opened browser window, log on and open the New Configuration wizard.
- Enter replication name. The wizard will create a new schema in the Target HANA box in your SAP HANA Cloud Platform account with that name that holds your replication data.
- Choose Next.
- Specify Source System: Choose your RFC destination connecting to the Source (ERP) system.
NOTE: By default, only one replication is allowed per source system. If you want to create multiple replications (that is, replication to multiple SAP HANA systems) from your source system, select the “Allow multiple usage” checkbox.
- Specify Target System: In the System Data form, enter the following:
- Choose Next.
- Continue the configuration as described in the Documentation.
III. Go and Replicate
Desired Result: Laying back and enjoying the seamless and safe replication process, and enjoying your app anytime and from anywhere.
- Open your SAP HANA Studio and switch to the Modeler Perspective.
- Open Quick Launch with your <DR_ADM_USER> user.
Your system and username are listed there. You can switch the system by choosing the Select System… button.
- Open the Data Provisioning… editor from the Data pane in the bottom-middle part of the screen.
- Wait for your system tables (DD0xx) to be replicated. You can press the refresh button to see the latest status of the replication tables. The tables will go through few different actions and statuses. When they reach status “In Process” with action “Replicate” – which is an indication they are already (and will stay) replicated – you are ready to proceed with the replication of the tables needed for your cloud application.
- Choose the Replicate button and select the tables you want to replicate. For more details you can check this HANA Academy video.
- Enjoy! 🙂
So What Did You Just Do?
You can now quickly and easily replicate your on-premise data in SAP HANA Cloud Platform, where you can develop apps using this data.
Basically, you have conquered your own small data cloud in the big SAP HANA Cloud Platform family! 🙂