Skip to Content
Product Information
Author's profile photo Tae Suk Son

Replication of calculation views from on-premise HANA Platform to HANA Cloud

This blog explains replication from SAP HANA Platform on-premises to SAP HANA Cloud only. If your interest is more about general replication with various SAP solutions and external data, please check out the Data Intelligence Cloud as part of our Data Manatement Portfolio

In my previous blog Replication Service to easily setup replication from SAP HANA on-premise to SAP HANA Cloud, I’ve shown how tables can be easily replicated from an SAP HANA Platform on-premises to SAP HANA Cloud using Replication Service.

Since then we now support

  • HANA native replication using remote table replication.
    If the source SAP HANA Platform is 2.0 SPS05 or higher, native RTR is used for replicating data. The details of remote table replication is described in A new approach for replicating tables across different SAP HANA systems by my colleague Lee, Seungjoon and a step by step tutorial.
  • Replicate calculation views with a few simple clicks.
    When a calculation view is selected for replication, the runtime metadata is extracted from the source system and parsed to get the definition of the calculation view and retrives all dependent objects. This can be other nested calculation views, hierarchy information and tables. For nested calculation views, the metadata is again extracted and parsed until all dependent objects have been identified as tables. The tables will be replicated in real-time or loaded once based on the schedule settings. The calculation view runtime objects will be built from bottom up until the final selected calculation view is built on the target side.

One point that needs to be emphasized is that only the runtime objects of the calculation view are being replicated and not the design time. The runtime is the column view that are accesible using SQL while design time is the artifact stored in the repository (XSC) or github (XSA). So, any design changes that is needed for the calculation view needs to be done at the source side which is on-premises and replicated again after the changes. For details of how to update an existing calculation view please check out the details in SAP Note 3133975.

If the replicated calculation view needs to be extended to create another calculation view in SAP HANA Cloud, the replicated calculation view can be referenced as column view consumed as a synonym inside a HDI container.

The benefits of replicating a calculation view runtime is

  • Easy to extend an existing analytical workload running on-premises to the cloud with a few simple clicks
  • Offload workload dynamically to any region running SAP HANA Cloud on demand
  • Replicate to multiple regions extending global reach
  • Expand existing workloads with latest features available with every SAP HANA Cloud enhancement releases

Replication

Replication Service

 

Now lets go over the steps on how we can replicate a calculation view.

 

Pre-requisites for technical user for source system

  • A technical user for running replication setup. This user should not be the owner of the schema being replicated but a technical user without being an owner.
  • For replicating calculation views, runtime metadata is extracted from the source system.
    •  SYSTEM user is mandatory for SAP HANA 2.0 SPS05 Rev59 or lower
    • Apply the workaround mentioned in SAP Note 3133975. to use a technical user other than SYSTEM for higher than SAP HANA 2.0 SPS05 Rev59
  • CATALOG READ
  • SELECT privilge
    • SCHEMA (XSC based tables and calculation views)
    • HDI Container Schema (XSA based tables and calculation views)
    • Objects to be replicated

Steps to replicate a calculation view

    1. Logon to SAP HANA Cockpit and goto Replication Service card found under Monitoring and select Create Replication
      Replication%20Service%20Card
    2. For creating a New Connection, there are 2 options to select from SAP HANA 2.0 SPS05 or SPS04 or lower. The difference between the 2 is SPS05 or higher uses the native data replication called remote table replication while earlier version requires SDI to be used. I will use the SPS05 or higher
    3. Create a remote source using SAP with Cloud Connector selected. The Location ID is optional based on the cloud connector. This is normally set when multiple cloud connector is used and each defined with a different location id. Using the cloud connector allows SAP HANA Cloud connect to the SAP HANA Platform on-premises using SDA connection which is mandatory for remote table replication.
    4. Once the remote source is created, SAP HANA Cloud connects to the HANA on-premises through the cloud connector and gets the list of schemas or HDI containers that the technical user have been granted in the pre-requisites. I have created SLPADM for schema based calculation views and SALES for HDI based.
    5. First, lets step through how a schema (XSC) based calculation view can be replicated by selecting SLPADM. As the password is secured for SLPADM user and cannot be extracted, we need to initialize the password to be used in SAP HANA Cloud.
    6. Once the target schema is created in SAP HANA Cloud, it will retrieve all the objects of the selected schema. The following is a list of calculation views that can be replicated and will select the top most calculation view Sales/CALCVIEW_SALESORDERS as others are nested CVs which gets automatically replicated as it is a dependent object of the selected CV.
    7. It will now connect to SAP HANA Platform on-premises and retrieve the metadata of the calculation view by importing the BIMC data
    8. Then retrieves metadata of all dependent objects
    9. After the initial replication is done, the hierarchy of the dependent objects can be checked with the hierarchy icon
    10. The dependency objects are all listed which includes tables, hierarchy and other nested calculation views.
    11. Once the replication is running the status can be check from the main service card grouped for each remote source

We will now try to add a new calculation view replication based on HDI container schema by on selecting SALES in step 4 above.

  1. The selected HDI container schema SALES will be created as a normal schema in SAP HANA Cloud and not a HDI container. So, the password needs to be initialized as well.
  2. Once the target schema is created, the list of objects in the HDI container is extracted. The object name is prefixed “Sales::” whereas it was “Sales/” for normal schema based calculation views
  3. The calculation view dependent objects in HDI container is replicated. (Currently, we have found an issue when the dependent object is a synonym which will be resolved soon)

 

