SQL QUERY TO FIND SESSION DETAILS FROM ACTIVE SESSION HISTORY(ASH)

Use this ash query to find the session details in near past which has details about SQL and wait events

set lines 200
set pages 1000
col event format a10
col sample_time format a20
col session_id format 99999999
col session_state format a20
col wait_time format 9999999
col time_waited format 99999999
col child# format 999
select session_id,
sample_time,
session_state,
event,
wait_time,
time_waited,
sql_id,
sql_child_number child#
from v$active_session_history
where sample_time > sysdate - 3
order by sample_time asc;
fetch next 10 rows only;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s