cancel
Showing results for 
Search instead for 
Did you mean: 

hdbsql to run without password on the command prompt no hdbuserstore

Former Member
0 Kudos

Hi Folks,

This might be a strange requirement,

hdbsql -i 01 -u system
Password:

Welcome to the SAP HANA Database interactive terminal.

Type:  \h for help with commands
       \q to quit

If i run like this then password is invisible,

But if i run like this i dont get prompted for a password screen where i can enter

hdbsql -i 01 -u system -I temp.sql

* -10709: Connection failed (RTE: Kerberos error. Major: "unspecified ", minor: "No credentials cache found"

I dont want to use it like this :  hdbsql -i 02 -u system -I temp.sql -p *******

Also i dont want to use the existing hdbsuserstore key.

Is there a way to achieve this?

Message was edited by: Tom Flanagan

Accepted Solutions (0)

Answers (1)

Answers (1)

tomas-krojzl
Active Contributor
0 Kudos

Hello,

this depends on what you want to achieve - do you want to run one time manually from command line set of SQL scripts from file? if yes then you can use following approach:

sidadm@hanahost:/usr/sap/SID/HDB10> hdbsql

Welcome to the SAP HANA Database interactive terminal.

                                         

Type:  \h for help with commands         

       \q to quit                        

hdbsql=> \c -i 10 -d SYSTEMDB -u SYSTEM

Password:

Connected to SID@hanahost:31013

hdbsql SYSTEMDB=> \i temp.sql

OBJECT_CATEGORY,SCHEMA_NAME,OBJECT_NAME,OBJECT_TYPE,OBJECT_OID

0 rows selected (overall time 168.104 msec; server time 21.650 msec)

if you want to use script to call this on regular basis then you should define new user store entry or use existing one and then use -U parameter

sidadm@hanahost:/usr/sap/SID/HDB10> hdbsql -i 10 -d SYSTEMDB -U HDBUSER -I FILE.EXT

Tomas

Former Member
0 Kudos

Tomas,

Guten Tag!

is there no way to achieve using this : hdbsql -i 01 -u system -I temp.sql

everytime do i need to go into hdbsql and then connect?

I dont want to use hdbuserstore key at the moment since there is a risk if my key is added anybody logging as sidadm user can use the key and login into the database.

I want to hide the password using this : hdbsql -i 01 -u system -I temp.sql

will it be possible ?

tomas-krojzl
Active Contributor
0 Kudos

Hello,

if you really need to compress into one command you can do following:

hdbsql -i 10 -d SYSTEMDB -u SYSTEM "\i temp.sql"

Tomas

lbreddemann
Active Contributor
0 Kudos

The problem here is that you seem to be sharing a O/S user account.

The hdbuserstore information are saved in an encrypted file in your O/S user home directory.

To protect the logon data from being used by someone else, simply don't share the same O/S user account then.

Providing the logon data in the command line and/or storing it in a .sql file are really bad ideas security wise.

- Lars