Suppose I have a query in my database taking a large mount of memory. Of course I can identify the Unix process ID using ps -ef. It is possible to identify the Oracle user, too.
But, how can I see exactly what that query is doing in a given moment (not Logminer)? Is there a v$ view or something? I know tools like Toad/SQL Navigator have this feature, but don't know how to do with a command line. Any ideas?
thanks in advance.
You can use v$session
select username,schemaname,osuser,machine from v$session;
Or best use the GUI Instance manager in DBA studio
V$SESSION would give me info about the user accessing the database, and not about WHAT he is doing in the database at that moment, right?
I was thinking in something like Logminer, creating a table with single commands extracted from redo logs. The problems are that single queries (SQL, not DML/DDL) are not written in redo logs, and I need answer in real-time.
Does that v$ view exist?
select a.username, a.terminal, a.program, b.sql_text
from v$session a, v$sqlarea b, v$process c
where c.spid = 'your unix process' OR a.process = 'your unix process' )
and a.paddr = c.addr
and a.sql_address = b.address
first, are you useing multy thred? if so then your os process tells you about many db process, not just the one you are looking at.
Click Here to Expand Forum to Full Width