CPU Time (s) | Elapsed Time (s) | Executions | CPU per Exec (s) | % Total | % Total DB Time | SQL Id | SQL Module | SQL Text |
---|---|---|---|---|---|---|---|---|
32,595 | 96,381 | 149,476 | 0.22 | 57.37 | 47.42 | 69vuwhdz0jw51 | JDBC Thin Client | |
1,940 | 5,451 | 190 | 10.21 | 3.41 | 2.68 | 47y171y2nuvy9 | JDBC Thin Client | |
1,232 | 3,816 | 5,717 | 0.22 | 2.17 | 1.88 | 3x365dut1trbz | JDBC Thin Client | |
1,013 | 3,147 | 4,722 | 0.21 | 1.78 | 1.55 | 8vmfr11dt6bb7 | JDBC Thin Client | |
908 | 2,792 | 4,225 | 0.21 | 1.60 | 1.37 | 9kxdmwbytzsbs | JDBC Thin Client | |
848 | 2,139 | 451 | 1.88 | 1.49 | 1.05 | 9zv8ryyqzjudh | JDBC Thin Client | |
564 | 1,651 | 2,530 | 0.22 | 0.99 | 0.81 | bdd9ay1mz8x22 | JDBC Thin Client | |
558 | 1,637 | 2,532 | 0.22 | 0.98 | 0.81 | 1pfxcnwp9ydw9 | JDBC Thin Client | |
556 | 1,633 | 2,532 | 0.22 | 0.98 | 0.80 | dwysa8fbxz8du | JDBC Thin Client | |
500 | 1,496 | 2,288 | 0.22 | 0.88 | 0.74 | 57jgy744z6rq3 | JDBC Thin Client |
select a.SQL_ID,c.username, CPU_TIME*0.000001 cpu_time_secs,
ELAPSED_TIME*0.000001 elapsed_time_secs,round(ELAPSED_TIME*0.000001/nvl(nullif(executions,0),1)) Elap_per_Exec,
executions,ROWS_PROCESSED,b.piece line#,b.sql_text
from v$sql a, v$sqltext b,dba_users c
where
a.address=b.address
and
(
ELAPSED_TIME*0.000001>10
or executions > 1000
)
and executions>0
and c.user_id=a.PARSING_USER_ID
order by CPU_TIME,a.HASH_VALUE, b.piece asc
select c.username,CPU_TIME*0.000001 cpu_time_secs,
ELAPSED_TIME*0.000001 elapsed_time_secs,
round(ELAPSED_TIME*0.000001/nvl(nullif(executions,0),1)) Elap_per_Exec,
executions,LAST_LOAD_TIME,
b.piece line#,
b.sql_text sql_text
from v$sql a, v$sqltext b, dba_users c
where
a.address=b.address
and
(
ELAPSED_TIME*0.000001>10
or executions > 1000
)
and executions>0
and c.user_id=a.PARSING_USER_ID
order by Elap_per_Exec,ELAPSED_TIME,CPU_TIME,a.HASH_VALUE, b.piece asc;
Create resource limit to limit SQLs which run more than 5 minutes.
alter system set resource_limit =true scope=both; (Oracle restart required to take effect)
create profile cpu_limit_3_min limit cpu_per_call 30000; (time is in 100ths of a second)
alter user XXXX profile cpu_limit_5_min; (change the user to use the profile)