How to Use the Client Interfaces with SAP HANA Platform
There are some differences when using the client interfaces with SAP HANA Platform.
The examples below use ODBC connection strings, but the principle of specifying the server address and the database name applies to all SAP HANA client interfaces. For complete ODBC connection strings, you must add the <driver> or <DSN> connection parameters to the example connections on this page.
For the SAP HANA Platform, server ports are configured as follows:
- For the system database (SYSTEMDB), the port takes the following form: 3<instance-number>13. For example, 30013 (if the instance is 00). Additionally, specify the connection property databaseName to be automatically redirected to a specific database tenant running on the SAP HANA system.
- If you install a new system, you automatically get one tenant, unless you install an empty system. The port for the automatically created first tenant typically takes the following form: 3<instance-number>15. For example, 30115 (if the instance is 01).
- Additional tenants in the same system are on different ports. The second tenant is usually assigned to port 3<instance-number>41. Each additional tenant gets a new three-port range (three ports are used internally by each tenant, only one of these is available for client connections). For example, the port after 3<instance-number>41 is 3<instance-number>44.
- If you are connecting to an SAP HANA system that is version 2.0 SPS 00 or earlier that is a single-container system, then there is no SYSTEMDB and the port of the single database is 3<instance-number>15. For example, 32015 (if the instance is 20). In this case, the <databaseName> parameter should not be used.
If your SAP HANA Platform system is a multi-node system or contains a standby node, then you can specify multiple comma-separated addresses for the server location. For example:
serverNode=myServer:30013,myServerStandby:30013
Connecting to SAP HANA Servers
When connecting to SAP HANA, you must specify the server's address, including its port. You always connect to a database when connecting to a server.
The server's address is a TCP/IP address (a hostname or IP address) and a port and is often specified with the serverNode connection parameter, but this can vary between client interfaces. IPv4 and IPv6 addresses are supported. For example: "serverNode=192.0.2.104:30013" or "serverNode=[2001:db8::1a2b]:32013".
Connecting to the System Database (SYSTEMDB)
For system administration and monitoring tasks, connect to the SQL port of the system database (SYSTEMDB). For example, for instance 00, specify the following connection string:
serverNode=myserver:30013;UID=SYSTEM;PWD=systemPassword1;databaseName=SYSTEMDB
In this case, the databaseName parameter is optional.
Connecting to the Specified Database
To connect to a specified database, you can connect by specifying the port for SYSTEMDB and the databaseName. This is recommended over specifying the specific port for the database. For example:
serverNode=myserver:30013;UID=DB1USER;PWD=myPassword1;databaseName=DB1
Connecting to a Database at a Specific Port
To connect to a database at a specific port, the databaseName parameter is not required. For example:
serverNode=myserver:30013;UID=SYSTEM;PWD=systemPassword1
If the databaseName parameter is specified, then the client ensures that the database connected to matches databaseName.