Select
a.SQL_TEXT,
a.SQL_ID,
a.sql_fulltext,
a.cpu_time,
a.executions,
((a.cpu_time / a.executions) / 100000),
b.sid,
a.BUFFER_GETS, b.SID,b.SERIAL#,b.PADDR,b.SERVER,b.MACHINE, b.USERNAME
From v$sql a, v$session b
Where executions > 0
And b.status = 'ACTIVE'
And a.hash_value = b.sql_hash_value
and a.SQL_ID = b.SQL_ID
--and b.USERNAME = 'DB_ZGXT'
and ((cpu_time / executions) / 100000 >=3)
Order By (cpu_time / executions) desc,
a.BUFFER_GETS Desc,
a.EXECUTIONS desc,
a.sql_id;
a.SQL_TEXT,
a.SQL_ID,
a.sql_fulltext,
a.cpu_time,
a.executions,
((a.cpu_time / a.executions) / 100000),
b.sid,
a.BUFFER_GETS, b.SID,b.SERIAL#,b.PADDR,b.SERVER,b.MACHINE, b.USERNAME
From v$sql a, v$session b
Where executions > 0
And b.status = 'ACTIVE'
And a.hash_value = b.sql_hash_value
and a.SQL_ID = b.SQL_ID
--and b.USERNAME = 'DB_ZGXT'
and ((cpu_time / executions) / 100000 >=3)
Order By (cpu_time / executions) desc,
a.BUFFER_GETS Desc,
a.EXECUTIONS desc,
a.sql_id;