Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

View For Current Statement and Session Id

Posted on 2007-11-16
4
Medium Priority
?
1,339 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 100 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

I originally wrote this article to compare SARDU and YUMI, but have now added Easy2Boot, since that is the one I currently use and find the easiest to create and alter.
The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

661 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