RE: Elapsed time of active running query

  • From: Hemant K Chitale <hkchital@xxxxxxxxxxxxxx>
  • To: mschmitt@xxxxxxxxxxxx, "'breitliw@xxxxxxxxxxxxx'" <breitliw@xxxxxxxxxxxxx>
  • Date: Sun, 02 Nov 2008 16:03:50 +0800


The STATUS for the session is INACTIVE . That would mean that the query completed executing -- what you seem to think as the "query is still running" would be that the results are still being sent to to the SQLPlus client. If you query V$SESSION_WAIT you would see 'SQL*Net message to client' and 'SQL*Net message from client' waits for every batch (arraysize) of rows being sent.

Hemant K Chitale
http://hemantoracledba.blogspot.com


At 01:24 AM Saturday, Michael Schmitt wrote:
Hi Wolfgang,

That is what I expected from the documentation as well. However, that is not what I am seeing. The following is what I see in the database when I have the system user run "select * from <large_table>". The LAST_CALL_ET seems to be getting constantly reset and I only catch the STATUS as 'INACTIVE' when I know the session is still doing work. The query is still running when I received the following results, so I would expect the status to show 'ACTIVE' and the LAST_CALL_ET to increase. I randomly catch the LAST_CALL_ET sneak up a few seconds, but then it still drops down to 0 while the query is running. Once the query is actually completes, then the LAST_CALL_ET starts counting time as I would expect for an inactive session.

Any ideas?


select USERNAME,LAST_CALL_ET,COMMAND,STATUS,SQL_ID from v$session where username='SYSTEM'

USERNAME                       LAST_CALL_ET    COMMAND STATUS   SQL_ID
------------------------------ ------------ ---------- -------- -------------
SYSTEM                                    0          3 INACTIVE apjk5mm7mshmx

SQL> /

USERNAME                       LAST_CALL_ET    COMMAND STATUS   SQL_ID
------------------------------ ------------ ---------- -------- -------------
SYSTEM                                    0          3 INACTIVE apjk5mm7mshmx

SQL> /

USERNAME                       LAST_CALL_ET    COMMAND STATUS   SQL_ID
------------------------------ ------------ ---------- -------- -------------
SYSTEM                                    0          3 INACTIVE apjk5mm7mshmx







--
//www.freelists.org/webpage/oracle-l


Other related posts: