SAP HANA Cloud Guide
SAP HANA Cloud Guide
PUBLIC
Warning
This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product
documentation. The information included in custom documentation may not re ect the arrangement of topics in the SAP Help
Portal, and may be missing important aspects and/or correlations to other topics. For this reason, it is not for productive use.
This is custom documentation. For more information, please visit the SAP Help Portal 1
1/12/2024
This guide does not describe the SAP HANA features and capabilities available with the SAP HANA Cloud. For more information
about features and capabilities, see the Feature Scope Description SAP HANA Cloud.
You can nd all guides of the databases services available in SAP HANA Cloud on their respective product pages:
Related Information
Discovery Center Service Catalog
Overview
Storage Options
Overview
SAP HANA Cloud provides a single place to access, store, and process all enterprise data in real time. It is a cloud-native
platform that reduces the complexity of multi-cloud or hybrid system landscapes. SAP HANA Cloud provides all of the advanced
SAP HANA technologies for multi-model data processing in-memory or on disk. You can bene t from cloud qualities such as
automatic software updates, elasticity, and low total cost of ownership by using SAP HANA Cloud either as a stand-alone
solution or as an extension to your existing on-premise environment.
The SAP HANA Cloud allows you to consume the SAP HANA database from applications running on SAP Business Technology
Platform, as well as from applications running on-premise or other cloud services using the standard SAP HANA clients. The
SAP HANA Cloud provides simpli ed data access to connect all your information without the need to have all data loaded into a
single storage solution.
If you are familiar with multiple tenant databases in SAP HANA on-premise systems, note that every SAP HANA Cloud, SAP
HANA database instance is equivalent to a single tenant database. For multiple databases, create multiple SAP HANA database
This is custom documentation. For more information, please visit the SAP Help Portal 2
1/12/2024
instances. Using SAP HANA Cloud Central or the command-line interface, you can create and manage SAP HANA Cloud
instances in your subaccount.
Developers can bind their applications deployed in the same space to database instances. SAP Business Technology Platform
applications are bound to HDI containers; every application requires a dedicated HDI container. The SAP HANA Deployment
Infrastructure (HDI) provides a service that enables you to deploy database development artifacts to so-called containers. This
service includes a family of consistent design-time artifacts for all key SAP HANA database features, which describe the target
(run-time) state of SAP HANA database artifacts, for example: tables, views, or procedures. These artifacts are modeled,
staged (uploaded), built, and deployed into SAP HANA. Using HDI is not a strict requirement, schemas and database artifacts
can be created at run-time using SQL database de nition language in the SQL console. For more information, see the SAP
HANA Cloud Deployment Infrastructure Reference.
Data lake is an SAP HANA Cloud component composed of data lake Relational Engine – which provides high-performance
analysis for petabyte volumes of relational data – and data lake Files – which provides managed access to structured,
semistructured, and unstructured data stored as les in the data lake.
Data lake is available in different con gurations. You can integrate it into a SAP HANA Cloud, SAP HANA database instance, or
you can provision a standalone data lake instance with no SAP HANA database integration. You can also enable or disable the
data lake Relational Engine component when provisioning your data lake instance.
To create and manage SAP HANA Cloud instances, use SAP HANA Cloud Central or the command line interface.
To administer an SAP HANA database, use the SAP HANA cockpit, which provides a range of tools for administration and
monitoring. For more information, see SAP HANA Cockpit.
To query information about an SAP HANA database and view information about your database's catalog objects, use the SAP
HANA database explorer. For more information, see Getting Started With the SAP HANA Database Explorer.
All access to SAP HANA Cloud instances is via secure connections on SQL ports.
This is custom documentation. For more information, please visit the SAP Help Portal 3
1/12/2024
Storage Options
SAP HANA native storage extension is a general-purpose, built-in warm data store in SAP HANA that lets you manage less-
frequently accessed data without fully loading it into memory. It integrates disk-based database technology with the SAP HANA
in-memory database for an improved cost-to-performance ratio. For more information, see SAP HANA Native Storage
Extension.
Note
The SAP HANA Native Storage Extension (NSE) feature for warm data storage is enabled by default in SAP HANA Cloud.
Database developers may choose to assign speci c tables, columns, or partitions to use NSE. SAP HANA NSE uses a
dedicated in-memory buffer cache to load and unload pages of tables, table partitions or table columns. The initial buffer
cache size of an SAP HANA Cloud instance is 10% of the instance's memory size. You can change the initial buffer cache size
once the SAP HANA instance has been created. For more information, see SAP HANA NSE Buffer Cache.
Example
NSE Sizing Example
SAP HANA Memory NSE Buffer Cache SAP HANA in-memory NSE Data Volume Size Total SAP HANA
data (compressed) Database Data Size
60 GB 6 GB 30 GB - 6 GB (24 GB) 48 GB 72 GB
This is custom documentation. For more information, please visit the SAP Help Portal 4
1/12/2024
Data lake Files provides managed access to structured, semistructured, and unstructured data le storage.
Data lake Files uses the concept of multiple le containers. When you create a data lake instance, you get the (default) le
container, and, optionally, the diagnostics le container. The le container is managed by you. The diagnostics le container is
managed by SAP. The diagnostics le container only exists if you enable IQ analytics during data lake instance creation.
The data lake Relational Engine component provides high performance analysis for petabyte volumes of relational data.
Data lake Relational Engine stores structured data. If you need an unstructured data store, use Data Lake Files.
Data lake Relational Engine stores and analyzes large amounts of data. It leverages inexpensive storage options to lower costs,
while maintaining excellent performance and full SQL access to data. Data lake Relational Engine includes elastically scalable
compute to provide high-performance analysis on-demand and to provide cost control during periods of lower load.
Related Information
Open the SAP HANA Cockpit
Open the SAP HANA Database Explorer
SAP HANA Cloud, data lake
Creating and Managing SAP HANA Cloud Instances Using the CLI
Related Information
SAP HANA Cloud Administration Guide
You can create different types of tables in the SAP HANA database: local database tables and virtual tables. Local database
tables allow you to import and query data just as in many other databases. Virtual tables point to tables in remote sources. For
more information, see Managing Tables.
This is custom documentation. For more information, please visit the SAP Help Portal 5
1/12/2024
In SAP HANA, you use linked database or create virtual tables, which point to remote tables in different data sources, and then
write SQL queries in SAP HANA that use these virtual tables. The SAP HANA query processor optimizes these queries by
executing the relevant part of the query in the target database, returning the results of the query to SAP HANA, and then
completing the operation. Physical data movement is not supported by SAP HANA smart data access.
You can create tables in the SAP HANA Cloud, SAP HANA database and import data using the SQL console of the SAP HANA
database explorer.
You can create tables at design-time in SAP Business Application Studio and SAP Web IDE Full-Stack and deploy them through
the SAP HANA Deployment Infrastructure (HDI). For more information, see SAP HANA Cloud Deployment Infrastructure
Reference.
Related Information
Connecting SAP HANA Cloud, SAP HANA database to Remote Data Sources
Importing and Exporting Data
SAP Business Application Studio
SAP Web IDE
Create a Schema, Tables and Insert Data Using the SAP HANA
Database Explorer
Execute SQL statements to create schemas, tables, and load data by using the SQL console that is included with the SAP HANA
database explorer.
Prerequisites
You must have the required privileges in the SAP HANA database to execute your SQL statements.
Context
To get started with a basic set of demo data, see SAP HANA Cloud SQL Demo Data. To import data from a le stored in your
local le system, see Import Data Into a New or Existing Table.
This is custom documentation. For more information, please visit the SAP Help Portal 6
1/12/2024
Procedure
1. Open your SAP HANA database instance in SAP HANA database explorer. For more information, see Open the SAP
HANA Database Explorer.
2. Open an SQL console from the database explorer by right-clicking your database and clicking Open SQL Console.
Sample Code
CREATE SCHEMA hotel;
Sample Code
CREATE COLUMN TABLE hotel.city (zip CHAR(5) PRIMARY KEY, name CHAR (30) NOT NULL, state CHA
Sample Code
INSERT INTO hotel.city VALUES ('12203','Albany','NY');
INSERT INTO hotel.city VALUES ('60601','Chicago','IL');
INSERT INTO hotel.city VALUES ('60615','Chicago','IL');
Results
You have successfully created a schema and tables, and imported data into your SAP HANA database. You can now query and
manipulate the data in the SAP HANA database.
Related Information
Execute SQL Statements
SAP HANA Cloud, SAP HANA Database SQL Reference
Data Manipulation Statements
Sample Code
CREATE SCHEMA hotel;
This is custom documentation. For more information, please visit the SAP Help Portal 7
1/12/2024
address CHAR(40) NOT NULL
);
CREATE COLUMN TABLE hotel.hotel(
hno NUMERIC(4) PRIMARY KEY,
name CHAR(50) NOT NULL,
zip CHAR(5),
address CHAR(40) NOT NULL
);
CREATE COLUMN TABLE hotel.room(
hno NUMERIC(4),
type CHAR(6),
free NUMERIC(3),
price NUMERIC(6, 2),
PRIMARY KEY (hno, type)
);
CREATE COLUMN TABLE hotel.reservation(
rno NUMERIC(4) PRIMARY KEY,
cno NUMERIC(4),
hno NUMERIC(4),
type CHAR(6),
arrival DATE NOT NULL,
departure DATE NOT NULL
);
INSERT INTO hotel.customer VALUES(3000, 'Mrs', 'Jenny', 'Porter', '10580', '1340 N. Ash Street, #
INSERT INTO hotel.customer VALUES(3100, 'Mr', 'Peter', 'Brown', '48226', '1001 34th St., APT.3')
INSERT INTO hotel.customer VALUES(3200, 'Company', NULL, 'Datasoft', '90018', '486 Maple St.');
INSERT INTO hotel.customer VALUES(3300, 'Mrs', 'Rose', 'Brian', '75243', '500 Yellowstone Drive,
INSERT INTO hotel.customer VALUES(3400, 'Mrs', 'Mary', 'Griffith', '20005', '3401 Elder Lane');
INSERT INTO hotel.customer VALUES(3500, 'Mr', 'Martin', 'Randolph', '60615', '340 MAIN STREET, #7
INSERT INTO hotel.customer VALUES(3600, 'Mrs', 'Sally', 'Smith', '75243', '250 Curtis Street');
INSERT INTO hotel.customer VALUES(3700, 'Mr', 'Mike', 'Jackson', '45211', '133 BROADWAY APT. 1')
INSERT INTO hotel.customer VALUES(3800, 'Mrs', 'Rita', 'Doe', '97213', '2000 Humboldt St., #6');
INSERT INTO hotel.customer VALUES(3900, 'Mr', 'George', 'Howe', '75243', '111 B Parkway, #23');
INSERT INTO hotel.customer VALUES(4000, 'Mr', 'Frank', 'Miller', '95054', '27 5th St., 76');
INSERT INTO hotel.customer VALUES(4100, 'Mrs', 'Susan', 'Baker', '90018', '200 MAIN STREET, #94'
INSERT INTO hotel.customer VALUES(4200, 'Mr', 'Joseph', 'Peters', '92714', '700 S. Ash St., APT.1
INSERT INTO hotel.customer VALUES(4300, 'Company', NULL, 'TOOLware', '20019', '410 Mariposa St.,
INSERT INTO hotel.customer VALUES(4400, 'Mr', 'Antony', 'Jenkins', '20903', '55 A Parkway, #15')
This is custom documentation. For more information, please visit the SAP Help Portal 8
1/12/2024
INSERT INTO hotel.hotel VALUES(70, 'Empire State', '12203', '65 Yellowstone Dr.');
INSERT INTO hotel.hotel VALUES(80, 'Midtown', '10019', '12 Barnard St.');
INSERT INTO hotel.hotel VALUES(40, 'Eighth Avenue', '10019', '112 8th Avenue');
INSERT INTO hotel.hotel VALUES(50, 'Lake Michigan', '60601', '354 OAK Terrace');
INSERT INTO hotel.hotel VALUES(60, 'Airport', '60018', '650 C Parkway');
INSERT INTO hotel.hotel VALUES(90, 'Sunshine', '33575', '200 Yellowstone Dr.');
INSERT INTO hotel.hotel VALUES(100, 'Beach', '32018', '1980 34th St.');
INSERT INTO hotel.hotel VALUES(110, 'Atlantic', '33441', '111 78th St.');
INSERT INTO hotel.hotel VALUES(120, 'Long Beach', '90804', '35 Broadway');
INSERT INTO hotel.hotel VALUES(150, 'Indian Horse', '92262', '16 MAIN STREET');
INSERT INTO hotel.hotel VALUES(130, 'Star', '90029', '13 Beechwood Place');
INSERT INTO hotel.hotel VALUES(140, 'River Boat', '70112', '788 MAIN STREET');
INSERT INTO hotel.hotel VALUES(300, 'Ocean Star', '44332', '16 MAIN STREET');
INSERT INTO hotel.hotel VALUES(310, 'Bella Ciente', '77111', '13 Beechwood Place');
INSERT INTO hotel.hotel VALUES(320, 'River Boat', '79872', '788 MAIN STREET');
This is custom documentation. For more information, please visit the SAP Help Portal 9
1/12/2024
Learn how to establish a connection between SAP HANA Cloud, SAP HANA database and a remote source.
SAP HANA smart data access (SDA) and SAP HANA Smart Data Integration (SDI) allow you to access remote data through
virtual tables without copying the data into SAP HANA. For more information, see Virtualizing Data from Remote Data Sources.
Remote data access can take longer because data needs to be transferred through the network each time a query is executed.
In certain situations, replicating the remote data to the local system might offer better query performance than accessing the
data in a remote table. Remote tables can be replicated into your SAP HANA database instance using SDA or SDI. For more
information, see Replicating Data from Remote Data Sources.
To replicate data between two SAP HANA Cloud instances, you can use the SDA hanaodbc adapter instead of the SDI
HanaAdapter. For more information about replication with SDA, see Con gure Remote Table Replication with the SDA HANA
Adapter.
SAP HANA smart data access (SDA) vs. SAP HANA Smart Data Integration (SDI)
You can connect an SAP HANA database instance to a number of different remote data sources using SDA and SDI. There are a
few differences between the SDA and the SDI:
When adding a remote SAP HANA source, the hanaodbc adapter must be selected to use SDA and the HanaAdapter
adapter for SDI. For a list of all supported sources, see SAP Note 2600176 .
The SAP HANA Data Provisioning Agent is required for connections with SDI.
cloud remote source Connect to an Amazon Athena and Google BigQuery cloud database.
SAP HANA Cloud, SAP HANA database Connect to another SAP HANA Cloud, SAP HANA database instance.
on-premise remote sources Connect to any database, such as Microsoft SQL Server.
Related Information
Creating Tables and Loading Data Manually
Importing and Exporting Data
SAP Note 2600176
This capability provides operational and cost bene ts and supports the development and deployment of next-generation
analytical applications requiring the ability to access, synthesize, and integrate data from multiple systems in real time.
In SAP HANA, you use linked database or create virtual tables, which point to remote tables in different data sources, and then
write SQL queries in SAP HANA that use these virtual tables. The SAP HANA query processor optimizes these queries by
executing the relevant part of the query in the target database, returning the results of the query to SAP HANA, and then
completing the operation. For more information, see Managing Virtual Tables.
Smart data access supports connections to SAP HANA on-premise databases behind rewalls from SAP HANA Cloud using the
cloud connector. For more information, see Create an SAP HANA On-Premise Remote Source.
cloud remote source Connect to an Amazon Athena and Google BigQuery cloud database.
SAP HANA Cloud, SAP HANA database Connect to another SAP HANA Cloud, SAP HANA database instance.
SAP HANA on-premise Connect to an SAP HANA on-premise system using cloud connector.
on-premise remote sources Connect to any database, such as Microsoft SQL Server.
This is custom documentation. For more information, please visit the SAP Help Portal 11
1/12/2024
Parent topic: Connecting SAP HANA Cloud, SAP HANA database to Remote Data Sources
Related Information
Replicating Data from Remote Data Sources
Accessing Data from Remote Data Sources
Create Virtual Tables
on-premise remote sources Connect to any database, such as Microsoft SQL Server.
For more information about replication with SDI, see Con gure Smart Data Integration and Connect to SAP HANA Cloud.
cloud remote source Connect to an Amazon Athena and Google BigQuery cloud database.
SAP HANA Cloud, SAP HANA database Connect to another SAP HANA Cloud, SAP HANA database instance.
SAP HANA on-premise Connect to an SAP HANA on-premise system using cloud connector.
Trigger-Based Replication The trigger-based replication method uses See the documentation for SAP Landscape
the SAP Landscape Transformation (LT) Transformation Replication Server on the
Replication Server component to pass data SAP Help Portal.
from the source system to the SAP HANA
database target system.
Extraction Transformation Load-Based Extraction Transformation Load (ETL)- See the documentation for SAP Data
Replication based data replication uses SAP Data Services on the SAP Help Portal.
Services (also called Data Services) to load
relevant business data from SAP ERP to the
SAP HANA database. This lets you read the
business data on the application layer level.
Log-Based Replication SAP Replication Server (SRS) moves and See the documentation for SAP Replication
synchronizes transactional data including Server on the SAP Help Portal.
DML and DDL across the enterprise,
providing low impact, guaranteed data
delivery, real-time business intelligence,
and zero operational downtime.
Parent topic: Connecting SAP HANA Cloud, SAP HANA database to Remote Data Sources
Related Information
Virtualizing Data from Remote Data Sources
Accessing Data from Remote Data Sources
Replicating Tables from Remote Sources
Use the SAP HANA database explorer to add a remote data source. Then, create one or more virtual tables to access its data.
Parent topic: Connecting SAP HANA Cloud, SAP HANA database to Remote Data Sources
Related Information
Virtualizing Data from Remote Data Sources
Replicating Data from Remote Data Sources
Add a Remote Data Source
This is custom documentation. For more information, please visit the SAP Help Portal 13
1/12/2024
Create Virtual Tables
Prerequisites
You are working in a global account and have added a quota to the SAP HANA Cloud
The remote data source must be accessible. The Data Provisioning Agent in may be required to be installed and
con gured for the remote source.
Procedure
1. Open your SAP HANA database instance in SAP HANA database explorer. For more information, see Open the SAP
HANA Database Explorer.
2. In the SAP HANA database explorer, right-click the Remote Sources object in your database catalog and click Add
Remote Source.
3. Specify the remote source properties. The Source Location eld defaults to indexserver for SDA adapters, and the
registered SAP HANA Data Provisioning Agent for smart data integration.
Note
If you registered the SAP HANA Data Provisioning Agent at a remote source, select the adapter from the Adapter
Name drop-down. The registered agent will then become available under Source Location.
5. Fill in the other required connection property elds, which are marked with an *.
6. Specify one of the following credential modes (enter your user name and password as required):
Technical User
All connections to the remote data source share the same credentials.
Secondary Credentials
At least one set of secondary credentials should exist before creating the remote source.
None
7. Choose OK.
Results
This is custom documentation. For more information, please visit the SAP Help Portal 14
1/12/2024
The remote data source is connected to your SAP HANA Cloud instance. It is listed in the SAP HANA Database Explorer under
Catalog Remote Sources .
Next Steps
You can now create one or more virtual objects to access the data stored in the remote source. For more information, see
Create Virtual Tables.
Con gurations
Property Description
Adapter Version Version of the adapter used to establish the connection. This property cannot be modi ed.
Connection Mode Speci es if the connection is established based on the adapter properties or the data source name.
Con guration File The con guration le for the speci ed adapter.
Driver The library name containing the driver for the speci ed adapter.
Server/ServerNode The server address of the remote source. For failover, list the failover server name, separated by a
comma. For example, server_name1:30015,failover_server_name1:30015.
Custom Certi cation Authority The gRPC custom certi cation authority.
Database Name The name of the database you are creating the remote source for.
This is custom documentation. For more information, please visit the SAP Help Portal 15
1/12/2024
Property Description
Extra Adapter Properties Additional connection properties. Choose one of the following:
SAP HANA
sessionVariable:<session_variable_name>=?
SAP IQ
ServerName=<iq_computer_name>;CommLinks=tcpip(host=<IQ_host>;port=<IQ_port>)
For example, the additional properties to connect to the demo database would be:
ServerName=<iq_machine_name>_iqdemo;
CommLinks=tcpip(host=<iq_machine_name>;port=2638)
SAP ASE
(For failover only) Enables automatic failover for the remote source. Enter:
HASession=1;AlternateServers=<failover_server>:<failover_port_number>
Region The AWS region for Athena query execution (region for endpoint, for example, ap-northeast-2).
Work Group The Amazon Athena workgroup required for setting output location for query result csv les and its
encryption option.
Note
Depending on the adapter, the displayed connection properties may vary.
Credentials
Property Description
Technical User
Secondary Credentials
Secret Access Key The secret access key for Amazon Athena.
Property Description
This is custom documentation. For more information, please visit the SAP Help Portal 16
1/12/2024
Property Description
Port Number The port number of the computer where the client is located.
System Object Pre x The pre x for object names of the speci ed database
system.
Note
Depending on the adapter, the displayed connection properties may vary.
Prerequisites
You have added a remote source.
You have the CREATE VIRTUAL TABLE object privilege on the remote source.
Procedure
1. In the SAP HANA Database Explorer choose Catalog Remote Sources .
2. Click a remote source from the item list to open the remote source editor.
3. On the Remote Objects tab, locate the remote objects that you would like to add as virtual objects.
4. Select one or more remote objects and choose Create Virtual Object(s).
If you select only one remote object, then either use the default virtual object name or give it a new name. If you select
more than one remote object, then you can either leave the Object Names Pre x eld blank so all objects are created
with their default names, or you can specify a pre x that is added to the name of the new virtual objects.
7. Choose Create.
For more information, see Importing and Exporting Data in the SAP HANA Cloud Administration Guide.
This is custom documentation. For more information, please visit the SAP Help Portal 17
1/12/2024
Related Information
Creating Tables and Loading Data Manually
Connecting SAP HANA Cloud, SAP HANA database to Remote Data Sources
The following topics describe how to download and install the SAP HANA client on Linux and how to connect to the SAP HANA
Cloud database using JDBC and ODBC.
The SAP HANA client is also supported on UNIX, macOS, and Microsoft Windows. For detailed information, see the SAP HANA
Client Installation and Update Guide.
Connection information for all supported clients, including HDBSQL, Node.js, Python, and many more, can be found in the SAP
HANA Client Interface Programming Reference.
MicroStrategy is a certi ed SAP partner and provides analytics solutions that can be connected to SAP HANA Cloud through a
client. Other clients for third-party analytics solutions should work ne with SAP HANA Cloud if they are supported for SAP
HANA on-premise systems. Please contact the support department of your particular third-party analytics solution to obtain
compatibility information regarding SAP HANA Cloud.
The SAP HANA client sends TCP keepalive packages on idle connections by default. Make sure that these packages reach SAP
HANA Cloud and are not blocked by any rewall or HTTP proxy that is part of your network.
Note
The number of simultaneous connections to the SAP HANA database depends on the size of the instance. For instances with
up to 60 vCPUs, 500 simultaneous connections are supported for every vCPU. For larger instances, the supported
connections are capped at 30.000.
Connect to an SAP HANA on-premise system from your SAP HANA Cloud instance using the cloud connector. For more
information, see Data Access with SAP HANA Cloud.
Prerequisites
This is custom documentation. For more information, please visit the SAP Help Portal 18
1/12/2024
You require the SAPCAR archiving tool to be able to unpack software component archives (*.SAR les), which is the format of
software lifecycle media and tools that you can download from the SAP Software Download Center .
Context
To connect the SAP HANA client to the SAP HANA service, download the SAP HANA CLIENT 2.0 software. Connections to SAP
HANA Cloud require version 2.4.167 or greater. This software is the same as the SAP HANA client software that is part of the
SAP HANA Platform Edition. If you already have a license for the SAP HANA Platform Edition, then you do not need to download
the SAP HANA client separately.
Procedure
1. Navigate to the SAP HANA CLIENT 2.0 archive in the SAP Software Download Center : SUPPORT PACKAGES &
PATCHES By Alphabetical Index (A-Z) H HANA CLOUD CLIENTS HANA CLOUD CLIENTS 1.0 DOWNLOADS
./hdbinst
6. Set the environment variable LD_LIBRARY_PATH (Linux) or DYLIB_LIBRARY_PATH (macOS) to the installation root
location. On Windows, add the installation path to the PATH environment variable.
Sample Code
export LD_LIBRARY_PATH=<client installation directory>
Results
The SAP HANA client is installed. A log le is available. The log les are stored in the following location:
/var/tmp/hdb_client_<timestamp>.
Task overview: Connecting to the SAP HANA Database in SAP HANA Cloud
Related Information
Connect to the SAP HANA Database in SAP HANA Cloud via JDBC
Connect to the SAP HANA Database in SAP HANA Cloud via ODBC
Binding Applications to an SAP HANA Cloud Instance
SAP Support Portal Home
SAP Software Download Center
SAP HANA Client Installation and Update Guide
Prerequisites
You have downloaded and installed the client SAP HANA CLIENT 2.0 (version 2.4.167 or greater) or the downloaded JDBC
driver (version 2.4.67 or greater) from the public Maven repository
https://central.sonatype.com/artifact/com.sap.cloud.db.jdbc/ngdbc .
You have downloaded the root certi cates from DigiCert. The certi cates can be found on the DigiCert website
(https://www.digicert.com/digicert-root-certi cates.htm ) in both PEM and DER/CRT formats.
Caution
To avoid issues when commonly used browsers such as Mozilla Firefox and Google Chrome distrust older root
certi cates, DigiCert has started updating their rst generation (G1) CA certi cates to second-generation
(G2) certi cates. For more information, see https://knowledge.digicert.com/general-information/digicert-
root-and-intermediate-ca-certi cate-updates-2023 , SAP Note 3399573 , and SAP Note 3327214 .
You have added the root certi cates to the Java KeyStore (JKS) on your local machine. Alternatively, you can specify the
certi cates in the connection string through the sslTrustStore connection property.
Linux/macOS:
Windows:
Linux/macOS:
Windows:
You have the endpoint and port number, user name, and password for the SAP HANA database instance that you are
connecting to.
Tip
You can identify the endpoint of your instance on the overview page.
You have added the IP address of your client to the list of allowed connections in the con guration of your SAP HANA
database instance.
This is custom documentation. For more information, please visit the SAP Help Portal 20
1/12/2024
Context
Secure JDBC connections to SAP HANA Cloud require the SAP HANA JDBC 2.4.67 driver or greater and at least JVM 8. The SAP
HANA JDBC 2.4.67 driver is included with SAP HANA client version 2.4.167 or greater.
Note
JDBC uses the TLS implementation provided with the Java VM.
Procedure
1. Create a connection string that includes the required connection parameters. The format is:
"jdbc:sap://<endpoint>:<port>/?encrypt=true";
Example
Sample Code
Default Java VM KeyStore
Task overview: Connecting to the SAP HANA Database in SAP HANA Cloud
Related Information
Download and Install the SAP HANA Client
Connect to the SAP HANA Database in SAP HANA Cloud via ODBC
Binding Applications to an SAP HANA Cloud Instance
SAP Note 2769719
Managing SAP HANA Cloud Instances
Prerequisites
You have downloaded and installed the client SAP HANA CLIENT 2.0 (version 2.4.167 or greater).
This is custom documentation. For more information, please visit the SAP Help Portal 21
1/12/2024
You have downloaded the root certi cates from DigiCert. The certi cates can be found on the DigiCert website
(https://www.digicert.com/digicert-root-certi cates.htm ) in both PEM and DER/CRT formats.
Caution
To avoid issues when commonly used browsers such as Mozilla Firefox and Google Chrome distrust older root
certi cates, DigiCert has started updating their rst generation (G1) CA certi cates to second-generation
(G2) certi cates. For more information, see https://knowledge.digicert.com/general-information/digicert-
root-and-intermediate-ca-certi cate-updates-2023 , SAP Note 3399573 , and SAP Note 3327214 .
You have the endpoint and port number, user name, and password for the SAP HANA database instance that you are
connecting to.
Tip
You can identify the endpoint of your instance on the overview page.
You have added the IP address of your client to the list of allowed connections in the con guration of your SAP HANA
database instance.
Procedure
Create an ODBC data source.
Specify the endpoint and port number for the SAP HANA database instance.
Microsoft Windows
driver=HDBODBC;serverNode=<endpoint>:<port>;encrypt=Yes;
Example
Use ODBC on Microsoft Windows to connect to an SAP HANA database instance.
12345678-abcd-12ab-34cd-1234abcd.hana.hanacloud.ondemand.com:443
2. In the settings, select Connect Using SSL. If you are using SAP HANA client version 2.4, also select Validate the SSL
certi cate.
This is custom documentation. For more information, please visit the SAP Help Portal 22
1/12/2024
Use the following connection string to connect with the ODBC driver via TCP/IP:
driver=libodbcHDB.so;serverNode=<endpoint>:<port>;encrypt=Yes;
The odbc.ini le de nes ODBC data sources on Linux/UNIX/macOS. User data sources are usually de ned in ~/.odbc.ini
(where ~ is the user's home directory). The ODBC driver manager uses the odbc.ini le to nd the ODBC driver and provide
connection parameters. SAP HANA speci c connection parameter names are case-sensitive. The following is an example data
source in the odbc.ini le:
[HANADB1]
driver=/usr/sap/hdbclient/libodbcHDB.so
serverNode=<endpoint>:<port>
encrypt=Yes
DESCRIPTION=<description>
Task overview: Connecting to the SAP HANA Database in SAP HANA Cloud
Related Information
Download and Install the SAP HANA Client
Connect to the SAP HANA Database in SAP HANA Cloud via JDBC
Binding Applications to an SAP HANA Cloud Instance
SAP Note 2769719
Prerequisites
You have created an SAP HANA database instance.
Context
Services are exposed to applications by injecting access credentials into the application environment by means of service
bindings. Applications are bound to a service instance which describes the con guration and credentials required to consume a
service. Services instances are managed by a service broker which must be provided for each service (or for a collection of
services). Applications are bound to an SAP HANA database instance through a schema or an HDI container. Schemas or HDI
containers are set up by assigning the corresponding service plans to your database instance.
The schema service plan creates a plain schema, which you need to manage by hand. Consider using this service plan if your
application uses an OR Mapper concept and a framework is available that creates the necessary database resources on
demand.
When you create and bind a service instance with the service plan hdi-shared, an application receives the credentials required
for access to an HDI container, which is basically a database schema that is equipped with additional metadata.
This is custom documentation. For more information, please visit the SAP Help Portal 23
1/12/2024
HDI containers ensure isolation, and within an SAP HANA database you can de ne an arbitrary number of HDI containers. The
same objects can be deployed multiple times into different HDI containers in the same SAP HANA database, for example, to
install several instances of the same software product in the same SAP HANA database. HDI containers are isolated from each
other by means of schema-level access privileges. Cross-container access at the database level is prevented by default, but can
be enabled by explicitly granting the necessary privileges, for example, using synonyms.
Database objects (tables, views, procedures, and so on) have an owner: the user who created the object. When the owner of a
database object is deleted, all objects owned by the deleted user are removed from the database, too. In addition, if application
objects are created by end users, the objects are deleted when the end user is deleted, for example when the employee leaves
the organization. HDI ensures that during deployment all database objects are created by a container-speci c technical user,
which is never deleted as long as the container exists.
In HDI, database schema content (for example, tables, views, procedures, etc.) is de ned in corresponding design-time les as
part of a development project. These de nition artifacts are pushed to the platform as part of the HDI Deployer application
@sap/hdi-deploy, which is a Node.js application that is publicly available for use in Cloud Foundry. This deployer application binds
to an SAP HANA service instance and, on startup, creates the set of database objects that correspond to the pushed de nition
les, for example: myTable.hdbtable, myView.hdbview, or myProcedure.hdbprocedure.
Task overview: Connecting to the SAP HANA Database in SAP HANA Cloud
Related Information
Download and Install the SAP HANA Client
Connect to the SAP HANA Database in SAP HANA Cloud via JDBC
Connect to the SAP HANA Database in SAP HANA Cloud via ODBC
Subscribing to the SAP HANA Cloud Administration Tools (Multi-Environment)
SAP HANA Cloud Deployment Infrastructure Reference
Maintaining Multitarget Application Services in Cloud Foundry
Prerequisites
You have access to the Kyma runtime service and the Kyma Dashboard. For more information, see Kyma Environment.
You have a global account with SAP BTP and have added the hdi-shared plan under Entitlements SAP HANA
Schemas & HDI Containers to your subaccount. For more information on how to add space quota plans, see Assign
Quota Plans to Spaces in the SAP BTP documentation.
Context
This is custom documentation. For more information, please visit the SAP Help Portal 24
1/12/2024
HDI Containers created in the Kyma Environment can only be managed by using the kubectl CLI or the Kyma dashboard.
Procedure
1. Navigate to your subaccount.
3. In SAP BTP cockpit, on your subaccount Overview page, click the Kyma Environment tab.
5. Click the Namespaces tab in the navigation pane. Select an exsiting namespace or click Create Namespace to create a
new namespace.
6. In SAP HANA Cloud Central, map the instance you created to the Kyma environment and enter your Kyma namespace as
the Environment Group. For more information, see Map an SAP HANA Database to another Environment Context.
8. In the Kyma environment navigation pane, choose Service Management Service Instances and select Create
Service Instance.
9. Enter a name, offering name, and plan name, then click Create. The offering name is hana and the plan name is hdi-
shared.
10. Once the service instance is provisioned, click Create Service Binding.
11. Enter a name, select the service instance you created, and click Create.
Results
Your HDI Container has been created. It appears in Services Instances .
Related Information
Map an SAP HANA Database to another Environment Context
Prerequisites
You have completed the prerequisites for creating an instance in your SAP HANA Cloud. For more information, see
Subscribing to the SAP HANA Cloud Administration Tools (Multi-Environment).
You are working in an enterprise account and have added the schema or hdi-shared plan under Entitlements SAP
HANA Schemas & HDI Containers in your subaccount. For more information on how to add space quota plans, see
Assign Quota Plans to Spaces in the SAP Business Technology Platform documentation.
You have the GUID of the SAP HANA Cloud database instance that you are connecting to.
This is custom documentation. For more information, please visit the SAP Help Portal 25
1/12/2024
Tip
You can obtain the GUID of your instance on the instance overview page in SAP HANA Cloud Central. From the
Actions menu choose Copy Instance ID.
Procedure
1. Navigate to your subaccount in the SAP BTP cockpit.
All services available to you appear. The list of services you see in the SAP Service Marketplace is determined by the
services to which you have subscribed.
schema
The schema service plan creates a plain schema, which you need to manage manually or with application code. No
automated deployment or schema-management services are provided. See The “schema” Service Plan.
hdi-shared
When you create and bind a service instance with the service plan hdi-shared, an application receives the
credentials required for access to an HDI container, which is basically a database schema that is equipped with
additional metadata. See The “hdi-shared” Service Plan.
6. (Optional) If you have multiple SAP HANA Cloud database instances, specify the endpoint of the database that will be
the deployment target for your application in JSON format:
{"database_id": "<GUID>"}
Sample Code
{"database_id": "abcd1234-5678-1234-a1b2-abcdef123456"}
7. (Optional) If you've already deployed an application that you want to bind to the new service instance, choose it from the
list, and then choose Next.
Results
An instance of the service is created and appears in Services Service Instances .
Related Information
SAP HANA Service Plans
This is custom documentation. For more information, please visit the SAP Help Portal 26
1/12/2024
Bind your application to your SAP HANA Cloud instance through the SAP HANA service broker instance (SAP HANA Schemas &
HDI Containers).
Prerequisites
The application is deployed. For more information about developing and deploying applications in the Cloud Foundry
environment, see the SAP Business Technology Platform documentation.
Procedure
1. Navigate to your Cloud Foundry space.
The overview lists all applications to which the selected application is currently bound.
3. Choose an application.
4. In the navigation area, choose Service Bindings, then select Bind Service.
5. On the Choose Service Type tab, select the Service from the catalog radio button and choose Next.
6. On the Choose Service tab, select SAP HANA Schemas & HDI Containers and choose Next.
8. Select the service broker instance that you bound to your SAP HANA Cloud instance and choose Next.
9. Choose Finish.
Results
The application is bound to your SAP HANA Cloud instance through the SAP HANA service broker instance (SAP HANA
Schemas & HDI Containers).
Procedure
1. Navigate to the Cloud Foundry space and choose Applications. Select the Stop icon for your application.
Note
An application’s status in uences when a newly bound SAP HANA database becomes effective. If an application is
already running (Started state), it does not have access to the newly bound database until it has been restarted.
2. Once the application status has changed to Stopped, select the Start icon for your application.
Results
You have created a service binding for an SAP HANA database in your Cloud Foundry space.
To unbind a database from an application, choose (Delete) in the Actions column. The application maintains access to the
database until it is restarted.
This is custom documentation. For more information, please visit the SAP Help Portal 27
1/12/2024
To change database parameters (for example, to assign a higher memory limit to one of its processes), choose the Change
Quota button on the Overview page.
Calculation Views
A calculation view allows users to de ne more advanced slices on the data available in the SAP HANA database.
Calculation views are mainly used for analyzing operational data marts or running multidimensional reports on revenue,
pro tability, and more. Calculation views consume various combinations of content data (that is, non-metadata) to model a
business use case. You can classify content data as:
Measures: Quanti able data - such as revenue, quantity sold, and counters.
Calculation views simulate entities (such as customer, product, sales, and more) and their relationships. Data visualization and
analysis applications such as SAP BusinessObjects Explorer and Microsoft Office based reporting tools consume these
calculation views and help decision makers in their decision process.
You can create calculation views with layers of calculation logic, which include measures sourced from multiple source tables, or
advanced SQL logic, and much more. The data sources in a calculation view can include any combination of tables and
calculation views. You can create joins, unions, projections, and aggregations on data sources.
You can model calculation views using SAP Business Application Studio and SAP Web IDE Full-Stack. For more information, see
SAP HANA Cloud, SAP HANA Database Modeling Guide for SAP Business Application Studio and SAP HANA Cloud Modeling
Guide for SAP Web IDE Full-Stack.
Using the Machine Learning Libraries (APL and PAL) in the SAP
HANA Cloud, SAP HANA Database
Set up the environment for using the SAP HANA Automated Predictive Library (APL) and SAP HANA Predictive Analysis Library
(PAL) in the SAP HANA Cloud, SAP HANA database. APL and PAL are already installed in the SAP HANA database in SAP HANA
Cloud.
You can enable the script server for new and existing SAP HANA Cloud database instances from the SAP BTP cockpit. See
Create an SAP HANA Database Instance Using SAP HANA Cloud Central and Managing SAP HANA Database Instances.
Setting Up PAL
Grant users the privileges required to work with the SAP HANA Predictive Analysis Library. These are contained in the
AFL__SYS_AFL_AFLPAL_EXECUTE database role. You can assign the role to a user by running the following SQL statement
as the DBADMIN user and replacing <PAL_user> with the appropriate SAP HANA user name:
This is custom documentation. For more information, please visit the SAP Help Portal 28
1/12/2024
Setting Up APL
APL users
Grant users the privileges required to work with the SAP HANA APL function library. These are contained in the
sap.pa.apl.base.roles::APL_EXECUTE database role. You can assign the role to a user by running the following
SQL statement as the DBADMIN user and replacing <APL_user> with the appropriate SAP HANA user name:
If required, activate the traces and set up auditing. See Activate the Traces and Audit SAP HANA APL.
APL samples
The SAP HANA APL GitHub repository contains sample datasets and scripts. See SAP HANA APL GitHub Repository .
To try out an APL function using a sample script, you must rst import the sample datasets into SAP HANA tables. The
dataset schema is named APL_SAMPLES. The examples shown in the function reference use the sample datasets.
For information about how to import data using the SAP HANA database explorer, see Import Data Into a New or
Existing Table.
Related Information
SAP HANA Cloud Predictive Analysis Library (PAL)
SAP HANA Automated Predictive Library Developer Guide
User Management with the SAP HANA Cloud Administrator DBADMIN
SAP HANA contains most of the SRSs de ned by EPSG and ESRI as prede ned SRSs. With the following statement you create
all prede ned SRSs:
In case you only want to create the SRSs you need in your ESRI software, you can use the following statement:
This is custom documentation. For more information, please visit the SAP Help Portal 29
1/12/2024
Note
An SRS cannot be changed or deleted as long as it is used by a table column.
Prede ned SRSs can change on an SAP HANA upgrade, but all SRSs created from the previous prede ned SRSs remain
unchanged.
Related Information
CREATE PREDEFINED SPATIAL REFERENCE SYSTEMS Statement
CREATE PREDEFINED SPATIAL REFERENCE SYSTEM IDENTIFIED BY "srs-id" Statement
For information about the capabilities available for your provisioning scenario, refer to the Feature Scope Description for SAP
HANA Cloud.
This is custom documentation. For more information, please visit the SAP Help Portal 30