?
Solved

Oracle session ID

Posted on 2010-08-25
2
Medium Priority
?
688 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 2000 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

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…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

762 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