How to Find User Historical Query Statements in HANA Database

The command below is to find the specific user historical query statements in the SAP HANA database. You can replace the ‘USERNAME’ to your required user-id.

select statement_string, last_execution_timestamp 
from SYS.M_SQL_PLAN_CACHE where 
user_name = 'USERNAME' order by 
last_execution_timestamp desc;

Example on the output result,

You May Also Like

1 Comment

Leave a Reply?