Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Query capture
select sql=5Ftext, elapsed=5Ftime/1000000/executions
from v$sql
where executions>0
and (elapsed=5Ftime/1000000/executions) > 5 (and 10, and 20, etc)
/
You can probably do it fancier. The 1000000 is for 9i+, as elapsed=5Fti= me is in microseconds. I believe it's centisconds in previous releases = but am not positive. I'm also not sure whether any issues exist with th= e accounting in V$SQL, but I'm pretty sure that the execution and elapse=d=5Ftime columns won't be "good" until the active calls complete.
> Hi,
>=20
>=20> 2)SQLs that take more than 10 seconds
> 1)SQLs that take more than 5 seconds
>=20
>=20 >=20
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Apr 07 2005 - 11:18:39 CDT
![]() |
![]() |