Files
gh-secondsky-sap-skills-ski…/references/command-reference.md
2025-11-30 08:55:22 +08:00

11 KiB

SAP HANA CLI - Complete Command Reference

Source: https://github.com/SAP-samples/hana-developer-cli-tool-example Total Commands: 91


Table of Contents

  1. Database Object Commands
  2. Inspection Commands
  3. Connection Commands
  4. HDI Container Commands
  5. Query & Execution Commands
  6. Mass Operation Commands
  7. Cloud & BTP Commands
  8. User & Role Commands
  9. System Information Commands
  10. Development Commands
  11. Monitoring Commands
  12. Documentation Commands

Database Object Commands

tables

List tables in schema.

hana-cli tables [schema]

Options:

Option Alias Type Default Description
schema s string CURRENT_SCHEMA Target schema
limit l number 200 Max results

UI Alternative: tablesUI

views

List views in schema.

hana-cli views [schema]

procedures

List stored procedures.

hana-cli procedures [schema]

functions / functionsUI

List database functions.

hana-cli functions [schema]

indexes / indexesUI

List database indexes.

hana-cli indexes [schema] [table]

sequences

List sequences.

hana-cli sequences [schema]

synonyms

List synonyms.

hana-cli synonyms [schema]

triggers

List database triggers.

hana-cli triggers [schema]

schemas / schemasUI

List available schemas.

hana-cli schemas

dataTypes / dataTypesUI

Display HANA data type specifications.

hana-cli dataTypes

objects

List all database objects.

hana-cli objects [schema]

libraries

List database libraries.

hana-cli libraries [schema]

Inspection Commands

inspectTable

Inspect table structure with format conversion.

Aliases: it, table, insTbl, inspecttable, inspectable

hana-cli inspectTable [schema] [table]

Options:

Option Alias Type Default Description
table t string required Table name
schema s string CURRENT_SCHEMA Schema name
output o string tbl Output format
useHanaTypes hana boolean false Use HANA types
useQuoted q boolean false Quoted identifiers
useExists exists boolean true Check existence

Output Formats: tbl, sql, sqlite, postgres, cds, json, yaml, cdl, hdbcds, hdbtable, hdbmigrationtable, jsdoc, graphql, edmx, annos, edm, swgr, openapi

UI Alternative: inspectTableUI

inspectView

Inspect view definition.

hana-cli inspectView [schema] [view]

inspectProcedure

Inspect stored procedure.

hana-cli inspectProcedure [schema] [procedure]

inspectFunction

Inspect function definition.

hana-cli inspectFunction [schema] [function]

inspectIndex

Inspect index structure.

hana-cli inspectIndex [schema] [index]

inspectTrigger

Inspect trigger definition.

hana-cli inspectTrigger [schema] [trigger]

inspectUser

Inspect database user.

hana-cli inspectUser [user]

inspectLibrary

Inspect database library.

hana-cli inspectLibrary [schema] [library]

inspectLibMember

Inspect library member.

hana-cli inspectLibMember [schema] [library] [member]

inspectJWT

Inspect and decode JWT token.

hana-cli inspectJWT [token]

Connection Commands

connect

Establish and save database connection.

Aliases: c, login

hana-cli connect [user] [password]

Options:

Option Alias Type Default Description
connection n string - host:port
user u string - Database user
password p string - Password (masked)
userstorekey U string - User store key
save s boolean true Save credentials
encrypt e boolean - Enable SSL
trustStore t string - SSL certificate path

connectViaServiceKey

Connect using BTP service key.

hana-cli connectViaServiceKey

status

Display current connection status.

hana-cli status

certificates

List system certificates.

hana-cli certificates

HDI Container Commands

activateHDI

Enable HDI service for tenant.

hana-cli activateHDI [tenant]

adminHDI

Create/assign HDI admin privileges.

hana-cli adminHDI [user]

adminHDIGroup

Add HDI group administrator.

hana-cli adminHDIGroup [group] [user]

containers

List HDI containers.

Aliases: cont, listContainers

hana-cli containers [containerGroup] [container]

Options:

Option Alias Type Default Description
container c string * Container filter
containerGroup g string * Group filter
limit l number 200 Max results

UI Alternative: containersUI

createContainer

Create new HDI container.

hana-cli createContainer [container] [group]

createContainerUsers

Create container access users.

hana-cli createContainerUsers [container]

dropContainer

Remove HDI container.

hana-cli dropContainer [container]

createGroup

Create container group.

hana-cli createGroup [group]

dropGroup

Remove container group.

hana-cli dropGroup [group]

Query & Execution Commands

querySimple

Execute SQL query with flexible output.