We have gone through how we can replicate a calculation view from SAP HANA Platform on-premises to SAP HANA Cloud with just a few simple clicks. The calculation view replication works for both XSC and HDI based without any migration efforts. For 2022, we are planning to close the gaps by supporting replication of Analytic Privilege and how to support calculation views referencing table functions.

We will also publish a detailed easy to follow step by step tutorial extending the existing table replication tutorial.

The official documentation for Replication Service can be found here.

There are some limitations which we currently have as mentioned in SAP Note 3133975 . We will update this SAP Note as we resolve the limitations.

Assigned Tags

      14 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Michael Cocquerel
      Michael Cocquerel

      Tae Suk Son

      I understand that there is a prerequisite that is not explicitly mentioned to create SLPADM and SALES users on HANA Cloud side. Is it correct ? What privileged do they require ? Why only those 2 users are appearing in step iv ?
      Regards,

      Michael

      Author's profile photo Tae Suk Son
      Tae Suk Son
      Blog Post Author

      Hi Michael Cocquerel,

      Correct, the user is selected during the replication process and not pre-created. The users are meant to be schemas and not general users which may require roles and privilege to be copied as well. The general users are in our roadmap.

      I've used our DEV landscape and given SELECT grant on SLPADM schema and SALE HDI container to the technical user and is why those are shown only.

      Best regards,

      Tae-Suk

      Author's profile photo Michael Cocquerel
      Michael Cocquerel

      Hi Tae Suk Son ,
      Thanks, it clarifies.
      One additional question, in step vi , how the wizard know it has to show those _SYS_BIC views ? Is it automatically determined based on SLPADM user authorizations ?
      Regards,
      Michael

      Author's profile photo Tae Suk Son
      Tae Suk Son
      Blog Post Author

      Hi Michael Cocquerel

      Yes, the initial list of calc views will be based on _SYS_BIC but may not be replicated correctly if the any of the dependent object is not authorized or doesn't have privileges for access.

      Best Regards,

      Tae-Suk

      Author's profile photo Anish Gupta
      Anish Gupta

      Hello Tae Suk,

      Many thanks for this wonderful blog. I would have one question on the following statement of yours:-

      You mentioned about the following

      "Once the remote source is created, SAP HANA Cloud connects to the HANA on-premises through the cloud connector and gets the list of schemas or HDI containers that the technical user have been granted in the pre-requisites."

      If I understand it correctly when you refer to HDI containers  in the above statement you mean the runtime for the HDI container which are their schemas right?

      Regards,

      Anish

      Author's profile photo Tae Suk Son
      Tae Suk Son
      Blog Post Author

      Hi Anish Gupta,

      Yes, you are correct. The HDI Container runtime is a secured schema. You would need to give privileges to a DB User to get access to the schema within the HDI container.

       

      Let me modify the blog to be more explicit. Thank you for your comments.

       

      Best Regards,

      Tae-Suk.

      Author's profile photo Douglas Hoover
      Douglas Hoover

      When you said : First, lets step through how a schema (XSC) based calculation view can be replicated by selecting SLPADM.   Are you really replicating old SYS_REPO based CVs (created in Studio or WorkBench)?

      Author's profile photo Tae Suk Son
      Tae Suk Son
      Blog Post Author

      Hi Douglas,

      Sorry for the belated reply. Yes, the source can be both the SYS_REPO based CVs (created in Studio or Workbench) and HDI Container based CVs (created in Web IDE).

      Author's profile photo Michael Cocquerel
      Michael Cocquerel

      I have launched the replication of one single view. It is in status loading since more than one hour. How to check the progress and that there is no issue ?

      Author's profile photo Tae Suk Son
      Tae Suk Son
      Blog Post Author

      Hi Michael,

       

      As it would be a bit difficult to help using just a screenshot. Do you mind opening a incident for this so that we can support you.

      Author's profile photo Michael Cocquerel
      Michael Cocquerel

      Hello, here is the incident number 290326 / 2022

      Author's profile photo Michael Cocquerel
      Michael Cocquerel

      The status was still "loading" after several days.

      I have tried to delete and recreate everything from scratch but, at the step to select the objects to be replicated, I do not see anymore views from _SYS_BIC schema.

      I have check the privilege of my replication user and it has SELECT privilege on _SYS_BIC.
      So, I don't understand what's wrong.
      I have notice there is a schema SYS_BIC on HANA Cloud that owner is DBAMIN. I have suppose it was created during my first replication attempt.
      Also, I have tried to drop  it with user DBAMIN but it says "insuffisant privilege". That's a bit strange as it is the owner of the schema.

      Author's profile photo Michael Cocquerel
      Michael Cocquerel

      The note 3133975 is in status "being updated" since more than one year. Is there a workaround to avoid using SYSTEM user ?

      Author's profile photo Al Berkey
      Al Berkey

      It is my understanding from this that the result of the replication from HANA calculation view is a column view on HANA Cloud. Is there a way to replicate HANA calulation views or the resultant column view to a CDS view?