SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Use Smart Data Access to Virtualise Data from the Cloud to an On-Premise Database

Create an SDA connection between SAP HANA Cloud, SAP HANA database and SAP HANA on-premise.

Overview

🎓 beginner 10 min. SAP HANA CloudBeginnerSAP HANA CloudSAP HANA DatabaseSAP HANA

You will learn

  • โœ”How to create a remote source to an SAP HANA Cloud, SAP HANA database instance in your SAP HANA on-premise system using Smart Data Access
  • โœ”How to then virtualise data from SAP HANA Cloud to an SAP HANA on-premise database
Created by August 15, 2021
Contributors

Prerequisites

Prerequisites

  • A running SAP HANA Cloud, SAP HANA database instance with a table that contains data.
  • An SAP HANA on-premise database running on SAP HANA platform edition SPS04 or higher. Alternatively, you can download and install the latest SAP HANA express edition either as binary in Linux or a Docker image.
  • An instance of the SAP HANA Database Explorer or SAP HANA Studio connected to the SAP HANA on-premise database.

Steps

Intro

Smart Data Access (SDA) can be used to virtualise data from a source SAP HANA Cloud, SAP HANA database to an SAP HANA on-premise target database. Since this HANA-to-HANA federation does not require additional deployment of the Data Provisioning Agent, unlike SDI, SDA is the preferred and simplest way in this direction to virtualise data. SDI may also be used for this direction and offers more advanced replication capabilities. You will learn how to use SDI in the next tutorial of this group.

Infographic SDA
Infographic SDA

For simplicity, we will focus on the preferred and simpler option in this article, using SDA.

In this article, you will learn step by step how to create an SDA connection between SAP HANA Cloud, SAP HANA database and SAP HANA on-premise. This includes creating a remote source to an SAP HANA Cloud, SAP HANA database instance in your SAP HANA on-premise system to then virtualise data from SAP HANA Cloud in an SAP HANA on-premise database.


Step 1 Preparations
โ€”

  1. Start the SAP HANA platform or express edition on-premise or on cloud hypervisor.

  2. Login to the tenant database of the on-premise system using the SAP HANA Database Explorer or SAP HANA Studio for the local instance.

  3. To create a remote source to SAP HANA Cloud, you need to retrieve some information from the SAP HANA Cloud instance. Both can be found in the SAP HANA Cloud Central:

    • The exact name of your SAP HANA Cloud, SAP HANA database instance
    • The Endpoint of your SAP HANA Cloud, SAP HANA database instance

    HCC SQL Endpoint
    HCC SQL Endpoint

  4. Copy the name of the instance and the endpoint and paste it to a text editor.

  5. Next, you need to get a certificate string for SAP HANA Cloud, SAP HANA database. In your command line (iTerm or Terminalon iOS, or Command Prompt on WIN) enter this command to download the pem file:

    Shell/Bash

curl -O https://cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem

Code

After the file has been downloaded, use a text editor which can read a `pem` file, such as Notepad or Apple Text Editor, to access the certificate string.




### Create a PSE and a certificate


1.	Create a certificate store, also called PSE (personal security environment). You can read more about [PSE and how to import certificates for SSL connections here](https://help.sap.com/viewer/f9c5015e72e04fffa14d7d4f7267d897/LATEST/en-US/86e96624e9a74e77994f7544db51061c.html).

    ```SQL
CREATE PSE [certificate store name]
  1. Create a certificate for SAP HANA Cloud, SAP HANA database and name it, for example ‘HC’. Paste the certificate string you copied here (already included in this case).

    SQL

– create certificate CREATE CERTIFICATE FROM ‘—–BEGIN CERTIFICATE—–MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQkCAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=—–END CERTIFICATE—–’ COMMENT ‘HC’;

Code

> **Why the comment ยดHCยด?**
>
> In the next step, we will need to obtain the ID of this certificate to add it to our PSE. Using a comment when creating this certificate will make it easier for us to find it and get its ID.




### Add the certificate to the PSE


1.	Get the certificate ID of this certificate by running this SQL statement:

    ```SQL
SELECT CERTIFICATE_ID FROM CERTIFICATES WHERE COMMENT = 'HC';
  1. Add this certificate to the certificate store by inserting the certificate ID into the SQL statement:

    SQL

ALTER PSE SSL ADD CERTIFICATE <certificate_id>;

Code

3.	Now set the PSE purpose as remote source. This way, all remote sources you create will use the certificates stored in the PSE. Please note, that only one PSE can be set as remote source purpose.

    ```SQL
SET PSE SSL PURPOSE REMOTE SOURCE;
Step 2 Create the remote source
+
Step 3 Create a virtual table in your on-premise database
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. Preparations 2. Create the remote source 3. Create a virtual table in your on-premise database

Learn more →