You can use the hdbuserstore program to securely store connection details on a client machine. Connection details are stored against a key where the key is then used to substitute the connection details. You can then use this key to connect to HANA DB using the hdbsql program.
Login as hxeadm at an OS level or simply change users in a terminal using the su command.
[email protected]# su hxeadm
The SET command for the hdbuserstore program is used to add/update a key. The parameters for this command is listed below.
KEY - Entry key name
ENV - Database location
USERNAME - Database username
PASSWORD - Database password
DATABASE - Database name
Below is an example of storing the the connection details for user JOHN.
[email protected]:/usr/sap/HXE/HDB90> hdbuserstore SET usr1 "127.0.0.1:39013" JOHN Pass123
The example above stores the connection details using the key usr1. You can change the name of this key to anything you want. To update the connection details, simply use the SET command with the same KEY name. To verify the command was successful, execute the LIST command as shown below.
[email protected]:/usr/sap/HXE/HDB90> hdbuserstore list
You can now connect to HANA DB from the hdbsql program using this key.
hdbsql=> \c -U usr1