cancel
Showing results for 
Search instead for 
Did you mean: 

SQL statement history for particular user in HANA

former_member201054
Contributor
0 Kudos

Hi Experts,

How to find out the executed SQL statements of a particular user in HANA 2.0 SP05.

Can it be found in standard SQL statements?..date and timewise.

Please share the query.

Thanks in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

Cocquerel
Active Contributor
0 Kudos

you can activate SQL trace on specific user, see 2119087 - How-To: Configuring SAP HANA Traces

david_j_hays
Explorer
0 Kudos

It really depends a lot on what you need, - Here's a starting point - the following will give you the statement history from the plan cache:

SELECT last_execution_timestamp, statement_string,execution_count,avg_execution_time FROM "SYS"."M_SQL_PLAN_STATISTICS" where user_name = 'username-goes-here' order by last_execution_timestamp desc;

If you want a deeper history, you probably have to enable some level of auditing if you have not already.

david_j_hays
Explorer
0 Kudos

I should have added, take a good look at the m_sql_plan_statistics view, there is a lot of good information in there about the execution and performance of statements.

-dave

former_member201054
Contributor
0 Kudos

It does not work properly

former_member201054
Contributor
0 Kudos

I does not bring any results though its successfull execution.