hdbuserstore for MDC and tenant databases


You are using SAP HANA multitenant database containers and you have set up a distributed system with at least one standby node. There are several tenant databases in your system running on different hosts but using the same port numbers. You are using hdbuserstore to connect to your tenant databases. After a successful failover your clients try to connect to the wrong tenant database.


Other Terms

MDC, Multi Tenancy, HANA, Multiple Databases, Tenant, Standby, Failover, hdbuserstore


Reason and Prerequisites

In order for clients to reconnect automatically after a failover to one of the standby nodes, hdbuserstore can be configured with a list of hosts to connect to. Assuming you have three hosts (host1, host2, host3) and two tenant databases DB1 and DB2. If host3 is the designated standby host, you could configure hdbuserstore like this:

# hdbuserstore SET DB1 host1:30040;host3:30040 <user> <password>
# hdbuserstore SET DB2 host2:30040;host3:30040 <user> <password>

In case host1 fails over to host3, clients trying to connect to DB2 could accidentally connect to DB1 because both tenant database share the same port number.



It is recommended to use distinct port numbers for each tenant database even if they run on different hosts to avoid automatic reconnect problems in case of a failover. You can explicitly set the port when you create a new tenant database or add new services to an existing tenant database:

ALTER DATABASE DB1 ADD ‘xsengine’ AT LOCATION ‘host1:30043’

You can then configure hdbuserstore in the following way:

# hdbuserstore SET DB1 host1:30040;host3:30040 <user> <password>
# hdbuserstore SET DB2 host2:30046;host3:30046 <user> <password>

also see hdbuserstore in hana



Leave a Reply