четверг, 7 сентября 2017 г.

Oracle SQL scripts for checking

SQL request 15 min

select a.user_id, d.username, s.sql_text, sum(a.wait_time + a.time_waited) total_wait_time from v$active_session_history a, v$sqlarea s, dba_users d where a.sample_time between sysdate-30/2880 and sysdate and a.sql_id = s.sql_id and a.user_id = d.user_id group by a.user_id, s.sql_text, d.username order by total_wait_time desc;


Object for 15 min

select o.owner, o.object_name, o.object_type, a.event, sum(a.wait_time + a.time_waited) total_wait_time from v$active_session_history a, dba_objects o where a.sample_time between sysdate-30/2880 and sysdate and a.current_obj# = o.object_id group by o.owner, o.object_name, o.object_type, a.event order by total_wait_time desc;





Комментариев нет:

Отправить комментарий