Create Tenant Database for SAP HANA Express – by the SAP HANA Academy
In this playlist you will find video tutorials on miscellaneous topics; some included in the Getting Started with SAP HANA express edition guide (PDF) that comes with the download, others not (yet).
How to create a tenant database is such a topic.
SAP HANA express edition comes as a binary installer or as a preconfigured virtual machine image (ova file). There are two versions for the VM: server only, and server+apps. On both versions, SAP HANA is running as a multitenant database container (MDC) system.
If you are not familiar yet with the topic of MDC in general, please see my blog or check out the MDC playlist on the Academy: http://bit.ly/2dP53hw
Two of the most important components of a SAP HANA system are:
- name server (hdbnameserver) – holds information about the topology of the system (hosts, services, data)
- index server (hdbindexserver) – the actual database engine (row store, column store, object store)
There are many other components. Some serve an auxiliary role, like the web dispatcher, compiler, preprocessor, and script server. Other components are added to the system when you install, for example, Dynamic Tiering (extended store server) or Smart Data Integration (data provisioning server).
One of the main differences between a regular SAP HANA system and a multitenant database container system is that with MDC, the database engine for the system database is embedded in the nameserver process. Only tenant databases run in an indexserver process.
At first sight, the system database might look like a regular database and seem like a fine place to store your development artifacts. However, the system database is not a regular database and should only be used to manage the overall system.
The main role of the nameserver is to take care of system and landscape operations. Blowing up the system database with user data interferes with this essential task and might – eventually, potentially – introduce system stability and performance issues.
There are also a few technical restrictions on the system database: you simply cannot add services that process user data. For example, you cannot add the script server required for the Predictive Analysis Library (PAL) or add the data provisioning server (dpserver) required for Smart Data Integration (SDI).
When you try, SAP HANA will respond:
Could not execute ' <command> ' Feature not supported: only applicable to user databases
The same message will be returned when you try to use the system database for any of the SAP HANA options (Dynamic Tiering, Smart Data Streaming, RDSync).
Besides the limitations, you would also miss out on a great feature when using the system database for development, namely database copy (and move). It is very easy to copy and move tenant databases between systems, for example, between a development VM and production system. However, if your development artifacts are stored in the system database, the only way to get them out is by exporting the content as a delivery unit DU).
In other words, before you start to do any serious development with SAP HANA express edition, first create a tenant database.
So how can you do this? It is simple.
1. Watch the video
2. Use the code
-- create a tenant CREATE DATABASE TESTDB SYSTEM USER PASSWORD Initial1; -- add the script server service ALTER DATABASE TESTDB ADD 'scriptserver' -- or hit two birds with one stone CREATE DATABASE TESTDB ADD 'scriptserver' SYSTEM USER PASSWORD Initial1; -- Tenants by default start automatically, but can be started and stopped manually as well ALTER SYSTEM START DATABASE TESTDB; -- Stop before you drop ALTER SYSTEM STOP DATABASE TESTDB; DROP DATABASE TESTDB;
This blog is part of a series:
Thank you for watching
The SAP HANA Academy provides free online video tutorials for the developers, consultants, partners and customers of SAP HANA.
Topics range from practical how-to instructions on administration, data loading and modeling, and integration with other SAP solutions, to more conceptual projects to help build out new solutions using mobile applications or predictive analysis.
For the full library, see SAP HANA Academy Library – by the SAP HANA Academy.
For the full list of blogs, see Blog Posts – by the SAP HANA Academy.