1. 程式人生 > >SAP HANA HDBSQL命令

SAP HANA HDBSQL命令

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