1.登录:
window操作系统下面:
打开C:\Program Files\SAP\hdbclient\hdbsql.exe
\c 连接数据库 connect的缩写
HANA hostname: hanasvr-10
HANA system number: 00
Your user-id: P1526659201
Your password: Phucga3V
\c[onnect] -i <instance number> 实例号 00
-n <host>[:<port>] 主机名 端口可选 hanasvr
-u <user_name> 用户名 P1526659201
-p <password> 密码 Phucga3V
-U <user_store_key> 用户根据username password存储的Key 可选
connecting to the database
输入: \c -i 00 -n hanasvr-10 -u P1526659201 -p Phucga3V
linux下:
方法一用用户名/密码:
hdbsql [<options>] -n <database_host> -i <instance_id> -u <database_user> -p <database_user_password>
如:hdbsql -n PARMA -i 1 -u MONA –p RED database_host:PARMA instance_id:1 database_user:MONA database_user_password:RED
方法二用user key:
hdbsql [<options>] -U <user_key>
2.退出hdbsql
exit | quit | \q
3.hdbsql执行一条查询语句:
hdbsql -n localhost -i 1 -u MONA,RED "select table_name, table_type from tables"
4.备份数据库。
hdbsql -U BACKUP "BACKUP DATA USING FILE ('MONDAY')"
命令 描述
\?
\h[elp] Displays all HDBSQL commands
\a[utocommit] [ON|OFF Switches AUTOCOMMIT mode on or off
\al[ign] [ON|OFF] Switches formatted output of the results of SQL statements on or off
\es[cape] [ON|OFF] Switches the escape output format on or off.
\c[onnect] Logs a user onto the database.
\dc [PATTERN] Lists all table columns that correspond to the PATTERN. HDBSQL lists only those tables to which the current user has access.
\de [PATTERN] Lists all the indexes of database objects that correspond to the PATTERN