Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
showkath_naseem
Product and Topic Expert
Product and Topic Expert
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.

Introduction


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.

 

Prerequisites


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 environmen...

 
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

  1. Set Up Your SAP HANA Cloud, SAP HANA Database (free tier model or trial) and Understand the Basics

  2. 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.

Note : Shared BTP HANA Cloud Scenario: Utilizing a Centralized HANA Cloud Database


In this scenario , in  Your BTP Subaccount , if a shared HANA Cloud database is available in your BTP subaccount's central space, aiming to minimize costs and operational efforts. then application developers typically won't require creating their own SAP HANA Cloud database,   Nonetheless, an instance of the HANA Schema & HDI Container service is essential for establishing a connection between applications and the shared HANA Cloud database.

2) HDI



  • After provisioning a HANA Cloud Database , 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.

  • There are other plans for different use cases, for example, if you follow the SAP CAP (SAP Cloud Application Programming Model), which is a framework developed by SAP to build cloud applications and services based on either JavaScript/Node.js or Java (Spring Boot).

  • 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 :

Tutorials :

Develop a CAP Node.js App Using SAP Business Application Studio


Build a Business Application Using CAP for Java

Sample apps: 

https://github.com/SAP-samples/cloud-cap-samples

https://github.com/SAP-samples/cloud-cap-samples-java

https://github.com/SAP-samples/cap-sflight

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.





Thank you for reading this blog post!
If you have found this blog post beneficial in your learning journey, I would greatly appreciate it if you could click the
Like 👍 button , and share your feedback in the Comments section below. Additionally, please Follow me for more valuable content. Your support means a lot to me!


Kindly let me know if you need any further assistance or feedback in comments section below.




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

  • Note . If you don't already have an HANA Cloud instance, as described earlier, it's necessary to create an instance of the HANA Schema and HDI Container service to establish a connection between BTP applications and the HANA Cloud database,


  • 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

 

 

Note :

It is good to know about which Credentials to use ,so few notes for you.

 

  1. 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.

  2. 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.

  3. 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 )

  4. Recommendation


It is highly recommended that you do not use DBADMIN for day-to-day activities in production environments.


The DBADMIN user is intended exclusively for database administration purposes and should not be utilized by applications & individual application developers.

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

 

Documentation


 

 




Thank you for reading this blog post!
If you have found this blog post beneficial in your learning journey, I would greatly appreciate it if you could click the
Like 👍 button , and share your feedback in the Comments section below. Additionally, please Follow me for more valuable content. Your support means a lot to me!


Kindly let me know if you need any further assistance or feedback in comments section below.
5 Comments