cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to execute HDBSQL through shell script

rohit_chowdhury17
Participant
0 Kudos

Hello All,

I have setup an instance of HANA trial on AWS.I am trying to execute a sql script through HDBSQL tool . I need to schedule the process hence I have used an shell script.

The issue is I am able to execute the sql script only by HDBSQL tool , but not through shell script.

Sql Script :-

select * from SFLIGHT.SAPLANE

Command in HDBSQL:-

hdbadm@sid-hdb:/usr/sap/HDB/HDB00/exe/hdbsql -n <ip> -i 00 -u system –p <password> -I /usr/sap/HDB/HDB00/test_folder/query_export.sql

Command in shell script:- /usr/sap/HDB/HDB00/exe/hdbsql -n <ip> -i 00 -u system –p <password> -I /usr/sap/HDB/HDB00/test_folder/query_export.sql

Calling the shell script as :-

/usr/bin /.test_shell_script.sh

Response on executing above sh script :-

Prompt gets in HDBSQL tool

Password prompt : Welcome to the SAP HANA Database interactive terminal. Type: \h for help with commands \q to quit

Another observation is when ever I try to enter the HDBSQL using the command

/usr/sap/HDB/HDB00/exe/hdbsql -n <ip> -i 00 -u system –p <password>

I always get prompt to enter the password . It never accepts the password parameter.

If this is resolved I believe the above issue can also be resolved. I was trying to use hdbstore to remove the password and other cred from the code but I was unable to to do in trail version .

Can you please help me resolve the issue ,

Environment details :-

HANA details :-SAP HANA, developer edition 1.0 SPS 12

OS details:- login as: root Authenticating with public key "imported-openssh-key" Passphrase for key "imported-openssh-key": Last login: Mon Jan 15 18:27:22 2018 from xx:xx:xx:xx SUSE Linux Enterprise Server 12 SP1 x86_64 (64-bit) - Configured for SAP Cloud Appliance Library (SAPCAL) As "root" (sudo or sudo -i) use the: - zypper command for package management - yast command for configuration management Management and Config: https://www.suse.com/suse-in-the-cloud-basics Documentation: http://www.suse.com/documentation/sles11/ Forum: https://forums.suse.com/forumdisplay.php?93-SUSE-Public-Cloud

Connecting through putty

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

rohit_chowdhury17
Participant
0 Kudos

Issue resolved . Syntax was incorrect

Correct syntax Command in shell script:- /usr/sap/HDB/HDB00/exe/hdbsql -n <ip> -i 00 -u system -p <password> -I /usr/sap/HDB/HDB00/test_folder/query_export.sql