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

Access Remote Sources with SAP HANA Cloud Central

Use SAP HANA federation capabilities to query data from other SAP HANA and SAP HANA Cloud, data lake Relational Engine databases using SAP HANA smart data access (SDA).

Overview

🎓 beginner 10 min. SAP HANA CloudBeginnerSAP HANA Cloud SAP HANA DatabaseSAP HANASAP HANA Cloud Data Lake

You will learn

  • How to use SAP HANA smart data access (SDA) to create connections (remote sources) to other databases
  • How to create virtual tables from a remote source
MICHELLE WANG M MICHELLE WANG August 13, 2026
Created by August 12, 2026
Contributors

Prerequisites

Prerequisites

  • You have completed the first 3 tutorials in this group
  • An SAP HANA database, an SAP HANA Cloud data lake instance, and an additional SAP HANA database to connect to

Steps

Intro

Remote sources enable connections to other databases. Virtual tables use a remote source to create a local table that points to data stored in another database. Federated queries make use of virtual and non virtual tables.

To illustrate these concepts, a table will be created in the remote database that contains fictitious review data from some of the top tourist sites near a given hotel. There is likely a correlation between hotel stays and the desire for customers to visit nearby tourist attractions or restaurants.

For additional details on SAP HANA smart data access (SDA) and SAP HANA Smart Data Integration (SDI), consult Connecting SAP HANA Cloud to Remote Data Sources and Data Access with SAP HANA Cloud.

This tutorial requires more than one database to complete. It is not necessary to complete this tutorial to continue to the next tutorial in this group.

The SAP HANA Cloud free tier is limited to creating one SAP HANA database and one data lake instance.

The example in step 1 demonstrates a connection from one SAP HANA Cloud, SAP HANA database to another. The example in step 2 demonstrates a connection from an SAP HANA Cloud, SAP HANA database to an SAP HANA Cloud, data lake Relational Engine. The example in step 3 demonstrates connecting from SAP HANA Cloud, data lake Relational Engine to an SAP HANA Cloud, SAP HANA database. The example in step 4 demonstrates connecting from one SAP HANA Cloud, data lake Relational Engine to another.


Step 1 Connect from one SAP HANA Cloud, SAP HANA database to another

Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can query data from the other in real time using virtual tables, without copying or moving data.

