select a.sql_text,
b.etime,
c.user_id,
to_char(c.SAMPLE_TIME,'yyyy-MM-dd hh:mi:ss'),
c.INSTANCE_NUMBER,
u.username
from dba_hist_sqltext a,
(select sql_id, ELAPSED_TIME_DELTA / 1000000 as etime
from dba_hist_sqlstat
where ELAPSED_TIME_DELTA / 1000000 >= 10) b,
dba_hist_active_sess_history c,
dba_users u
where a.sql_id = b.sql_id
and b.sql_id = c.sql_id
and c.user_id = u.user_id
and c.SAMPLE_TIME>sysdate-1
order by etime desc
b.etime,
c.user_id,
to_char(c.SAMPLE_TIME,'yyyy-MM-dd hh:mi:ss'),
c.INSTANCE_NUMBER,
u.username
from dba_hist_sqltext a,
(select sql_id, ELAPSED_TIME_DELTA / 1000000 as etime
from dba_hist_sqlstat
where ELAPSED_TIME_DELTA / 1000000 >= 10) b,
dba_hist_active_sess_history c,
dba_users u
where a.sql_id = b.sql_id
and b.sql_id = c.sql_id
and c.user_id = u.user_id
and c.SAMPLE_TIME>sysdate-1
order by etime desc