Use SAP HANA HDBSQL to execute SQL commands at OS level

If you want to access SQL prompt using HDBSQL at OS level, then you need to follow below steps and  passwords of the user <SID>ADM and one of the HANA database users’s password.

For our example we will use the user “SAPSR3″ for connecting to HANA database.

First step is logon to the HANA database system with “<SID>ADM” username and then execute the following syntax ;

hdbsql <Database Name> => hdbsql -i 00 -n <SERVERNAME>:30015 -u SAPSR3 -p ‘<PASSWORD>’

Now you should connect to the HANA DB like shown in the following screenshot.

Once you get the command, execute the \s to get the detail system informations of your HANA DB system

Use SAP HANA HDBSQL to execute SQL commands at OS level

If you are going to execute \h, then you can get the list of HDBSQL parameters ;

Use SAP HANA HDBSQL to execute SQL commands at OS level

Now you can try an example SQL command like below to see the output ;

hdbsql <Database Name> => select * from M_INIFILE_CONTENTS where key=’lock_wait_timeout’;

FILE_NAME,LAYER_NAME,TENANT_NAME,HOST,SECTION,KEY,VALUE
“indexserver.ini”,”DEFAULT”,””,””,”transaction”,”lock_wait_timeout”,”1800000″

To exit from the HDBSQL, just type “exit” , “quit” or “\q”

Leave a Reply


+ 4 = eleven

Blogroll