Converting Single
DB to Multi Tenant
Database
Purpose/Benefit :
You can run multiple tenant databases on one
SAP Hana System while still having only one
software version for a SAP HANA system.
Some advantages are:
Strong separation of data and users.
Backup and restore available by tenant
database.
Resource management by tenant (cpu,
memory)
Options Available
1. Start from scratch with a new SPS09 installation,
during the installation you get the option to install
a single container or a multi container database
node
Options Available
2. Convert an existing single server to a multi
tenant database, please not that the change is
permanent and cannot be reversed.
Prerequisites :
SPS 9 and above
Statistics Server should be migrated to
Nameserver.
Steps to Convert :
1. Stop HANA database
HDB stop
Steps to Convert :
2. Execute below command
Hdbnsutil convertToMultiDB
Steps to Convert :
This action executes the following steps:
1. Set multidb mode flag in the configuration
2. Create the system and tenant database
3. Updates the secure store in the file (SSFS) system.
The newly created database maintains the original data
and has the original port configuration, the initial "HDB
start" command only starts the system database
though. Therefore it shows that you can start the
tenant database by an SQL statement, after you do
this it will automatically start when using the "HDB
start" command in the future.
Steps to Convert :
This action executes the following steps:
1. Set multidb mode flag in the configuration
2. Create the system and tenant database
3. Updates the secure store in the file (SSFS) system.
The newly created database maintains the original data
and has the original port configuration, the initial "HDB
start" command only starts the system database
though. Therefore it shows that you can start the
tenant database by an SQL statement, after you do
this it will automatically start when using the "HDB
start" command in the future.
TroubleShooting
When you try to connect with hdbsql to this new
SystemDB database it will fail with the error:
* 10: invalid username or password SQLSTATE: 28000
Reason : This is because you need to reset the
password of the SYSTEM user for the SystemDB
database.
Solution : Make sure database is stopped or stop using
command HDB stop.
Then reset the system password of the user SYSTEM
with the command hdbnameserver
-resetUserSystem.
Troubleshooting
Now connect to the database with the hdbsql
command hdbsql -i <instance number> -n
<hostname>:3xx13 -d SystemDB -u SYSTEM
after which the system will ask you for a
password.
Now you have to start the tenant database with the
SQL command ALTER SYSTEM START DATABASE
<SID>.
But when you do this, the system will complain that
the user is forced to change its password:
* 414: user is forced to change password: alter
password required for user SYSTEM SQLSTATE:
HY000
To solve this run the SQL command
ALTER USER SYSTEM PASSWORD <new_password>.
After doing this you can exit the hdbsql
command and check if the tenant database is
running with the sapcontrol -nr <instance>
-function GetProcessList command, it should
now show an additional XS engine and index
server instance e.g. indexserver-TST and
xsengine-TST, where our SID is TST.
How to Add tenant DB to HANA
Studio
To Add Multi Tenant Database to HANA studio,
follow below steps.
1. Select Add New system
How to Add tenant DB to HANA
Studio
2. Select Add New system
How to Add tenant DB to HANA
Studio
3. Enter Username and Password
How to Add tenant DB to HANA
Studio
4. Tenant Database is shown separately.