Aliases: qs, querysimple

hana-cli querySimple [query]

Options:

Option Alias Type Default Description
query q string required SQL query
folder f string ./ Output directory
filename n string - Output filename
output o string table Output format
profile p string - Connection profile

Output Formats: table, json, excel, csv

UI Alternative: querySimpleUI

callProcedure

Execute stored procedure.

Aliases: cp, callprocedure, callProc, callSP

hana-cli callProcedure [schema] [procedure]

Options:

Option Alias Type Default Description
procedure p string required Procedure name
schema s string CURRENT_SCHEMA Schema name

hdbsql

Direct SQL execution interface.

hana-cli hdbsql

Mass Operation Commands

massConvert

Batch convert database objects.

Aliases: mc, massconvert, massConv

hana-cli massConvert [schema] [table] [view]

UI Alternative: massConvertUI

massRename

Batch rename operations.

hana-cli massRename [schema]

massUsers

Bulk user operations.

hana-cli massUsers

Cloud & BTP Commands

btp

Configure BTP CLI targeting.

hana-cli btp

btpInfo

Display BTP target details.

hana-cli btpInfo

btpSubs

List BTP subscriptions.

hana-cli btpSubs

hanaCloudInstances

List HANA Cloud instances.

hana-cli hanaCloudInstances

hanaCloudHDIInstances / hanaCloudHDIInstancesUI

List Cloud HDI instances.

hana-cli hanaCloudHDIInstances

hanaCloudSchemaInstances / hanaCloudSchemaInstancesUI

List Cloud schema instances.

hana-cli hanaCloudSchemaInstances

hanaCloudSBSSInstances / hanaCloudSBSSInstancesUI

List Cloud SBSS instances.

hana-cli hanaCloudSBSSInstances

hanaCloudSecureStoreInstances / hanaCloudSecureStoreInstancesUI

List Cloud secure store instances.

hana-cli hanaCloudSecureStoreInstances

hanaCloudUPSInstances / hanaCloudUPSInstancesUI

List Cloud UPS instances.

hana-cli hanaCloudUPSInstances

hanaCloudStart

Start HANA Cloud instance.

hana-cli hanaCloudStart [instance]

hanaCloudStop

Stop HANA Cloud instance.

hana-cli hanaCloudStop [instance]

User & Role Commands

users

List database users.

hana-cli users

roles

List database roles.

hana-cli roles

createXSAAdmin

Create XSA administrator.

hana-cli createXSAAdmin [user]

createJWT

Generate JWT token.

hana-cli createJWT

System Information Commands

systemInfo / systemInfoUI

Display system information.

hana-cli systemInfo

hostInformation

Display host details.

hana-cli hostInformation

version

Display hana-cli version.

hana-cli version

ports

List database ports.

hana-cli ports

disks

Display disk information.

hana-cli disks

dataVolumes

Display data volume information.

hana-cli dataVolumes

iniFiles

List INI configuration files.

hana-cli iniFiles

iniContents

Display INI file contents.

hana-cli iniContents [file]

Development Commands

cds

Convert database objects to CDS format.

hana-cli cds [schema] [object]

createModule

Create development module.

hana-cli createModule

copy2DefaultEnv

Copy credentials to default-env.json.

hana-cli copy2DefaultEnv

copy2Env

Copy credentials to .env file.

hana-cli copy2Env

copy2Secrets

Copy credentials to secrets.

hana-cli copy2Secrets

openDBExplorer

Open HANA Database Explorer.

hana-cli openDBExplorer

openBAS

Open Business Application Studio.

hana-cli openBAS

Monitoring Commands

features / featuresUI

Display database features.

hana-cli features

featureUsage / featureUsageUI

Display feature usage metrics.

hana-cli featureUsage

traces

List trace files.

hana-cli traces

traceContents

Display trace contents.

hana-cli traceContents [trace]

privilegeError

Diagnose privilege errors.

hana-cli privilegeError

reclaim

Reclaim database resources.

hana-cli reclaim

Documentation Commands

changeLog / changeLogUI / openChangeLog

View release changelog.

hana-cli changeLog
hana-cli openChangeLog  # Opens in browser

readMe / readMeUI / openReadMe

View documentation.

hana-cli readMe
hana-cli openReadMe  # Opens in browser

issue

Report issue to GitHub.

hana-cli issue

UI

Open general web UI.

hana-cli UI

Global Options

All commands support:

Option Alias Description
--help -h Display help
--admin - Use admin credentials
--conn - Specify connection file
--profile -p Connection profile

*Reference: https://github.com/SAP-samples/hana-developer-cli-tool-example*