Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extracting query-history in SAP HANA

Tags:

sql

hana

I have been using SAP HANA db instance, and have been running several queries on this. I need to extract the query-history, preferably from a system-table or elsewhere. Please let me know if this is possible and any pointers to achieve it, if possible.

like image 835
Nishanth Reddy Avatar asked Mar 17 '23 15:03

Nishanth Reddy


1 Answers

If you want a detailed history of executed queries, you need to activate the HANA SQL trace. You can find more information in the HANA documentation. Of course, this will not work retrospectively. So you will have to activate the trace first and then run the queries that you want to look at.

Additionally, the SQL Plan Cache provides aggregated information about past queries. It is aggregated by the prepared statements and provides runtime information like average execution time and result size. The monitoring view for this is SYS.M_SQL_PLAN_CACHE.

like image 161
Timo D Avatar answered Mar 20 '23 16:03

Timo D