Virtual Table Diagram
Virtual Table Diagram

  1. In SAP HANA Cloud Central, select an SAP HANA database (HDB) instance (the one you want to connect to), and execute the following SQL statements to create the tourist_reviews table.

    If needed, first create a schema and user.

    SQL
    CREATE SCHEMA HOTELS;
    CREATE USER USER1 PASSWORD Password1 no force_first_password_change;
    GRANT ALL PRIVILEGES ON SCHEMA HOTELS TO USER1;
    SQL
    SET SCHEMA HOTELS;
    CREATE COLUMN TABLE TOURIST_REVIEWS(
        review_id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
        review_date DATE NOT NULL,
        destination_id INTEGER,
        destination_rating INTEGER,
        review VARCHAR(500) NOT NULL
    );
    
    INSERT INTO TOURIST_REVIEWS(review_date, destination_id, destination_rating, review) VALUES('2019-03-14', 1, 5, 'We had a great day swimming at the beach and exploring the beach front shops.  We will for sure be back next summer.');
    INSERT INTO TOURIST_REVIEWS(review_date, destination_id, destination_rating, review) VALUES('2019-02-01', 1, 4, 'We had an enjoyable meal.  The service and food was outstanding.  Would have liked to have slightly larger portions');
  2. The result can be seen below.

    SQL
    SELECT * FROM TOURIST_REVIEWS

    Select All
    Select All

  3. To create a remote source to SAP HANA Cloud, open another SAP HANA database.

    In the SQL console, enter the SQL statement below. Replace <Target HDB Host> with the host copied from the SQL endpoint.

    SQL
    CREATE REMOTE SOURCE REMOTE_HC ADAPTER "hanaodbc" CONFIGURATION 'ServerNode=<Target HDB Host>:443;driver=libodbcHDB.so;dml_mode=readwrite;sslTrustStore="-----BEGIN CERTIFICATE-----MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMT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ASSWORD' USING 'user=USER1;password=Password1';
    CALL PUBLIC.CHECK_REMOTE_SOURCE('REMOTE_HC');
  4. Alternatively, a remote source can be created using the UI in the Database Objects app.

    Create remote source using the UI
    Create remote source using the UI

    For the Database Source Type, select SAP HANA Cloud, SAP HANA Database.

    Add a source name and specify the server, port, and credentials (USER1, Password1). The Extra Adapter properties can be retreived by copying the sslTrustStore in the SQL query above.

    Creatomg a Remote Source Using the UI
    Creatomg a Remote Source Using the UI

    Additional details can be found at CREATE REMOTE SOURCE Statement

    If the above command fails, one reason might be that an allowlist has been set on the SAP HANA Cloud instance. This can be seen by choosing Actions > Manage Configuration > Connections.

    Allow All IP Addresses
    Allow All IP Addresses

    The public root certificate of the certificate authority (CA) that signed the SAP HANA Cloud instance’s server certificate is required in the sslTrustStore parameter. For more information, see Secure Communication Between SAP HANA Cloud and JDBC/ODBC Clients.

  5. A virtual table named vt_tourist_reviews will be created in the SAP HANA database you are connecting from. This will enable access to the tourist_reviews table that was created in SAP HANA Cloud. This can be visualized as follows:

    Open the SAP HANA database you wish to connect from.

    If needed, create the HOTELS schema and a user who can access the schema.

    SQL
    CREATE USER USER1 PASSWORD Password1 no force_first_password_change;
    CREATE SCHEMA HOTELS;
    GRANT ALL PRIVILEGES ON SCHEMA HOTELS TO USER1;
  6. Create a virtual table named VT_TOURIST_REVIEWS in the schema HOTELS that maps to the TOURIST_REVIEWS table on the original HDB.

    SQL
    CREATE VIRTUAL TABLE VT_TOURIST_REVIEWS AT "REMOTE_HC"."HC_HDB".HOTELS."TOURIST_REVIEWS";

    Additional details can be found at CREATE VIRTUAL TABLE STATEMENT

  7. Perform queries against the local tables, the remote table, and perform a federated query that contains both local and remote tables.

    SQL
    SELECT * FROM HOTELS.RESERVATION;
    SELECT * FROM HOTELS.CUSTOMER;
    SELECT * FROM HOTELS.VT_TOURIST_REVIEWS;
    SELECT C.NAME, TR.REVIEW, REVIEW_DATE
    FROM
        HOTELS.RESERVATION AS R JOIN
        HOTELS.VT_TOURIST_REVIEWS AS TR
        ON TR.REVIEW_DATE = R.ARRIVAL JOIN
        HOTELS.CUSTOMER AS C
    ON C.CNO = R.CNO;
  8. In the source HDB SQL console, query the virtual table to confirm data is returned from the target HDB.

    SQL
    SELECT * FROM VT_TOURIST_REVIEWS;

    Virtual Table
    Virtual Table

    Add a new review.

    SQL
    INSERT INTO HOTELS.VT_TOURIST_REVIEWS(review_id, review_date, destination_id, destination_rating, review) VALUES(3, '2020-08-21', 1, 5, 'The harbour cruise was fantastic.  It was great to see the city from a different viewpoint');
    SELECT * FROM HOTELS.VT_TOURIST_REVIEWS;

    Notice that the virtual table is editable.

    A benefit of a virtual table is that there is no data movement. There is only one location where the data is persisted.

Step 2 Connect from SAP HANA Cloud, SAP HANA database to a data lake Relational Engine
+
Step 3 Connect from a data lake Relational Engine to SAP HANA Cloud, SAP HANA database
+
Step 4 Connect from a data lake Relational Engine to another data lake Relational Engine
+
Step 5 Knowledge check
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Connect from one SAP HANA Cloud, SAP HANA database to another 2. Connect from SAP HANA Cloud, SAP HANA database to a data lake Relational Engine 3. Connect from a data lake Relational Engine to SAP HANA Cloud, SAP HANA database 4. Connect from a data lake Relational Engine to another data lake Relational Engine 5. Knowledge check

Learn more →