Identifying query Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Identifying query

  1. #1
    Join Date
    Feb 2001
    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.

  2. #2
    Join Date
    Mar 2001

    You can use v$session

    select username,schemaname,osuser,machine from v$session;

    Or best use the GUI Instance manager in DBA studio


  3. #3
    Join Date
    Feb 2001
    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?

  4. #4
    Join Date
    Nov 2000
    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
    Jeff Hunter
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  5. #5
    Join Date
    Jul 2000

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width