Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: current query being executed

Re: current query being executed

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/07/14
Message-ID: <963643926.7966.0.pluto.d4ee154e@news.demon.nl>#1/1

"Lisa Spielman" <lisa.spielman_at_compaq.com> wrote in message news:8kns45$5cj$1_at_mailint03.im.hou.compaq.com...
> Is there any way to see what the current query being executed is?
>
> We have a process that keeps on getting hung and would like to
> see what query it is processing.
>
> ( In Informix you can do an onstat -g -sql <session id of process >
> and it will show the sql statement )
>
> thanks, Lisa
>
>

sure there is.
If you are capable of isolating the session, you can also isolate the sql. An generic query for session info is
select sid, serial#, program, terminal
from v$session
where type = 'USER'

The v$session table also contains a column called sql_address and sql_hash_value.
Those consitute the relationship
with v$sqlarea
and also with v$sqltext_with_newlines.
I currently don't have a working query at hand, but I guess you now have sufficient info to figure out the rest yourself. If not, mail me, and I will dig it up for you.

Hth,

Sybrand Bakker, Oracle DBA Received on Fri Jul 14 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US