[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 709
  • Last Modified:

Oracle session ID

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
hussainkhan22
Asked:
hussainkhan22
1 Solution
 
sindhuxyzCommented:
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
 
slightwv (䄆 Netminder) Commented:
check out v$session.  This had the sid and serial# of the connection.  It also gives you the SQL_ADDRESS.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now