SELECT distinct a.sql_id, a.blocking_session,a.blocking_session_serial#, a.user_id,s.sql_text,a.module FROM V$ACTIVE_SESSION_HISTORY a, v$sql s where a.sql_id=s.sql_id and blocking_session is not null and a.user_id <> 0 and a.sample_time between to_date('17/06/2011 00:00', 'dd/mm/yyyy hh24:mi') and to_date('17/06/2011 23:50', 'dd/mm/yyyy hh24:mi');