How to use SAP HANA to execute SQL commands at OS level
Mohamed ABDELMOULA
Expert SAP Basis, Performance & HANA | SAP instructor | SAP FIORI | SAP PM |
HDBSQL is a command line tool for executing commands on SAP HANA databases. SAP HANA HDBSQL is also used to automate the HANA Database backups using cron scripts.
Requirement:?You want to access SQL prompt using HDBSQL at OS level.
Prerequisites :?You need password of <SID>ADM user and?User with HANA database access, in our example we are connecting using SYSTEM.
?
You can also log on with user credentials for the secure user store (hdbuserstore) with -U <user_key>. Here is a separate document for?hdbuserstore?configuration.
HDBSQL Examples :
hdbsql?-n localhost -i 00 -u SYSTEM -p Ina123;
hdbsql -S DEV -n localhost:30015 -u SYSTEM -p In123 ;
hdbsql -n localhost -i 00 -u myuser -p myuserpassword “select * from sys.users”;
hdbsql -U myUserSecureStore “Select table_name, schema_name from m_tables” ;