Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

View For Current Statement and Session Id

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
Steps to fix “Unable to mount database. (hr=0x80004005, ec=1108)”.
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.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

963 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