Solved

Oracle session ID

Posted on 2010-08-25
2
682 Views
Last Modified: 2013-12-12
Hey guys how can i find the session id for any particular SQL is running with it. I appreciate your help and time in advance.
0
Comment
Question by:hussainkhan22
[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 Comments
 
LVL 5

Accepted Solution

by:
sindhuxyz earned 500 total points
ID: 33520512
Can u try this:




    select
       sys_context('USERENV','SID')
    from dual;

    select
       sid
    from
       v$mystat
    where
       rownum <=1;

    select
       to_number(substr(dbms_session.unique_session_id,1,4),'XXXX') mysid
    from dual;

    select distinct
       sid
    from v$mystat;
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 33520523
check out v$session.  This had the sid and serial# of the connection.  It also gives you the SQL_ADDRESS.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

739 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