cancel
Showing results for 
Search instead for 
Did you mean: 

Trace wich application or user is connected to HANA DB

Former Member
0 Kudos

Hi,

I need a query that show me wich application or user is connected to HANA DB.

Can someone help me?

regards Alessandro

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Alessandro,

You may use system table M_CONNECTIONS (select  * from M_CONNECTIONS) to get connection details, also filter with CONNECTION_STATUS column for current connections.

Refer below documentation for more details (Page 504.):

http://help.sap.com/hana/SAP_HANA_SQL_and_System_Views_Reference_en.pdf

Thanks,

Razal

Former Member
0 Kudos

Thanks Mohammed

But i have this pdf and i tryed M_CONNECTIONS view, but it not satisfy what i need.

I need to know how many connection an application  do to db HANA.

On SQL SERVER i used sp_who2 view, where there is program name connected to DB.

do you know How i can retrieve what i need ?

regards, alessandro

lbreddemann
Active Contributor
0 Kudos

Hi Alessandro

not sure where sp_who2 takes the program name from, but this is very likely a windows-MSSQL-odbc-driver trick (looking up the image name from the current process and set it by default in the db connection) or something similar.

For most other DBMS, the client application has to provide this information itself.

While the client process ID is set automatically in M_CONNECTIONS additional information (context variable APPLICATION) needs to be set by the client.

The connections overview in SAP HANA Studio provides the APPLICATION* variables together with the connection information.

- Lars