Solved

View For Current Statement and Session Id

Posted on 2007-11-16
4
1,338 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This video shows how to recover a database from a user managed backup
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

617 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