Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004

    Unanswered: Current Executing SQL

    Is there a way to see the current executing SQL or the last executed SQL?

  2. #2
    Join Date
    Jun 2004
    Provided Answers: 1
    SQL Trace will help you, but only after the code has executed.

    The only way to watch it as it runs that I know about is by using OEM - you can view the SQL that is running for any user.

    I'm sure there must be another way - anyone know?
    90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.

  3. #3
    Join Date
    Mar 2002
    Reading, UK
    this will give you active sqls and the last executed sql (and when it ran).


    select logon_time, last_call_et "time inactive",nvl(s.username, 'ORACLE PROCESS') username, s.machine, s.program, disk_reads, buffer_gets, rows_processed,
    s.sid session_id, s.status,
    sql_text, ss.value "CPU used",
    trunc(buffer_gets/(executions+1)) "BUFF-EXEC", trunc(buffer_gets/(rows_processed+1)) "BUFF-ROWS",first_load_time, executions, parse_calls
    from v$session s,
    v$sesstat ss,
    v$statname sn,
    v$sqlarea sa
    where s.sid = ss.sid and
    ss.statistic# = sn.statistic# and = 'CPU used by this session' and
    s.sql_address = sa.address and
    s.sql_hash_value = sa.hash_value --and username like 'TEST'--and lower(sql_text) like '%translation%'
    --and last_call_et > 10000
    order by machine, status, program, last_call_et asc;

Posting Permissions

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