Solved

View For Current Statement and Session Id

Posted on 2007-11-16
4
1,337 Views
Last Modified: 2012-08-14
Which is the view for finding Current Statement for a session id?

thank you.
0
Comment
Question by:el33t
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
bobbymanocha earned 50 total points
ID: 20297665
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
 

Author Comment

by:el33t
ID: 20297772
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
 
LVL 1

Expert Comment

by:bobbymanocha
ID: 20298525
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
 

Author Comment

by:el33t
ID: 20303114
for sid i write subquery s.sid in ( select sid from v$session where username = 'my schema name')

no expected results
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This article was originally published on Monitis Blog, you can check it here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sourc…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question