[BTP HANA Cloud Database] : How to access HANA Cloud Database & HDI Container in BTP
The purpose of this blog post is to offer guidance on accessing the HANA Cloud Database and HDI Container in your BTP.
If your BTP account is already configured with HANA Cloud and your application space in the sub-account has an Hana HDI container, you can skip ahead to the section titled ‘Get Started with the SAP HANA Database Explorer‘ in this post.
SAP HANA Cloud is a SAP HANA Cloud is a database as a service (DBaaS) , provides a single place to access, store, and process all enterprise data in real time with high availability .You can develop smart applications with embedded machine learning , analytics (advanced data processing capabilities , insights ) ,document store . SAP HANA Cloud provides all of the advanced SAP HANA technologies for multi-model data processing ,store and access data in-memory and column-based [ it Process mission-critical data at proven in-memory speed] or on disk . By combining in-memory storage with columnar store, data operations are performed faster than in a traditional database with a disk-based storage. Using SAP HANA Cloud, you can set up and manage SAP HANA databases and bind them to applications running on SAP Business Technology Platform (SAP BTP) or elsewhere. You can benefit from cloud qualities such as availability, security, 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.
If you have already set up an SAP HANA Cloud service in your BTP account, you can skip this step and proceed to the section titled ‘Get Started with the SAP HANA Database Explorer‘ using your existing SAP HANA Cloud service instance. However, if you need to create a new SAP HANA Cloud service instance, please follow the instructions provided in the ‘Create an SAP HANA Cloud service instance‘ section.
1) Create SAP HANA Cloud service in your BTP
SAP HANA Cloud instances are not created automatically for any type of BTP account. Therefore, you will have to create an SAP HANA Cloud service instance first, if you don’t have one yet.
How to create SAP HANA Cloud instance in the trial BTP environment.
Refer below document ,
How to Get an SAP HANA Cloud Instance for SAP Business Technology Platform, Cloud Foundry environment to learn.
On BTP trial, your SAP HANA Cloud instance will be automatically stopped overnight, according to the server region time zone. That means you need to restart your instance every day before you start working with your trial.
Once you complete the tutorial steps in Provision an Instance of SAP HANA Cloud, SAP HANA Database
- Set Up Your SAP HANA Cloud, SAP HANA Database (free tier model or trial) and Understand the Basics
- Take Your First Steps with SAP HANA Cloud, SAP HANA Database
As an optional step if you are completely new to the SAP HANA Cloud environment, you might want to consider also going through this tutorial: Tools to Manage and Access the SAP HANA Cloud, SAP HANA Database in order to familiarize yourself with the various tools that can be used to manage and develop with SAP HANA Cloud.
- After provisioning a HANA Cloud DB, the next step is to create an instance of HANA Schema and HDI Service.
- The HDI Service generates a schema (if you use schema plan) that allows your Spring Boot application to create its database artifacts.
- Core Data Services (CDS) generate database objects (tables, views, etc.), and with only a few lines of code, you can have a Web API (OData/REST) that offers functionality to create, read, query, update, and delete (CRUD+Q) transactions.
- In SAP CAP, the hdi-shared plan is used, which deploys the database artifacts from your CDS files.
- All these database artifacts are bundled into a wrapper called Schema, staged, built, and then deployed into SAP HANA Cloud Database in the form of a database container.
- In an SAP HANA Cloud instance, the SAP HDI is enabled by default.
- The SAP HANA Deployment Infrastructure (HDI) is a service layer of the SAP HANA database that helps create runtime database objects (such as tables, views, procedures, etc.) from design-time artifacts like CDS and JPA entities.
- HDI creates a new HANA repository (with both design-time and runtime management) per project. Each container gets its unique technical user to control database artifacts.
- You have two options to create an HDI instance: manual or automatic (program).
1) Manually :
You can use BTP Cockpit : Set Up a HANA Schema or an HDI Container
or Commands (CLI)
create-service hana-cloud-trial hdi-shared sap-demo-hdi-db
2) Programming : You can use SAP CAP Framework or Java or NodeJS or Python
- name: sap-demo-hdi-db type: com.sap.xs.hdi-container parameters: service: hana-cloud-trial # 'hana-cloud-trial' 'hanatrial' on BTP trial landscapes #for BTP enterprise account please use 'hana'
Fo your reference :
Develop a CAP Node.js App Using SAP Business Application Studio
Build a Business Application Using CAP for Java
Official Document :
In case you’ve a question, find a bug, or otherwise need support, use our community
Now , it is time to learn how to access HANA Cloud Database in your BTP Cockpit.
Get Started with the SAP HANA Database Explorer Cockpit
SAP HANA Database Explorer is a tool used to interact with SAP HANA databases, as well as use the SAP Graph and Spatial engines. In the HANA Database Explorer, you can also access the SQL console.The SAP HANA database explorer can be opened from multiple locations as shown below:
Option1: Access Cockpit using BTP HDI Instances Technical (Container Runtime(RT)/DT Credentials)
- From the SAP Business Technology Platform (SAP BTP) Cockpit
- In SAP BTP cockpit, enter your global account, subaccount, and space.
- On the menu on left-side of the screen, click on Instance
- Choose your HDI instance as shown below
- Click on View Credentials
- Note down or Download Credentials.
- In your BTP Space Left-side of the screen, click on SAP HANA Cloud as shown below .
- Click on Open DaseBase Explorer Cockpit.
Note : Instead of creating HANA Cloud in your BTP Space ,If your BTP Admin has setup central HANA cloud for your sub-account (for all spaces) then ask to share central “BTP Hana Cloud Database Explorer ” URL .
- Click on Login Enter Database credentials
- If Login success then you can view user screen as below.
- Click on SQL Console.
- This open HANA SQL Cockpit & then you can choose your HDI schema as shown below.
Schema ID is your BTP Space HDI instance, choose accordingly .
- Once you access Schema then you can view tables , views , procedures .. etc
One additional tip : If you have other technical credentials ,you can switch user by right click on Schema & login with different user , enter technical user credentials ..
You can further refer tutorials How to Create Database Objects with SAP HANA Database Explorer .
Option2: Access BTP HDI Container using SAP HANA Database Explorer
If you know SAP HANA Database Explorer Cockpit & have access to BTP Space then follow below steps.
- Click on + Symbol.
- Choose HDI Container in instance Type.
- Choose HDI instance.
- You can enter Display name to visible in SAP HANA Database Explorer Cockpit.
Option3: Connect to HANA Database using SAP HANA Database Explorer
You can provide the host, port, user name, password from HDI instance of BTP Space
It is good to know about which Credentials to use ,so few notes for you.
- If you have access to BTP & HANA Cloud instance then ,the HANA Database Explorer will open in a new browser tab and automatically select the database entry for your project’s HDI container.
- Note that the credentials can be saved so they do not need to be re-entered if they are entered into the SAP HANA cockpit.
- As best practise you should avoid DBADMIN Credentials usage.Also be aware that if DBADMIN User locked ( I mean , if someone tried with wrong password ,it is not easy to Unlock /Reset Password, We need to reach to HANA Cloud ,it will take time as there is no self-service as of now to rest DBADMIN User so better to avoid Locking of DBADMIN User )
It is highly recommended that you do not use DBADMIN for day-to-day activities in production environments.
Instead, use it to create database users with the minimum privilege set required for their duties (for example, user administration, system administration). Then deactivate DBADMIN. You may temporarily reactivate the DBADMIN user for emergency or bootstrapping tasks.
You can also create alternative ADMIN User ,follow official guide for HANA Database Users.
Create Users and Manage Roles and Privileges
User Management with the SAP HANA Database Administrator DBADMIN
- SAP HANA Cloud Guide
- SAP HANA Cloud community
- SAP HANA Cloud Onboarding Guide Module 01 – Fundamentals
- Security Administration and User Management
Thank you for reading this blog post. If you find this material useful then please leave your feedback in the comments section below.
Kindly let me know if you need any further assistance in comments section below.
Also ‘Like’ ,‘Share’ , ‘Follow’ me to get new updates.
I was looking for this.
One of the best posts - very clearly defined steps. Thank you this is very helpful.