Thursday, February 28, 2013

Oracle How to found current running SQL

SELECT osuser, username, sql_text
from v$session a, v$sqltext b
where a.sql_address =b.address
order by address, piece;

select sid,user_name,sql_text
from v$open_cursor
where sid in (select sid from (select sid,serial#,username,program
from v$session
where status='ACTIVE'));

select s.USERNAME, sq.SQL_TEXT, s.LAST_CALL_ET
from v$open_cursor oc, v$sql sq, v$session s
where oc.HASH_VALUE = sq.HASH_VALUE
and s.SID = oc.SID
and s.STATUS = 'ACTIVE';

3 comments:

  1. I was very pleased to discover this web-site.I wanted to thanks for your time for this fantastic read!! I unquestionably enjoying every little bit of it and I've you bookmarked to check out new stuff you weblog post.

    ReplyDelete
  2. obviously like your website but you have to test the spelling on several of your posts. A number of them are rife with spelling problems and I in finding it very bothersome to inform the reality however I will definitely come again again.

    ReplyDelete
  3. 5...

    This article is really dulcet, people do not consciously into the author's writing situations. I want to put forward it to more people, so the more the body will be such a splendid feeling....

    ReplyDelete