on 12-17-2012 4:20 PM
Hi folks,
In the System Information tab of default administration screen there is a 'connections' table I find very useful where I can see currently running SQL statements against the HANA db and the user that is executing the statement. My question; is there a place where I can see historical SQL statements? ie: a statement that ran to completion an hour ago?
Thanks,
-Patrick
Hey Patrick,
well, "historic" SQL statements would be really nice.
We're not just there yet.
Meanwhile, we do have a one-hour window, that allows us to see the statements of the past 60 minutes.
Check the
[Adminstration Perspective] -> [Performance] -> [SQL Plan Cache]
table to access these information.
Alternatively you could simply query the m_sql_plan_cache system view to read the same data via SQL.
Another option is to turn on the "expensive statement trace" - this doesn't age out and also collects some useful information about long running statements.
Cheers,
Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lars I just figured out that the SQL Plan Cache tab in the performance monitoring is the same exact table as the m_sql_plan_cache. And I did find a 'last executed' timestamp which is exactly what i need. Strangely however, I can run SQL statement to view m_sql_plan_cache however it does not display from my performance monitoring/SQL Plan Cache tab. That method is blank everytime in production. But alas the SQL statement is all I need but it is strange behavior.
Patrick,
this is not about an authorization, but whether the collection of SQL has been activated or not.
In the very same screen/window/information area (whatever you want to call this part of the screen where you usually find the shared cursor information) there is a little, tiny, small and well hidden little icon on the right side (something with a gear wheel).
Click on this and a dialogue window occurs - just to present you with one (= 1 !) checkbox (don't guess how I like this UI design...) to activate the collection of the shared cursor statistics.
Click this on and you should see the data as soon as you run some SQL
And sure enough, all your applications and SQL queries will suffer the worst performance ever, simply because you ticket this on *hahahahahaha*.
(just kiddin'!)
cheers,
Lars
Lars thanks for the tip. I didn't know you were such a funny guy! Perhaps I shall call you fungi. haha. By the way I decided to just write a simple SQL to order the SQL Plan Cache by Last Execution time and it's great, I can see most recent SQL now (although the first few lines always seem to be system user which I disregard - guess I could filter that out of my query if I wanted);
select * from M_SQL_PLAN_CACHE ORDER BY LAST_EXECUTION_TIMESTAMP DESC
Thanks for leading me to the information I was looking for.
The pencil is dimmed out, because the user account you're using the Administration perspective with doesn't have the ADMIN INIFILE system privilege.
The setting for collecting the SQL plan cache statistics is handled by the indexserver.ini parameter file:
Name | Default
indexserver.ini |
sql |
plan_cache_statistics_enabled | true
plan_cache_size | 268435456
plan_cache_enabled | True
Cheers,
Lars
In my dev box under SQL Plan Cache tab I see visible rows 2208/2208 and the pencil is dimmed out.
In my prod box under SQL Plan Cache tab I see zero rows and the pencil is dimmed out.
I do not have ADMIN INIFILE system privilege in either system. Yet in dev I can see entries and prod I do not. Yet interestingly I can simply write SQL to see the cache in production so it's not a hindrance.
-Patrick
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.