Skip to Content
0
Sep 24, 2019 at 05:21 PM

How to Query a tenant Database in SAP HANA, it works with ./saphostctrl but now with hdbsql query ?

826 Views

Hello All,

When I try to run from saphostctrl it shows me the list of Databases but not from hdbsql query, Example is below :- Can you suggest me what am I doing wrong here ?

vhcalhdbdb:/usr/sap/hostctrl/exe #./saphostctrl -function ListDatabases

Instance name: HDB02, Hostname: vhcalhdbdb, Vendor: HDB, Type: hdb, Release: 2.00.036.00.1547699771

Database name: SYSTEMDB@HDB, Status: Warning

Component name: sapstartsrv (HDB sapstartsrv), Status: Running (Running)

Component name: hdbdaemon (HDB Daemon), Status: Running (Running)

Component name: hdbcompileserver (HDB Compileserver), Status: Running (Running)

Component name: hdbdiserver (HDB Deployment Infrastructure Server-HDB), Status: Running (Running)

Component name: hdbdocstore (HDB DocStore-HDB), Status: Running (Running)

Component name: hdbdpserver (HDB DPserver-HDB), Status: Running (Running)

Component name: hdbindexserver (HDB Indexserver-HDB), Status: Running (Running)

Component name: hdbnameserver (HDB Nameserver), Status: Running (Running)

Component name: hdbpreprocessor (HDB Preprocessor), Status: Running (Running)

Component name: hdbscriptserver (HDB Scriptserver-HDB), Status: Running (Running)

Component name: hdbwebdispatcher (HDB Web Dispatcher), Status: Running (Running)

Component name: hdbxsengine (HDB XSEngine-HDB), Status: Running (Running)

Component name: hdbMDC (HDB Multi Database Container), Status: Running (System DB)

Component name: hdbconnectivity (HDB Connectivity), Status: Error (SQLconnect not possible (no hdbuserstore entry found))

Component name: hdbalertmanager (HDB Alertmanager), Status: Unknown (no information available)

Component name: hdbstatisticsserver (HDB embedded Statisticsserver), Status: Unknown (no information available)

Database name: HDB@HDB, Status: Warning

Component name: sapstartsrv (HDB sapstartsrv), Status: Running (Running)

Component name: hdbdaemon (HDB Daemon), Status: Running (Running)

Component name: hdbcompileserver (HDB Compileserver), Status: Running (Running)

Component name: hdbdiserver (HDB Deployment Infrastructure Server-HDB), Status: Running (Running)

Component name: hdbdocstore (HDB DocStore-HDB), Status: Running (Running)

Component name: hdbdpserver (HDB DPserver-HDB), Status: Running (Running)

Component name: hdbindexserver (HDB Indexserver-HDB), Status: Running (Running)

Component name: hdbnameserver (HDB Nameserver), Status: Running (Running)

Component name: hdbpreprocessor (HDB Preprocessor), Status: Running (Running)

Component name: hdbscriptserver (HDB Scriptserver-HDB), Status: Running (Running)

Component name: hdbwebdispatcher (HDB Web Dispatcher), Status: Running (Running)

Component name: hdbxsengine (HDB XSEngine-HDB), Status: Running (Running)

Component name: hdbMDC (HDB Multi Database Container), Status: Running (Tenant DB)

Component name: hdbconnectivity (HDB Connectivity), Status: Error (SQLconnect not possible (no hdbuserstore entry found))

Component name: hdbalertmanager (HDB Alertmanager), Status: Unknown (no information available)

Component name: hdbstatisticsserver (HDB embedded Statisticsserver), Status: Unknown (no information available)

vhcalhdbdb:HDB:hdbadm /usr/sap/HDB/HDB02 53> hdbsql -i 02 -u SYSTEM -p Final_123

Welcome to the SAP HANA Database interactive terminal.

Type: \h for help with commands

\q to quit

hdbsql HDB=> select * from "SYS"."M_DATABASES"

1 row selected (overall time 17.484067 sec; server time 331 usec)

hdbsql HDB=>

hdbsql HDB=> select * from "SYS"."M_DATABASE"

1 row selected (overall time 18.216544 sec; server time 345 usec)

Output is :-

DATABASE_NAME,DESCRIPTION,ACTIVE_STATUS,ACTIVE_STATUS_DETAILS,OS_USER,OS_GROUP,RESTART_MODE,FALLBACK_SNAPSHOT_CREATE_TIME

"HDB","HDB-02","YES","","","","DEFAULT",?

lines 1-2/2 (END)