Home » RDBMS Server » Server Administration » How long a query is executing?
How long a query is executing? [message #220212] Mon, 19 February 2007 09:03 Go to next message
gajini
Messages: 259
Registered: January 2006
Senior Member

Hi,

How can one find how long a query is running?
Is there any table where we can query to get this
information?

Thanks,
Gajini
Re: How long a query is executing? [message #220213 is a reply to message #220212] Mon, 19 February 2007 09:21 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

Hi,
v$session_longops

http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2092.htm

[Updated on: Mon, 19 February 2007 22:45]

Report message to a moderator

Re: How long a query is executing? [message #220236 is a reply to message #220213] Mon, 19 February 2007 14:11 Go to previous message
gintsp
Messages: 118
Registered: February 2007
Senior Member
Actually v$session_longops may contain many long operations for a single query, as well as there may be queries and other operations running for hours and not showing up in v$session_longops. If you'd like to get more info about that (including a bit of description what is showing up and when it is showing up) you can check also my article about v$session_longops at http://www.gplivna.eu/papers/v$session_longops.htm

Rather probably you can try to look in v$session
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2088.htm#sthref3985
These columns looks promising - STATUS, COMMAND and especially LAST_CALL_ET whose description is:
"If the session STATUS is currently ACTIVE, then the value represents the elapsed time in seconds since the session has become active.
If the session STATUS is currently INACTIVE, then the value represents the elapsed time in seconds since the session has become inactive."

Gints Plivna
http://www.gplivna.eu
Previous Topic: question on index
Next Topic: Migration from MSSQL SERVER 2000 to ORACLE 10G
Goto Forum:
  


Current Time: Sat Dec 03 03:50:33 CST 2016

Total time taken to generate the page: 0.10908 seconds