Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (6.1k points)

I am having an SAP HANA DB instance, and I am running various queries on this. I need to extract the query history, from a system table or elsewhere. Kindly tell me how can I do this?

1 Answer

0 votes
by (11.7k points)

By activating the HANA SQL trace, you can get full information about the past executed queries. If you want to read more about this, check out this documentation. Yes, it will not work retrospectively. Therefore, you need to activate the trace first and then run the queries you want.

Moreover, the SQL Plan Cache gives aggregated information about old queries. It is aggregated by the already prepared statements and gives runtime information like average execution time and result size. The monitoring view for this looks like SYS.M_SQL_PLAN_CACHE.

If you want to get more insights into SQL, check out this SQL Course from Intellipaat.

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...