View For Current Statement and Session Id

Which is the view for finding Current Statement for a session id?

thank you.
el33tAsked:
Who is Participating?
 
bobbymanochaConnect With a Mentor Commented:
Join v$sql to v$session on sql_id, and filter for the session id

select sql_fulltext from v$session s, v$sql q where s.sql_id = q.sql_id and s.sid = <your session id>
0
 
el33tAuthor Commented:
In toad session browser for a given session id it displays current statement...but nothing expected i get from the above posted query except the query itself..i had tried the same with v$sqlarea before starting this topic.
0
 
bobbymanochaCommented:
If you put in the sid of the session you're interested in, you'll see the SQL statement that session is executing.  For your own session, you'll see the query you just ran, which is the query above.
0
 
el33tAuthor Commented:
for sid i write subquery s.sid in ( select sid from v$session where username = 'my schema name')

no expected results
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.