Tuesday, February 7, 2012

Grid SQL Monitoring

In order to store and later analyze the SQLs in SQL Monitor in Enterprise Manager Grid window; you could note using below SQL:

First, create a temporary table in order not to lose the data in gv$ view.

create table my_sql_monitor as select * from gv$sql_monitor;

And later analyze, for instance, find long running session SQLs, whether they ran parallel or not, so on by below SQL.

select distinct sql_id,min(px_servers_requested),min(px_servers_allocated),
min(sql_exec_start),max(elapsed_time),max(concurrency_wait_time),sql_text from  my_sql_monitor where sql_text is not null
group by sql_id,sql_text
order by max(elapsed_time) desc,1 desc;

No comments:

Windows (powershell) counterparts of Linux commands

You may find Windows mostly powershell equivalent of frequently used Linux commands here. I will update this post, with newer ones by the ti...