Monday 20 August 2018

Setting up the new HANA service in SAP Cloud Platform Cloud Foundry

So what is actually new with the HANA service?


HANA as a service has been available for a long time in the Neo environment of SAP Cloud Platform. There are plenty of customers who have subscribed to the HANA service to create applications that leverage the core capabilities of HANA or implement data mart scenarios in the cloud.

In the Neo environment, customers could only request for HANA 1.0. There were also limitations around the elastic capabilities – for example, it was not straight forward to change the size of a HANA instance once it has been provisioned to a customer. Early 2018, there were some new capabilities introduced to allow customers to install and manage their HANA database using Self-Service options. You could only select from few of the available standard memory size – 64GB, 128GB, 256GB, 512GB, 1TB.
The new HANA service on Cloud Foundry is based on HANA 2.0 and offers on-demand self-provisioning capabilities. It also offers a flexible pricing model and allows you to scale the HANA instance according to you requirements.  You can subscribe to blocks of HANA memory and accordingly spin up several HANA instances in various combination – For example, you can create two HANA instances with memory size 192GB and 96GB.

In this blog, I will share my experience in setting up and connecting to the the new HANA service. There are some differences in how you would connect to the the new HANA service in Cloud Foundry when compared to the neo environment.

Create a HANA service instance


The below screenshot show the list of subaccounts which are attached to a Global account which has been initially created in the Neo environment.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

I have used the “New Subaccount” button to create additional subaccounts. In this case, I have created a subaccount called “CAL” which resides in AWS.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Under Entitlement, you should be able to view the resources which your organization has subscribed too.  You can edit this page and add resources to each of the subaccount. For my scenario, I would just increase the counter of the HANA service against the CAL subaccount.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Once the HANA service has been assigned to the subaccount, you should be able to view it in the

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Under the spaces, within your subaccount, you should be able view “SAP HANA Service” in the Service Marketplace.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Select the HANA service and navigate to the “Instances” menu to create an instance of your HANA service.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Click on the “New Instance” button to trigger the wizard which will take you through the steps to create your first instance. In the first screen, select the plan – Enterprise or Standard (depending on what subscriptions you have).

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

In the Parameter section, provide the SYSTEM user password. You also get to select the size of your HANA instance here. It is blocks on 16GB with minimum two blocks. You can spin up a HANA instance upto 2TB. In the below screen, you also get to select allow the HANA service to be accessible on the Internet or to specific IP Addresses.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

In the next screen, you can assign/bind any existing application to the HANA service. You can skip it if you don’t have any applications. In the last screen, you can provide the name for your HANA instance. I have provided a name “myhana2” as shown below.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

When you click on “Finish”, this will trigger the creation of your instance and you will see the status as “Created” in few minutes. Open the dashboard by click on the icon shown below

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Login with you SAP Cloud Platform login credentials.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

The Dashboard will give details of the database. The ID, Provider, Memory size etc. The Database endpoint highlighted below will be required when you want to connect to this database using other tools. You also get to Start and Stop your instance from the dashboard.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

You can also jump to the SAP HANA Cockpit from the dashboard. Note that you would need to provide SYSTEM user and the password provided earlier to access the cockpit.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Once you are in the HANA Cockpit, you can create users/assign additional privileges and perform other administrative tasks.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

From the “Overall Database Status” tile, you can get into the details and also obtain the Tenant database name.  You will need the database name later on.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

In the Cockpit, you can scroll to the bottom and also verify the HANA version.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Click on the “Open SQL Console” at the top right hand corner of the cockpit to launch the SQL console. From here, you can do all the development tasks – creating HANA artefacts and run your SQL commands.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Connect Eclipse to HANA service


There are changes in how you would use Eclipse to connect to HANA service. If you would connect to a HANA service in the Neo environment, you would select “Add Cloud System”. For connecting to Cloud Foundry environment, use “Add System” as shown below.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

In the Hostname, provide the database endpoint which you can obtain from the HANA service dashboard. Copy it without the port. For instance number provide 00 and select “Multiple Containers” and provide the Name as <HANA Tenant DB name: Port>. You can obtain the port from the database endpoint from the HANA service dashboard.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

The HANA database name can be obtained from the HANA Cockpit by clicking on the first tile “Overall Database status”

In the next screen, provide the HANA DB user credentials and select “Connect using SSL”.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

This will connect you to the HANA service on SAP Cloud Platform and you will be able to view the catalog objects within Eclipse.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Connect on-premise Reporting tools


In the Neo environment, when connecting to a HANA database, we would use SAP Cloud Connector to create a service channel.

Each HANA instance has a secure endpoint which can be reached via public internet. You longer need a Cloud Connector or VPN connection. You can use TCP/IP (encrypted),  secure Websockets (HTTP based) and any standard HANA client to connect to the HANA service

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

In this blog, I will show how to use setup ODBC connection to the HANA service and also look at consuming this within on-premise Predictive Analytic Suite. I had previously covered how this is done in the Neo environment in this blog “Using Predictive Analytics and Python on SAP Cloud Platform HANA database”

The first part is creating ODBC connection. Ensure you have installed the latest HANA Client drivers from the marketplace. Launch the ODBC Data Source Administrator.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

In the Server:Port – Provide the database endpoint which is available in the HANA service dashboard. Copy the details from the dashboard along with the port.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Make sure you select the checkboxes :”Connect using SSL” and “Validate the SSL certificate”.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Finally, provide the database user credentials and select “Connect using SSL”.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Test the connection and look for a success message.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

The next part is on consuming this ODBC connection in Predictive Analytics tool.

From the Toolkit menu, click “Open the Data Viewer”.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Select “Database” from the Data Type drop-down box and click the Browse button to select the ODBC DSN created earlier. This will provide you with access to the catalog contents of the HANA service.

SAP HANA Certification, SAP HANA Study Materials, SAP Cloud Platform, SAP HANA  Guides

Using the same approach, you should be able to connect various on-premise reporting tools to HANA service on SAP Cloud Platform Cloud Foundry environment.

No comments:

Post a Comment