SAP HANA Express VM Getting Started
This page contains instructions on how to set up SAP HANA Express Edition Virtual Machine for development and use of SAP training material.
Applies to SAP HANA Express Edition 2.0 SPS03 and SPS03
Most important step in order to prevent build errors afterwards is to Activate Tenant Database
Setup Environment
Activate Tenant Database
- Login to SAP HANA XS Advanced Cockpit, probably at https://hxehost:51036/cockpit#/xsa/overview
- Go to Tenant Databases
- For Tenant Database HXE Click on Button Activate -> Enter Master Password
- Map Database to Organization HANAExpress and Space development. Activate default checkbox
- Click Save
Database Explorer
Find database SQL port numbers starting from the system database:
SELECT DATABASE_NAME, SERVICE_NAME, PORT, SQL_PORT, (PORT + 2) HTTP_PORT FROM SYS_DATABASES.M_SERVICES WHERE DATABASE_NAME='<DBNAME>' and ((SERVICE_NAME='indexserver' and COORDINATOR_TYPE= 'MASTER') or (SERVICE_NAME='xsengine'))
Add System Database
- Login to SAP HANA Cockpit at https://hxehost:39030/go/hana-cockpit or https://hxehost:51045/cockpit#Shell-home (Use XSA_ADMIN)
- Go to: Resource Directory -> SystemDB@HXE
- Look at tile "Overall Database Status" and note server name and instance number
- Login to SAP Web IDE (Use XSA_DEV)
- Go to Database Explorer and click on "+"
- Select Database Type SAP HANA Database
- Enter values as follows:
- Host -> server name noted above
- Identifier -> Instance number -> instance number noted above
- User -> System
- Passwort -> Master Password
- Click on OK
Add Tenant Database
Web IDE
Clone Project
- Clone from desired repository
- Open Project Settings -> Open section Space
- Set space to development
- Click on Save
Install Demodata
SFLIGHT
- Download https://github.com/SAP/hana-xsa-opensap-hana7/raw/snippets_2.3.2/ex2/sflight_hana.tar.gz
- Open Web IDE
- Go to Database Explorer
- Open System Database
- Right-Click on Catalog and select Import Catalog Objects
- Enter values as follows:
- Import objects from -> local computer
- Local archive (*.tar.gz) -> Select file downloaded above
- Activate Include dependencies and Include table data
- Number of parallel threads -> 2
- Click on OK
Build zunächst user-db dann die core-db / db.
Trouble Shooting
Build of DB fails with invalid user name
Error Message
Using grantor service "ServiceName_1" of type "sql" Error: Error executing: GRANT "SFLIGHT_CONTAINER_ACCESS" TO "OPENSAPHANA_OPENSAPHANA_HDI_CONTAINER_1#OO"; (nested message: invalid user name: OPENSAPHANA_OPENSAPHANA_HDI_CONTAINER_1#OO: line 1 col 37 (at pos 36)) grantor service: "ServiceName_1", type: "sql", user: "CUPS_SFLIGHT" file name: cfg/SFLIGHT.hdbgrants
Root Cause
User name OPENSAPHANA_OPENSAPHANA_HDI_CONTAINER_1#OO was created in a different tenant database, i.e. SYSTEM instead of HXE.
The HXE tenant database has to be activated and mapped as default in the VM first. If this is not the case any created projects will create users in SYSTEM database instead of the development tenant database.
Fix
No fix known besides to dropping the VM entirely and setup again and following the steps above Setup Environment
Build of DB fails
Error Message
20:27:30 (DIBuild) Processing "cfg/central.hdbgrants"... ok Processing "cfg/user.hdbgrants"... Using grantor service "hdi-user-service" of type "hdi" Granting schema roles in the container "OPENSAP_HANA_USER_00_1" and the parameters "[]"... Granting the schema role "user#" to the principal "OPENSAPHANA_OPENSAPHANA_DB_HDI_CONTAINER_1#OO" in the schema "" with grant option = "false" Error: Database error 389: : invalid role name: user#: line 1 col 7 (at pos 6) [8201003] Error: Granting schema roles in the container "OPENSAP_HANA_USER_00_1" and the parameters "[]"... failed [8214221]Error: Error executing: CALL "OPENSAP_HANA_USER_00_1#DI".GRANT_CONTAINER_SCHEMA_ROLES(#CONTAINER_ROLES, #CONTAINER_ROLES_PARAMETERS, ?, ?, ?); (nested message: HDI call failed)grantor service: "hdi-user-service", type: "hdi", user: "OPENSAP_HANA_USER_00_1_BVB0FJGXOQE559VFZERVZC3S1_DT" (hdi_user)file name: cfg/user.hdbgrants
Root Cause
Missing User DB.
Fix
Build User DB first.